@@ -10,8 +10,8 @@ buildscript {
1010
1111plugins {
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
1717group ' 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 (" $b uildDir /libs/$a rchivesBaseName -r8.jar" )
101+ def r8File = new File (" ${ layout.buildDirectory.get().asFile } /libs/${ project.name } -r8.jar" )
106102tasks. 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' ,
0 commit comments