Skip to content

Instantly share code, notes, and snippets.

@cwensel
Last active October 11, 2023 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cwensel/047766922100d40084232d8c55408862 to your computer and use it in GitHub Desktop.
Save cwensel/047766922100d40084232d8c55408862 to your computer and use it in GitHub Desktop.
{
"app": "${PROJECT_HOME}/gradlew -q run ${GRADLE_OFFLINE_OPTION}",
"output": "build/cdk.out"
}
fun commonCDKEnvironment(): Map<String, String> {
return mapOf(
"PROJECT_HOME" to project.rootDir.absolutePath,
"SUB_PROJECT_HOME" to project.projectDir.absolutePath,
"GRADLE_OFFLINE_OPTION" to if (project.gradle.startParameter.isOffline) "--offline" else ""
)
}
tasks.register("synthCDK", NpxTask::class) {
command = "aws-cdk@${cdkVersion}"
args = listOf("synth")
environment = commonCDKEnvironment()
enabled = file("cdk.json").exists()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment