Skip to content

Commit f57ec42

Browse files
committed
bump R8 to 3.2.49
1 parent bd049a0 commit f57ec42

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

build.gradle.kts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ plugins {
1414
id("signing")
1515
id("org.jetbrains.kotlin.jvm").version("1.5.21")
1616
id("com.gradle.plugin-publish").version("0.15.0")
17-
id("com.gradleup.gr8").version("0.1")
17+
id("com.gradleup.gr8").version("0.3")
1818
}
1919

2020
repositories {
@@ -23,7 +23,7 @@ repositories {
2323
}
2424

2525
group = "com.gradleup"
26-
version = "0.3"
26+
version = "0.4"
2727

2828
project.extra.set("gradle.publish.key", System.getenv("GRADLE_KEY"))
2929
project.extra.set("gradle.publish.secret", System.getenv("GRADLE_SECRET"))
@@ -32,19 +32,25 @@ val shadeConfiguration = configurations.create("shade")
3232

3333
dependencies {
3434
compileOnly(gradleApi())
35-
add("shade", "net.mbonnin.r8:r8:3.0.65")
35+
add("shade", "net.mbonnin.r8:r8:3.2.49")
3636
}
3737

3838
configurations.getByName("compileOnly").extendsFrom(shadeConfiguration)
3939

40-
gr8 {
41-
val shadowedJar = create("plugin") {
42-
configuration("shade")
43-
proguardFile("rules.pro")
44-
}
40+
if (true) {
41+
gr8 {
42+
val shadowedJar = create("plugin") {
43+
configuration("shade")
44+
proguardFile("rules.pro")
45+
}
4546

46-
removeGradleApiFromApi()
47-
replaceOutgoingJar(shadowedJar)
47+
removeGradleApiFromApi()
48+
replaceOutgoingJar(shadowedJar)
49+
}
50+
} else {
51+
configurations.named("implementation").configure {
52+
extendsFrom(shadeConfiguration)
53+
}
4854
}
4955

5056
pluginBundle {

src/main/kotlin/com/gradleup/gr8/Gr8Task.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ abstract class Gr8Task : DefaultTask() {
8484
setProguardMapOutputPath(mapping.get().asFile.toPath())
8585
}
8686
}
87-
.addLibraryResourceProvider(JdkClassFileProvider.fromJdkHome(Jvm.current().javaHome.toPath()))
87+
/**
88+
* We might need an option to override that as if you're running newer versions of Java to run the task
89+
* R8/asm might fail reading this while the target classes might very well be readable
90+
*/
91+
.addLibraryResourceProvider(JdkClassFileProvider.fromJdkHome(Jvm.current().javaHome.toPath()))
8892
.setOutput(outputJar.asFile.get().toPath(), OutputMode.ClassFile)
8993
.addProguardConfigurationFiles(proguardConfigurationFiles.files.map { it.toPath() })
9094
.build()

0 commit comments

Comments
 (0)