Skip to content

Commit

Permalink
Merge pull request #721 from square/joel.kotlin-1-9
Browse files Browse the repository at this point in the history
Upgrade to Kotlin 1.9.0, add dual release for Kotlin 1.8.22
  • Loading branch information
JoelWilcox authored Jul 27, 2023
2 parents 4ebc2d2 + 9682541 commit 860cd1d
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 15 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs :
strategy :
fail-fast : false
matrix :
kotlin-version : [ 1.8.21 ]
kotlin-version : [ 1.8.22, 1.9.0 ]

steps :
- uses : actions/checkout@v3
Expand Down Expand Up @@ -135,12 +135,19 @@ jobs :
java-version : '11'
check-latest : true

- name : Publish Snapshots
- name : Publish Snapshots 1.9
run : ./gradlew clean publish --no-build-cache --no-daemon --stacktrace --no-parallel && cd gradle-plugin && ./gradlew clean publish --no-build-cache --no-daemon --stacktrace && cd ..
env :
ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ secrets.SONATYPE_NEXUS_PASSWORD }}

# TODO: Remove when we drop Kotlin 1.8 support
- name : Publish Snapshots 1.8
run : ./gradlew clean publish --no-build-cache --no-daemon --stacktrace --no-parallel -Doverride_kotlin=1.8.22 -PVERSION_NAME=2.4.7-1-8-SNAPSHOT && cd gradle-plugin && ./gradlew clean publish --no-build-cache --no-daemon --stacktrace -Doverride_kotlin=1.8.22 -PVERSION_NAME=2.4.7-1-8-SNAPSHOT && cd ..
env :
ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ secrets.SONATYPE_NEXUS_PASSWORD }}

build-gradle-plugin :
runs-on : ubuntu-latest
defaults :
Expand All @@ -155,7 +162,7 @@ jobs :
# solution.
fail-fast : false
matrix :
kotlin-version : [ 1.8.21 ]
kotlin-version : [ 1.8.22, 1.9.0 ]
agp-version : [ 7.1.1, 7.2.0, 7.3.1 ]

steps :
Expand Down Expand Up @@ -206,7 +213,7 @@ jobs :
# solution.
fail-fast : false
matrix :
kotlin-version : [ 1.8.21 ]
kotlin-version : [ 1.8.22, 1.9.0 ]

steps :
- uses : actions/checkout@v3
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,23 @@ jobs :
java-version : '11'
check-latest : true

- name : Publish Release
- name : Publish Release 1.9
run : ./gradlew clean publish --no-build-cache --no-daemon --stacktrace --no-parallel && cd gradle-plugin && ./gradlew clean publish --no-build-cache --no-daemon --stacktrace && cd ..
env :
ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey : ${{ secrets.ARTIFACT_SIGNING_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword : ''

# TODO: Remove when we drop Kotlin 1.8 support
- name : Publish Release 1.8
run : ./gradlew clean publish --no-build-cache --no-daemon --stacktrace --no-parallel -Doverride_kotlin=1.8.22 -PVERSION_NAME=2.4.7-1-8 && cd gradle-plugin && ./gradlew clean publish --no-build-cache --no-daemon --stacktrace -Doverride_kotlin=1.8.22 -PVERSION_NAME=2.4.7-1-8 && cd ..
env :
ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey : ${{ secrets.ARTIFACT_SIGNING_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword : ''

- name : Extract release notes
id : release_notes
uses : ffurrer2/extract-release-notes@v1
Expand Down
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ String kotlinVersion = libs.versions.kotlin.get()

ext {
ci = isCi
kotlinPreview = !kotlinVersion.startsWith('1.8.21')
fullTestRun = libs.versions.config.fullTestRun.get().toBoolean()
warningsAsErrors = isCi
}
Expand Down
3 changes: 0 additions & 3 deletions compiler/generate_build_properties.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ def generateBuildProperties = project.tasks.register('generateBuildProperties')

inputs.property 'fullTestRun', libs.versions.config.fullTestRun.get()
inputs.property 'kotlinVersion', libs.versions.kotlin.get()
inputs.property 'kotlinPreview', rootProject.ext.kotlinPreview
inputs.property 'warningsAsErrors', rootProject.ext.warningsAsErrors

outputs.file buildPropertiesFile
Expand All @@ -18,8 +17,6 @@ def generateBuildProperties = project.tasks.register('generateBuildProperties')
buildPropertiesFile.parentFile.mkdirs()
buildPropertiesFile.write """\
package com.squareup.anvil.compiler
internal const val KOTLIN_PREVIEW = ${rootProject.ext.kotlinPreview}
internal const val WARNINGS_AS_ERRORS = ${rootProject.ext.warningsAsErrors}
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
GROUP=com.squareup.anvil

# When updating this, make sure to also update the parallel release versions in release.yaml & ci.yml
VERSION_NAME=2.4.7-SNAPSHOT

POM_DESCRIPTION=A Kotlin compiler plugin to make dependency injection with Dagger 2 easier by automatically merging Dagger modules and component interfaces.
Expand Down
13 changes: 7 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@

[versions]
agp = "7.1.0"
autoService = "1.0.1"
autoValue = "1.10"
autoService = "1.1.1"
autoValue = "1.10.1"
dagger = "2.46.1"
dokka = "1.8.20"
espresso = "3.5.1"
gradlePublish = "0.15.0"
kotlin = "1.8.21"
kotlin = "1.9.0"
ktlint = "0.41.0"
ktlintPlugin = "10.2.0"
mavenPublish = "0.18.0"
Expand All @@ -34,7 +35,7 @@ agp-application = { id = "com.android.application", version.ref = "agp" }
agp-library = { id = "com.android.library", version.ref = "agp" }
gradlePublish = { id = "com.gradle.plugin-publish", version.ref = "gradlePublish" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-dokka = { id = "org.jetbrains.dokka", version = "1.7.20" }
kotlin-dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
Expand Down Expand Up @@ -70,10 +71,10 @@ junit = "junit:junit:4.13"
kotlin-annotationProcessingEmbeddable = { module = "org.jetbrains.kotlin:kotlin-annotation-processing-embeddable", version.ref = "kotlin" }
kotlin-compileTesting = "dev.zacsweers.kctfork:core:0.2.0"
kotlin-compiler = { module = "org.jetbrains.kotlin:kotlin-compiler-embeddable", version.ref = "kotlin" }
kotlin-dokka = "org.jetbrains.dokka:dokka-gradle-plugin:1.7.20"
kotlin-dokka = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlin-gradlePluginApi = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin-api", version.ref = "kotlin" }
kotlin-metadata = "org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.6.0"
kotlin-metadata = "org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.6.2"
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }

Expand Down

0 comments on commit 860cd1d

Please sign in to comment.