From fdd742adf04560e2dbe9378342babdf55e3674cb Mon Sep 17 00:00:00 2001 From: rinekri Date: Sun, 24 Mar 2024 19:58:42 +0200 Subject: [PATCH] Update apg to 8.3.1 and gradle to 8.7, and other libs --- .github/workflows/pre-merge.yaml | 2 +- .github/workflows/publish-plugin.yaml | 2 +- README.md | 1 - .../src/main/groovy/kotlin-convention.gradle | 23 ++++++++------- build.gradle.kts | 2 +- example/app/build.gradle.kts | 8 ++--- example/build-types-gradle/build.gradle | 7 +++-- example/build-types/build.gradle.kts | 7 +++-- example/dimensions/build.gradle.kts | 7 +++-- example/flavors/build.gradle.kts | 7 +++-- gradle/libs.versions.toml | 10 +++---- gradle/wrapper/gradle-wrapper.properties | 2 +- plugin-build/build.gradle.kts | 4 +-- plugin-build/plugin/build.gradle.kts | 29 +++++++++---------- 14 files changed, 57 insertions(+), 54 deletions(-) diff --git a/.github/workflows/pre-merge.yaml b/.github/workflows/pre-merge.yaml index ac790dc..7681944 100644 --- a/.github/workflows/pre-merge.yaml +++ b/.github/workflows/pre-merge.yaml @@ -34,7 +34,7 @@ jobs: - name: Setup java uses: actions/setup-java@v1 with: - java-version: '11' + java-version: '17' - name: Run Gradle tasks run: ./gradlew preMerge --continue - name: Stop Gradle diff --git a/.github/workflows/publish-plugin.yaml b/.github/workflows/publish-plugin.yaml index 087e491..67c1542 100644 --- a/.github/workflows/publish-plugin.yaml +++ b/.github/workflows/publish-plugin.yaml @@ -29,7 +29,7 @@ jobs: - name: Setup java uses: actions/setup-java@v1 with: - java-version: '11' + java-version: '17' - name: Run Gradle tasks run: ./gradlew preMerge --continue - name: Publish on Plugin Portal diff --git a/README.md b/README.md index 868191b..52642f8 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,6 @@ Using jar: // and this plugin (ru.kode.android.build-publish) plugins { id("com.android.application") - id("com.google.firebase.appdistribution") id("ru.kode.android.build-publish") } ``` diff --git a/build-conventions/src/main/groovy/kotlin-convention.gradle b/build-conventions/src/main/groovy/kotlin-convention.gradle index 7d7d376..54261cb 100644 --- a/build-conventions/src/main/groovy/kotlin-convention.gradle +++ b/build-conventions/src/main/groovy/kotlin-convention.gradle @@ -1,3 +1,6 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + // plugins block in groovy script doesn't support using "alias(..)" // see https://github.com/gradle/gradle/issues/15383#issuecomment-1396061277 // but outside of plugins block everything works ok @@ -9,17 +12,17 @@ plugins { kotlin { jvmToolchain { - languageVersion = JavaLanguageVersion.of(11) + languageVersion = JavaLanguageVersion.of(17) } } -tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) { - kotlinOptions { - jvmTarget = "11" - freeCompilerArgs += "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi" - freeCompilerArgs += "-opt-in=kotlinx.coroutines.FlowPreview" - freeCompilerArgs += "-opt-in=kotlin.contracts.ExperimentalContracts" - freeCompilerArgs += "-Xopt-in=kotlin.ExperimentalStdlibApi" +tasks.withType(KotlinCompile).configureEach { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_17) + freeCompilerArgs.add("-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi") + freeCompilerArgs.add("-opt-in=kotlinx.coroutines.FlowPreview") + freeCompilerArgs.add("-opt-in=kotlin.contracts.ExperimentalContracts") + freeCompilerArgs.add("-Xopt-in=kotlin.ExperimentalStdlibApi") } } @@ -43,7 +46,7 @@ detekt { } tasks.withType(io.gitlab.arturbosch.detekt.Detekt).configureEach { - jvmTarget = "11" + jvmTarget = "17" // "exclude(**/generated/**)" doesn't work for some reason, see // https://github.com/detekt/detekt/issues/4127#issuecomment-1260733842 exclude { @@ -61,5 +64,5 @@ tasks.withType(io.gitlab.arturbosch.detekt.Detekt).configureEach { } tasks.withType(io.gitlab.arturbosch.detekt.DetektCreateBaselineTask).configureEach { - jvmTarget = "11" + jvmTarget = "17" } diff --git a/build.gradle.kts b/build.gradle.kts index 47cf21d..1a3d7de 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,7 +15,7 @@ val dependsOnRecursivelyByName = { task: Task, name: String -> } tasks.register("clean", Delete::class.java) { - delete(rootProject.buildDir) + delete(layout.buildDirectory) dependsOnRecursivelyByName(this, "clean") dependsOn(gradle.includedBuild("plugin-build").task(":clean")) } diff --git a/example/app/build.gradle.kts b/example/app/build.gradle.kts index 57e4698..1738f8f 100644 --- a/example/app/build.gradle.kts +++ b/example/app/build.gradle.kts @@ -1,16 +1,16 @@ plugins { id("com.android.application") - id("com.google.firebase.appdistribution") id("ru.kode.android.build-publish") } android { - compileSdk = 33 + namespace = "ru.kode.android.app" + compileSdk = 34 defaultConfig { applicationId = "com.example.dimensions.android" - minSdk = 21 - targetSdk = 33 + minSdk = 26 + targetSdk = 34 versionCode = 1 versionName = "1.0" } diff --git a/example/build-types-gradle/build.gradle b/example/build-types-gradle/build.gradle index 98d7997..7badf35 100644 --- a/example/build-types-gradle/build.gradle +++ b/example/build-types-gradle/build.gradle @@ -5,12 +5,13 @@ plugins { } android { - compileSdk 33 + namespace = "ru.kode.android.build.types.example" + compileSdk 34 defaultConfig { applicationId "com.example.build.types.android" - minSdk 31 - targetSdk 33 + minSdk 26 + targetSdk 34 versionCode 1 versionName "1.0" } diff --git a/example/build-types/build.gradle.kts b/example/build-types/build.gradle.kts index dcd390a..7a8925e 100644 --- a/example/build-types/build.gradle.kts +++ b/example/build-types/build.gradle.kts @@ -4,12 +4,13 @@ plugins { } android { - compileSdk = 33 + namespace = "ru.kode.android.build.types.example" + compileSdk = 34 defaultConfig { applicationId = "com.example.build.types.android" - minSdk = 31 - targetSdk = 33 + minSdk = 26 + targetSdk = 34 versionCode = 1 versionName = "1.0" } diff --git a/example/dimensions/build.gradle.kts b/example/dimensions/build.gradle.kts index 71073c6..6e55a1e 100644 --- a/example/dimensions/build.gradle.kts +++ b/example/dimensions/build.gradle.kts @@ -4,12 +4,13 @@ plugins { } android { - compileSdk = 33 + namespace = "ru.kode.android.dimensions.example" + compileSdk = 34 defaultConfig { applicationId = "com.example.dimensions.android" - minSdk = 31 - targetSdk = 33 + minSdk = 26 + targetSdk = 34 versionCode = 1 versionName = "1.0" } diff --git a/example/flavors/build.gradle.kts b/example/flavors/build.gradle.kts index c598dcc..b3ab7c2 100644 --- a/example/flavors/build.gradle.kts +++ b/example/flavors/build.gradle.kts @@ -4,12 +4,13 @@ plugins { } android { - compileSdk = 33 + namespace = "ru.kode.android.flavors.example" + compileSdk = 34 defaultConfig { applicationId = "com.example.flavors.android" - minSdk = 31 - targetSdk = 33 + minSdk = 26 + targetSdk = 34 versionCode = 1 versionName = "1.0" } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a78bb98..e9220db 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,16 +1,16 @@ [versions] -kotlin = "1.9.22" -agp = "7.4.1" +kotlin = "1.9.23" +agp = "8.3.1" detekt = "1.23.5" ktlint = "12.1.0" firebaseAppdistribution = "4.2.0" grgit = "5.0.0" -publish = "0.14.0" -okhttp = "4.11.0" +publish = "1.2.1" +okhttp = "4.12.0" moshi = "1.15.0" retrofit = "2.9.0" junit = "4.13.2" -ksp = "1.9.22-1.0.17" +ksp = "1.9.23-1.0.19" [libraries] agp = { module = "com.android.tools.build:gradle", version.ref = "agp" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8049c68..48c0a02 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.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/plugin-build/build.gradle.kts b/plugin-build/build.gradle.kts index f567fdc..0a62af9 100644 --- a/plugin-build/build.gradle.kts +++ b/plugin-build/build.gradle.kts @@ -7,7 +7,7 @@ plugins { allprojects { group = "ru.kode.android" - version = "1.3.0-alpha01" + version = "1.3.0-alpha02" } val dependsOnRecursivelyByName = { task: Task, name: String -> @@ -19,7 +19,7 @@ val dependsOnRecursivelyByName = { task: Task, name: String -> } tasks.register("clean", Delete::class.java) { - delete(rootProject.buildDir) + delete(layout.buildDirectory) dependsOnRecursivelyByName(this, "clean") } diff --git a/plugin-build/plugin/build.gradle.kts b/plugin-build/plugin/build.gradle.kts index ad8523d..1509f7b 100644 --- a/plugin-build/plugin/build.gradle.kts +++ b/plugin-build/plugin/build.gradle.kts @@ -6,7 +6,6 @@ plugins { } dependencies { - implementation(kotlin("stdlib-jdk7")) implementation(gradleApi()) implementation(libs.agp) implementation(libs.firebaseAppdistribution) @@ -24,33 +23,31 @@ dependencies { } gradlePlugin { + website.set("https://github.com/appKODE/build-publish-plugin") + vcsUrl.set("https://github.com/appKODE/build-publish-plugin") + plugins { create("ru.kode.android.build-publish") { id = "ru.kode.android.build-publish" + displayName = "Configure project with Firebase App Distribution and changelogs" implementationClass = "ru.kode.android.build.publish.plugin.BuildPublishPlugin" version = project.version + description = "Android plugin to publish bundles and apks to Firebase App Distribution with changelogs" + tags.set(listOf("firebase", "publish", "changelog", "build")) } } } -// Configuration Block for the Plugin Marker artifact on Plugin Central -pluginBundle { - website = "https://github.com/appKODE/build-publish-plugin" - vcsUrl = "https://github.com/appKODE/build-publish-plugin" - description = "Android plugin to publish bundles and apks to Firebase App Distribution with changelogs" - tags = listOf("firebase", "publish", "changelog", "build") +publishing { + publications { + create("maven") { + groupId = project.group.toString() + artifactId = "ru.kode.android.build-publish".removePrefix("$groupId.") + version = project.version.toString() - plugins { - getByName("ru.kode.android.build-publish") { - displayName = "Configure project with Firebase App Distribution and changelogs" + from(components["java"]) } } - - mavenCoordinates { - groupId = project.group.toString() - artifactId = "ru.kode.android.build-publish".removePrefix("$groupId.") - version = project.version.toString() - } } tasks.create("setupPluginUploadFromEnvironment") {