From 86787446605998ff54e37ee209d87768ce6f9728 Mon Sep 17 00:00:00 2001 From: Konstantin Aksenov Date: Fri, 18 Oct 2024 09:52:49 +0200 Subject: [PATCH 1/7] fix(ci): update CI checks node version to 22.10.0 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51b7243..af4023c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: '14' + node-version: '22.10.0' - name: Install libncurses5 run: | From 0265f1bae50c6a22353405726a04bee0e7553788 Mon Sep 17 00:00:00 2001 From: Konstantin Aksenov Date: Fri, 18 Oct 2024 10:13:11 +0200 Subject: [PATCH 2/7] fix(ci): update gradle 8.10.2 --- .github/workflows/ci.yml | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- danger-kotlin-sdk/gradle/wrapper/gradle-wrapper.properties | 2 +- danger-kotlin/gradle/wrapper/gradle-wrapper.properties | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- scripts/install.sh | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af4023c..e329290 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - uses: sdkman/sdkman-action@master with: candidate: gradle - version: 7.4.2 + version: 8.10.2 - name: Install Kotlin run: | diff --git a/danger-kotlin-library/gradle/wrapper/gradle-wrapper.properties b/danger-kotlin-library/gradle/wrapper/gradle-wrapper.properties index aa991fc..1e2fbf0 100644 --- a/danger-kotlin-library/gradle/wrapper/gradle-wrapper.properties +++ b/danger-kotlin-library/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/danger-kotlin-sdk/gradle/wrapper/gradle-wrapper.properties b/danger-kotlin-sdk/gradle/wrapper/gradle-wrapper.properties index 5a735b9..9bcab8b 100644 --- a/danger-kotlin-sdk/gradle/wrapper/gradle-wrapper.properties +++ b/danger-kotlin-sdk/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ #Sun Nov 03 23:08:58 GMT 2019 -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists diff --git a/danger-kotlin/gradle/wrapper/gradle-wrapper.properties b/danger-kotlin/gradle/wrapper/gradle-wrapper.properties index aa991fc..1e2fbf0 100644 --- a/danger-kotlin/gradle/wrapper/gradle-wrapper.properties +++ b/danger-kotlin/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index aa991fc..1e2fbf0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/scripts/install.sh b/scripts/install.sh index a96b8f2..75c3b38 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -39,11 +39,11 @@ if ! [[ -x "$(command -v kotlinc)" ]]; then fi if ! [[ -x "$(command -v gradle)" ]]; then - echo "Installing gradle 7.4.2" - curl -o gradle.zip -L https://downloads.gradle-dn.com/distributions/gradle-7.4.2-bin.zip + echo "Installing gradle 8.10.2" + curl -o gradle.zip -L https://downloads.gradle-dn.com/distributions/gradle-8.10.2-bin.zip mkdir /opt/gradle unzip -d /opt/gradle gradle.zip - echo 'export PATH=/opt/gradle/gradle-7.4.2/bin:$PATH' >> ~/.bash_profile + echo 'export PATH=/opt/gradle/gradle-8.10.2/bin:$PATH' >> ~/.bash_profile rm -rf gradle.zip fi From a6c0324a4a7b1d085e121e9eebf5fa76072ceeec Mon Sep 17 00:00:00 2001 From: Konstantin Aksenov Date: Fri, 18 Oct 2024 10:27:45 +0200 Subject: [PATCH 3/7] fix(ci): update kotlin to 2.0.21 --- .github/workflows/ci.yml | 2 +- Dockerfile | 2 +- danger-kotlin-sample-plugin/build.gradle | 2 +- danger-kotlin-sdk/maven-publish.gradle | 16 +++++----------- danger-kotlin/build.gradle.kts | 4 ++-- dependencyVersions.gradle | 2 +- gradle.properties | 2 +- scripts/install.sh | 4 ++-- 8 files changed, 14 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e329290..16b0642 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: - name: Install Kotlin run: | - curl -o kotlin-compiler.zip -L https://github.com/JetBrains/kotlin/releases/download/v1.7.22/kotlin-compiler-1.7.22.zip + curl -o kotlin-compiler.zip -L https://github.com/JetBrains/kotlin/releases/download/v2.0.21/kotlin-compiler-2.0.21.zip if [[ "$OSTYPE" != "darwin"* ]] then diff --git a/Dockerfile b/Dockerfile index 0957c43..f76de38 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ LABEL "com.github.actions.description"="Runs Kotlin Dangerfiles" LABEL "com.github.actions.icon"="zap" LABEL "com.github.actions.color"="blue" -ARG KOTLINC_VERSION="1.7.22" +ARG KOTLINC_VERSION="2.0.21" ARG DANGER_KOTLIN_VERSION="1.3.1" ARG DANGER_JS_VERSION="11.3.1" diff --git a/danger-kotlin-sample-plugin/build.gradle b/danger-kotlin-sample-plugin/build.gradle index fc1b712..c64edb7 100644 --- a/danger-kotlin-sample-plugin/build.gradle +++ b/danger-kotlin-sample-plugin/build.gradle @@ -9,7 +9,7 @@ buildscript { } plugins { - id 'org.jetbrains.kotlin.jvm' version '1.7.22' + id 'org.jetbrains.kotlin.jvm' version '2.0.21' } apply plugin: 'danger-kotlin-plugin-installer' diff --git a/danger-kotlin-sdk/maven-publish.gradle b/danger-kotlin-sdk/maven-publish.gradle index 7e19725..21f5602 100644 --- a/danger-kotlin-sdk/maven-publish.gradle +++ b/danger-kotlin-sdk/maven-publish.gradle @@ -1,12 +1,12 @@ apply from: file('../secrets.gradle') task sourceJar(type: Jar) { - classifier "sources" + archiveClassifier.set("sources") from sourceSets.main.allJava } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier "javadoc" + archiveClassifier.set("javadoc") from javadoc.destinationDir } @@ -32,14 +32,8 @@ publishing { publications { maven(MavenPublication) { from components.java - artifact sourceJar { - classifier "sources" - from sourceSets.main.allJava - } - artifact javadocJar { - classifier "javadoc" - from javadoc.destinationDir - } + artifact sourceJar + artifact javadocJar pom { name = 'Danger Kotlin SDK' description = 'Develop your own plugin for Danger Kotlin' @@ -81,4 +75,4 @@ publishing { } } } -} \ No newline at end of file +} diff --git a/danger-kotlin/build.gradle.kts b/danger-kotlin/build.gradle.kts index 67c42d0..0896199 100644 --- a/danger-kotlin/build.gradle.kts +++ b/danger-kotlin/build.gradle.kts @@ -14,7 +14,7 @@ kotlin { "linuxX64" -> linuxX64("runner") "macosArm64" -> macosArm64("runner") "mingwX64" -> mingwX64("runner") - else -> throw GradleException("OS '$osName' is not supported.") as Throwable + else -> throw GradleException("OS '$osName' is not supported.") } } else { when (val osName = System.getProperty("os.name")) { @@ -22,7 +22,7 @@ kotlin { "Linux" -> linuxX64("runner") "Mac OS X Apple silicon" -> macosArm64("runner") "Windows 11" -> mingwX64("runner") - else -> throw GradleException("OS '$osName' is not supported.") as Throwable + else -> throw GradleException("OS '$osName' is not supported.") } } diff --git a/dependencyVersions.gradle b/dependencyVersions.gradle index 09ab064..18e2029 100644 --- a/dependencyVersions.gradle +++ b/dependencyVersions.gradle @@ -20,7 +20,7 @@ project.ext.groupIdOkio = 'com.squareup.okio' project.ext.artifactIdOkio = 'okio' // Kotlin -project.ext.versionKotlin = '1.7.22' +project.ext.versionKotlin = '2.0.21' project.ext.groupIdKotlin = 'org.jetbrains.kotlin' project.ext.groupIdKotlinx = 'org.jetbrains.kotlinx' project.ext.artifactIdKotlinMain = 'kotlin-main-kts' diff --git a/gradle.properties b/gradle.properties index d42974a..93d2064 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ -kotlinVersion=1.7.22 +kotlinVersion=2.0.21 kotlin.code.style=official systemProp.org.gradle.internal.publish.checksums.insecure=true diff --git a/scripts/install.sh b/scripts/install.sh index 75c3b38..2aa890a 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -31,8 +31,8 @@ if [[ -n "$sudo" && "$OSTYPE" != "darwin"* ]]; then fi if ! [[ -x "$(command -v kotlinc)" ]]; then - echo "Installing kotlin compiler 1.7.22" - curl -o kotlin-compiler.zip -L https://github.com/JetBrains/kotlin/releases/download/v1.7.22/kotlin-compiler-1.7.22.zip + echo "Installing kotlin compiler 2.0.21" + curl -o kotlin-compiler.zip -L https://github.com/JetBrains/kotlin/releases/download/v2.0.21/kotlin-compiler-2.0.21.zip unzip -d /usr/local/ kotlin-compiler.zip echo 'export PATH=/usr/local/kotlinc/bin:$PATH' >> ~/.bash_profile rm -rf kotlin-compiler.zip From afd5c45d5234915056df0d4f41135d92bdcc9a86 Mon Sep 17 00:00:00 2001 From: Konstantin Aksenov Date: Fri, 18 Oct 2024 10:35:17 +0200 Subject: [PATCH 4/7] fix(ci): disable fail fast ci strategy for matrix --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16b0642..e468c19 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,7 @@ on: pull_request jobs: build: strategy: + fail-fast: false matrix: os: [ubuntu-latest, macos-latest] From 17803d2e47a334a6411891d6acc7e5fabf29bf35 Mon Sep 17 00:00:00 2001 From: Konstantin Aksenov Date: Fri, 18 Oct 2024 10:38:26 +0200 Subject: [PATCH 5/7] fix(ci): set compile target to 1.8 --- danger-kotlin-kts/build.gradle | 5 +++++ danger-kotlin-library/build.gradle | 5 +++++ danger-kotlin-sdk/build.gradle | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/danger-kotlin-kts/build.gradle b/danger-kotlin-kts/build.gradle index 704dad6..726e8d6 100644 --- a/danger-kotlin-kts/build.gradle +++ b/danger-kotlin-kts/build.gradle @@ -36,6 +36,11 @@ compileTestKotlin { kotlinOptions.jvmTarget = "1.8" } +tasks.withType(JavaCompile).configureEach { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + publishing { publications { maven(MavenPublication) { diff --git a/danger-kotlin-library/build.gradle b/danger-kotlin-library/build.gradle index 698926d..85f51a5 100644 --- a/danger-kotlin-library/build.gradle +++ b/danger-kotlin-library/build.gradle @@ -28,6 +28,11 @@ compileTestKotlin { kotlinOptions.jvmTarget = "1.8" } +tasks.withType(JavaCompile).configureEach { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + publishing { publications { maven(MavenPublication) { diff --git a/danger-kotlin-sdk/build.gradle b/danger-kotlin-sdk/build.gradle index 5a0447d..b8aab12 100644 --- a/danger-kotlin-sdk/build.gradle +++ b/danger-kotlin-sdk/build.gradle @@ -21,3 +21,8 @@ compileKotlin { compileTestKotlin { kotlinOptions.jvmTarget = "1.8" } + +tasks.withType(JavaCompile).configureEach { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} From e054208a00d9cf7a0b366653988630a8396dfe56 Mon Sep 17 00:00:00 2001 From: Konstantin Aksenov Date: Fri, 18 Oct 2024 10:50:49 +0200 Subject: [PATCH 6/7] fix(ci): set ExperimentalForeignApi --- danger-kotlin/build.gradle.kts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/danger-kotlin/build.gradle.kts b/danger-kotlin/build.gradle.kts index 0896199..072e88b 100644 --- a/danger-kotlin/build.gradle.kts +++ b/danger-kotlin/build.gradle.kts @@ -44,5 +44,8 @@ kotlin { implementation(kotlin("test-annotations-common")) } } + all { + languageSettings.optIn("kotlinx.cinterop.ExperimentalForeignApi") + } } } From 072884eef40009186e39a9c8b8086b77105ca201 Mon Sep 17 00:00:00 2001 From: Konstantin Aksenov Date: Fri, 18 Oct 2024 13:50:51 +0200 Subject: [PATCH 7/7] fix(ci): run install as sudo --- .github/workflows/ci.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e468c19..d03f732 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,21 +49,20 @@ jobs: run: npm install -g danger - name: Install Danger Kotlin - run: make install - + run: sudo make install + - name: Run tests - run: ./gradlew danger-kotlin-library:test + run: sudo ./gradlew danger-kotlin-library:test - name: Install Plugin Installer - run: ./gradlew danger-plugin-installer:publishToMavenLocal + run: sudo ./gradlew danger-plugin-installer:publishToMavenLocal - name: Build and Install Sample Plugin + working-directory: ./danger-kotlin-sample-plugin run: | - cd danger-kotlin-sample-plugin - gradle wrapper - ./gradlew build - ./gradlew installDangerPlugin - cd .. + sudo gradle wrapper + sudo ./gradlew build + sudo ./gradlew installDangerPlugin - name: Run Danger-Kotlin run: DEBUG='*' danger-kotlin ci --dangerfile Dangerfile_ci.df.kts