Skip to content

Commit 835b5d5

Browse files
committed
Upgrade to Gradle 8
1 parent cdaa124 commit 835b5d5

File tree

9 files changed

+301
-31
lines changed

9 files changed

+301
-31
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3434
### Security
3535
- No security issues fixed!
3636

37+
## [4.0.0] - 2023-11-07
38+
### Changed
39+
- BREAKING CHANGE: Bump Gradle version to 8 and AGP version to 8.1.2.
40+
- Update dependencies.
41+
3742
## [3.4.2] - 2023-08-28
3843
### Fixed
3944
- Fix tags not being sent as String JSON array. _Thanks to [@bogdanzurac](https://github.com/bogdanzurac) for the contribution!_
@@ -478,7 +483,8 @@ res_dir_path -> resDirPath
478483
### Added
479484
- Initial release.
480485

481-
[Unreleased]: https://github.com/hyperdevs-team/poeditor-android-gradle-plugin/compare/3.4.2...HEAD
486+
[Unreleased]: https://github.com/hyperdevs-team/poeditor-android-gradle-plugin/compare/4.0.0...HEAD
487+
[4.0.0]: https://github.com/hyperdevs-team/poeditor-android-gradle-plugin/compare/3.4.2...4.0.0
482488
[3.4.2]: https://github.com/hyperdevs-team/poeditor-android-gradle-plugin/compare/3.4.1...3.4.2
483489
[3.4.1]: https://github.com/hyperdevs-team/poeditor-android-gradle-plugin/compare/3.4.0...3.4.1
484490
[3.4.0]: https://github.com/hyperdevs-team/poeditor-android-gradle-plugin/compare/3.3.0...3.4.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This plug-in super-charges your Android project by providing tasks to download y
88
It also provides a built-in syntax to handle placeholders to enhance the already awesome Android support from PoEditor.
99

1010
## Minimum requirements
11-
* Android Gradle Plug-in 7.0 or above
11+
* Android Gradle Plug-in 8.0 or above
1212

1313
## Setting Up
1414
In your main `build.gradle`, add [jitpack.io](https://jitpack.io/) repository in the `buildscript` block and include the plug-in as a dependency:

build.gradle.kts

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ dependencies {
6464
}
6565

6666
java {
67-
sourceCompatibility = JavaVersion.VERSION_1_8
68-
targetCompatibility = JavaVersion.VERSION_1_8
67+
sourceCompatibility = JavaVersion.toVersion(libs.versions.java.sdk.get())
68+
targetCompatibility = JavaVersion.toVersion(libs.versions.java.sdk.get())
6969

7070
withJavadocJar()
7171
withSourcesJar()
@@ -79,7 +79,7 @@ tasks.javadoc {
7979

8080
detekt {
8181
toolVersion = libs.versions.detekt.get()
82-
config = files("${project.rootDir}/config/detekt.yml")
82+
config.setFrom(files("${project.rootDir}/config/detekt.yml"))
8383
autoCorrect = true
8484
}
8585

@@ -94,9 +94,10 @@ tasks {
9494
maxHeapSize = "1G"
9595
}
9696

97-
withType<io.gitlab.arturbosch.detekt.Detekt> {
98-
// Target version of the generated JVM bytecode. It is used for type resolution.
99-
this.jvmTarget = "1.8"
97+
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
98+
kotlinOptions {
99+
jvmTarget = libs.versions.java.sdk.get()
100+
}
100101
}
101102

102103
val installGitHooks by registering(Copy::class) {
@@ -169,18 +170,16 @@ publishing {
169170
}
170171
}
171172
}
172-
173-
// https://github.com/ben-manes/gradle-versions-plugin
174-
// Disallow release candidates as upgradable versions from stable versions
175-
fun String.isNonStable(): Boolean {
176-
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { toUpperCase().contains(it) }
177-
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
178-
val isStable = stableKeyword || regex.matches(this)
179-
return isStable.not()
180-
}
181-
173+
// Get only stable versions when running dependencyUpdates
182174
tasks.withType<DependencyUpdatesTask> {
175+
fun isNonStable(version: String): Boolean {
176+
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) }
177+
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
178+
val isStable = stableKeyword || regex.matches(version)
179+
return isStable.not()
180+
}
181+
183182
rejectVersionIf {
184-
candidate.version.isNonStable() && !currentVersion.isNonStable()
183+
isNonStable(this.candidate.version) && !isNonStable(this.currentVersion)
185184
}
186185
}

gradle/libs.versions.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
[versions]
2-
kotlin = "1.8.20-RC"
3-
detekt = "1.22.0"
4-
moshi = "1.14.0"
2+
java-sdk = "17"
3+
4+
kotlin = "1.9.10"
5+
detekt = "1.23.3"
6+
moshi = "1.15.0"
57
retrofit = "2.9.0"
6-
okhttp = "4.10.0"
8+
okhttp = "4.12.0"
79

810
[libraries]
9-
android-buildTools = "com.android.tools.build:gradle:7.3.0"
11+
android-buildTools = "com.android.tools.build:gradle:8.1.2"
1012

1113
kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
1214
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
@@ -30,7 +32,7 @@ detekt-formatting = { group = "io.gitlab.arturbosch.detekt", name = "detekt-form
3032
[plugins]
3133
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
3234
gitVersionGradle = { id = "com.gladed.androidgitversion", version = "0.4.14"}
33-
versionsUpdate = { id = "com.github.ben-manes.versions", version = "0.46.0" }
35+
versionsUpdate = { id = "com.github.ben-manes.versions", version = "0.49.0" }
3436

3537
[bundles]
3638
moshi = ["moshi", "moshi-kotlin", "moshi-adapters"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

settings.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,4 @@
1616
* limitations under the License.
1717
*/
1818

19-
enableFeaturePreview("VERSION_CATALOGS")
20-
2119
rootProject.name = "poeditor-android-gradle-plugin"

src/main/kotlin/com/hyperdevs/poeditor/gradle/PoEditorStringsImporter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
package com.hyperdevs.poeditor.gradle
2020

21+
import com.hyperdevs.poeditor.gradle.adapters.PoEditorDateJsonAdapter
2122
import com.hyperdevs.poeditor.gradle.ktx.downloadUrlToString
2223
import com.hyperdevs.poeditor.gradle.network.PoEditorApiControllerImpl
2324
import com.hyperdevs.poeditor.gradle.network.api.ExportType
@@ -30,7 +31,6 @@ import com.hyperdevs.poeditor.gradle.utils.logger
3031
import com.hyperdevs.poeditor.gradle.xml.AndroidXmlWriter
3132
import com.hyperdevs.poeditor.gradle.xml.XmlPostProcessor
3233
import com.squareup.moshi.Moshi
33-
import com.squareup.moshi.adapters.PoEditorDateJsonAdapter
3434
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
3535
import okhttp3.HttpUrl.Companion.toHttpUrl
3636
import okhttp3.OkHttpClient

0 commit comments

Comments
 (0)