Skip to content

Commit

Permalink
Merge pull request #48 from appKODE/update-agp-and-gradle
Browse files Browse the repository at this point in the history
Update apg to 8.3.1 and gradle to 8.7, and other libs
  • Loading branch information
rinekri authored Apr 4, 2024
2 parents 2b8c485 + fdd742a commit 14b1b33
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pre-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
```
Expand Down
23 changes: 13 additions & 10 deletions build-conventions/src/main/groovy/kotlin-convention.gradle
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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")
}
}

Expand All @@ -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 {
Expand All @@ -61,5 +64,5 @@ tasks.withType(io.gitlab.arturbosch.detekt.Detekt).configureEach {
}

tasks.withType(io.gitlab.arturbosch.detekt.DetektCreateBaselineTask).configureEach {
jvmTarget = "11"
jvmTarget = "17"
}
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
Expand Down
8 changes: 4 additions & 4 deletions example/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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"
}
Expand Down
7 changes: 4 additions & 3 deletions example/build-types-gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
7 changes: 4 additions & 3 deletions example/build-types/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
7 changes: 4 additions & 3 deletions example/dimensions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
7 changes: 4 additions & 3 deletions example/flavors/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions plugin-build/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand All @@ -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")
}

Expand Down
29 changes: 13 additions & 16 deletions plugin-build/plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ plugins {
}

dependencies {
implementation(kotlin("stdlib-jdk7"))
implementation(gradleApi())
implementation(libs.agp)
implementation(libs.firebaseAppdistribution)
Expand All @@ -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<MavenPublication>("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") {
Expand Down

0 comments on commit 14b1b33

Please sign in to comment.