Skip to content

Commit 1cc947b

Browse files
committed
Update gradle & related deps+config and CI JVM version
1 parent d43d273 commit 1cc947b

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
java-version: 8
1515
distribution: adopt-hotspot
1616

17-
- name: Set up JDK 14 for build
17+
- name: Set up JDK 24 for build
1818
uses: actions/setup-java@v3
1919
with:
20-
java-version: 14
20+
java-version: 24
2121
distribution: adopt-hotspot
2222

2323
- name: Build & test the agent standalone

build.gradle

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ buildscript {
1010

1111
plugins {
1212
id 'java'
13-
id 'org.jetbrains.kotlin.jvm' version '1.6.21'
14-
id 'com.github.johnrengelman.shadow' version '7.1.2'
13+
id 'org.jetbrains.kotlin.jvm' version '2.2.21'
14+
id 'com.gradleup.shadow' version '9.2.2'
1515
}
1616

1717
group 'tech.httptoolkit'
@@ -90,27 +90,23 @@ shadowJar {
9090
// We have to specifically exclude our reactor stub code here, because we don't want to the type
9191
// stubs that we've manually defined in our own source included here.
9292
exclude 'reactor/'
93-
}
9493

95-
// As part of bundling the JAR, we relocate all dependencies into our namespace:
96-
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
97-
task relocateShadowJar(type: ConfigureShadowRelocation) {
98-
target = tasks.shadowJar
99-
prefix = "tech.httptoolkit.relocated"
94+
// As part of bundling the JAR, we relocate all dependencies into our namespace:
95+
enableAutoRelocation = true
96+
relocationPrefix = "tech.httptoolkit.relocated"
10097
}
101-
tasks.shadowJar.dependsOn tasks.relocateShadowJar
10298

10399
// Then we take this bundled JAR and optimize it. This shrinks it dramatically, but also breaks it, because
104100
// bytebuddy depends on some of our source being unmodified by R8 (frames in advice classes get messed with).
105-
def r8File = new File("$buildDir/libs/$archivesBaseName-r8.jar")
101+
def r8File = new File("${layout.buildDirectory.get().asFile}/libs/${project.name}-r8.jar")
106102
tasks.register('r8Jar', JavaExec) { task ->
107103
def rules = file('r8-rules.txt')
108104
task.dependsOn(tasks.shadowJar)
109105
task.outputs.file(r8File)
110106
task.inputs.files shadowJar.getArchiveFile()
111107

112108
task.classpath(configurations.r8)
113-
task.main = 'com.android.tools.r8.R8'
109+
task.mainClass = 'com.android.tools.r8.R8'
114110
task.args = [
115111
'--release',
116112
'--classfile',

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

test-app/build.gradle

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id 'com.github.johnrengelman.shadow'
3+
id 'com.gradleup.shadow'
44
id 'org.jetbrains.kotlin.jvm'
55
}
66

@@ -54,11 +54,17 @@ compileJava {
5454
targetCompatibility = '11'
5555
}
5656

57+
compileKotlin {
58+
kotlinOptions {
59+
jvmTarget = "11"
60+
}
61+
}
62+
5763
import com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer
5864

59-
shadowJar {
65+
tasks.shadowJar {
6066
transform(AppendingTransformer) {
6167
resource = 'reference.conf' // Required for akka
6268
}
63-
with jar
69+
from jar
6470
}

0 commit comments

Comments
 (0)