Skip to content

Commit 4aca0c2

Browse files
committed
Update build config for Gradle and JDK 17
Switched to JDK 17 in jitpack.yml and updated Gradle build settings for improved performance and compatibility. Changed repository sources in build scripts to use Aliyun mirrors and updated build.gradle and settings.gradle.kts accordingly. Increased Gradle daemon memory and added build optimizations in gradle.properties. Upgraded build_gradle_version to 7.4.2 in Constants.kt.
1 parent 0fd4679 commit 4aca0c2

File tree

5 files changed

+17
-9
lines changed

5 files changed

+17
-9
lines changed

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ buildscript {
22
repositories {
33
maven { url = uri("https://maven.aliyun.com/repository/google") }
44
maven { url = uri("https://maven.aliyun.com/repository/central") }
5-
google()
5+
maven { url = uri("https://maven.aliyun.com/repository/gradle-plugin") }
66
mavenCentral()
77
}
88

@@ -23,7 +23,7 @@ allprojects {
2323
repositories {
2424
maven { url = uri("https://maven.aliyun.com/repository/google") }
2525
maven { url = uri("https://maven.aliyun.com/repository/central") }
26-
google()
26+
maven { url = uri("https://maven.aliyun.com/repository/jcenter") }
2727
mavenCentral()
2828
maven(url = "https://jitpack.io")
2929
}

buildSrc/src/main/java/Constants.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ object AndroidConstants {
99
}
1010

1111
object Versions {
12-
const val build_gradle_version = "7.3.1"
12+
const val build_gradle_version = "7.4.2"
1313
const val kotlin_gradle_plugin_version = "1.9.23"
1414
const val bintray_plugin_version = "1.8.5"
1515

gradle.properties

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# http://www.gradle.org/docs/current/userguide/build_environment.html
77
# Specifies the JVM arguments used for the daemon process.
88
# The setting is particularly useful for tweaking memory settings.
9-
org.gradle.jvmargs=-Xmx1536m
9+
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dhttps.protocols=TLSv1.2,TLSv1.3 -Djdk.tls.client.protocols=TLSv1.2,TLSv1.3
1010
# When configured, Gradle will run in incubating parallel mode.
1111
# This option should only be used with decoupled projects. More details, visit
1212
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
@@ -19,3 +19,10 @@ android.useAndroidX=true
1919
android.enableJetifier=true
2020
# Kotlin code style for this project: "official" or "obsolete":
2121
kotlin.code.style=official
22+
23+
# Gradle build optimization
24+
org.gradle.parallel=true
25+
org.gradle.caching=true
26+
org.gradle.configureondemand=true
27+
org.gradle.daemon=false
28+
kotlin.incremental=false

jitpack.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
jdk:
2-
- openjdk11
2+
- openjdk17
33
before_install:
4-
- sdk install java 11.0.10-open
5-
- sdk use java 11.0.10-open
4+
- sdk install java 17.0.2-open || true
5+
- sdk use java 17.0.2-open || sdk use java 17.0.1-open
6+
install:
7+
- ./gradlew clean assemble publishToMavenLocal --no-daemon --stacktrace

settings.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ pluginManagement {
33
maven { url = uri("https://maven.aliyun.com/repository/gradle-plugin") }
44
maven { url = uri("https://maven.aliyun.com/repository/google") }
55
maven { url = uri("https://maven.aliyun.com/repository/central") }
6-
gradlePluginPortal()
7-
google()
86
mavenCentral()
7+
gradlePluginPortal()
98
}
109
}
1110

0 commit comments

Comments
 (0)