Skip to content

Commit

Permalink
feat: fully kotlinize (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudshiftchris authored Mar 14, 2024
1 parent f1ed594 commit fff0308
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: 'Build Kotlin AWS CDK DSL'
on:
pull_request: {}
push:
branches: [ "main" ]
pull_request:
branches: [ "*" ]
env:
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: 'false'
ORG_GRADLE_PROJECT_signingKey: '${{ secrets.SIGNING_KEY }}'
Expand Down Expand Up @@ -55,5 +58,4 @@ jobs:
run: './gradlew build --info --scan --stacktrace'

- name: 'publish'
if: github.ref == 'refs/heads/main'
run: './gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --info --no-configuration-cache --stacktrace'
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ signing {
}

val publishingPredicate = provider {
val ci = System.getenv()["CI"] == "true"
val ci = System.getenv("CI") == "true" && System.getenv("GITHUB_REF") == "refs/heads/main"
when {
!ci -> false
else -> true
Expand Down
7 changes: 6 additions & 1 deletion dsl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ dependencies {
}

// lots of generated Kotlin drives memory requirement
kotlin { kotlinDaemonJvmArgs = listOf("-Xms8g", "-Xmx8g") }
kotlin {
kotlinDaemonJvmArgs = when {
System.getenv("CI") == "true" -> listOf("-Xms12g", "-Xmx12g")
else -> listOf("-Xms8g", "-Xmx8g")
}
}

tasks.named<KotlinCompile>("compileKotlin") {
onlyIf {
Expand Down
4 changes: 0 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
group = io.cloudshiftdev.awscdk-dsl-kotlin
version = 0.7.0

# try new K2 compiler to improve compile performance for large generated DSL code
# https://kotlinlang.org/docs/whatsnew19.html#try-the-k2-compiler-in-your-project
kotlin.experimental.tryK2=false

kotlin.code.style=official

org.gradle.jvmargs=-Dfile.encoding\=UTF-8
Expand Down

0 comments on commit fff0308

Please sign in to comment.