diff --git a/ant/build.gradle b/ant/build.gradle index f1d8c2c1..1473ab2d 100644 --- a/ant/build.gradle +++ b/ant/build.gradle @@ -1,7 +1,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { - id 'com.github.johnrengelman.shadow' + id 'com.gradleup.shadow' id 'java' id 'maven-publish' } @@ -15,21 +15,17 @@ dependencies { implementation(libs.ant) } -def fatJar = tasks.register("fatJar", ShadowJar) { +tasks.named('shadowJar', ShadowJar) { destinationDirectory.set(file("$rootDir/lib")) archiveFileName.set('proguard-ant.jar') - from sourceSets.main.output - configurations = [project.configurations.runtimeClasspath] manifest { attributes( - 'Manifest-Version': '1.0', 'Multi-Release': true, - 'Implementation-Version': archiveVersion.get()) + 'Implementation-Version': archiveVersion.get(), + ) } } -assemble.dependsOn fatJar - afterEvaluate { publishing { publications.named(project.name) { diff --git a/build.gradle b/build.gradle index 36bee48e..feed765a 100644 --- a/build.gradle +++ b/build.gradle @@ -7,6 +7,7 @@ plugins { id 'io.github.gradle-nexus.publish-plugin' id 'signing' alias(libs.plugins.kotlin.jvm) apply(false) + id "com.gradleup.shadow" version "9.1.0" apply false } allprojects { @@ -170,7 +171,7 @@ distributions { project(":retrace"), project(":ant"), ] - from(distProjects.collect { it.tasks.named { it == "fatJar" } }) + from(distProjects.collect { it.tasks.named { it == "shadowJar" } }) } into('docs') { from('docs/md') { diff --git a/gradle-plugin/build.gradle b/gradle-plugin/build.gradle index a016efff..5fd3ae35 100644 --- a/gradle-plugin/build.gradle +++ b/gradle-plugin/build.gradle @@ -1,7 +1,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { - id 'com.github.johnrengelman.shadow' + id 'com.gradleup.shadow' id 'java-gradle-plugin' id 'org.jetbrains.kotlin.jvm' id 'maven-publish' @@ -53,20 +53,20 @@ test { def localRepo = file("$buildDir/local-repo") -def fatJar = tasks.register("fatJar", ShadowJar) { +def shadowJar = tasks.named('shadowJar', ShadowJar) { destinationDirectory.set(localRepo) archiveFileName.set("proguard-gradle-${version}.jar") - from sourceSets.main.output - configurations = [project.configurations.fatJar] + configurations = provider { [project.configurations.fatJar] } manifest { attributes( 'Main-Class': 'proguard.ProGuard', - 'Implementation-Version': archiveVersion.get()) + 'Implementation-Version': archiveVersion.get(), + ) } } tasks.withType(Test).configureEach { - dependsOn fatJar + dependsOn shadowJar systemProperty "local.repo", localRepo.toURI() systemProperty "proguard.version", version systemProperty "agp.version", libs.versions.agp.get() diff --git a/gui/build.gradle b/gui/build.gradle index d795f857..76e3b5bd 100644 --- a/gui/build.gradle +++ b/gui/build.gradle @@ -1,7 +1,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { - id 'com.github.johnrengelman.shadow' + id 'com.gradleup.shadow' id 'java' id 'maven-publish' } @@ -17,22 +17,18 @@ dependencies { implementation 'org.apache.logging.log4j:log4j-core:2.24.2' } -def fatJar = tasks.register("fatJar", ShadowJar) { +tasks.named('shadowJar', ShadowJar) { destinationDirectory.set(file("$rootDir/lib")) archiveFileName.set('proguardgui.jar') - from sourceSets.main.output - configurations = [project.configurations.runtimeClasspath] manifest { attributes( - 'Manifest-Version': '1.0', 'Main-Class': 'proguard.gui.ProGuardGUI', 'Multi-Release': true, - 'Implementation-Version': archiveVersion.get()) + 'Implementation-Version': archiveVersion.get(), + ) } } -assemble.dependsOn fatJar - afterEvaluate { publishing { publications.named(project.name) { diff --git a/proguard-app/build.gradle b/proguard-app/build.gradle index 2b6ec799..3bd0b251 100644 --- a/proguard-app/build.gradle +++ b/proguard-app/build.gradle @@ -1,7 +1,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { - id 'com.github.johnrengelman.shadow' + id 'com.gradleup.shadow' id 'java' id 'application' } @@ -10,23 +10,23 @@ repositories { mavenCentral() } +application { + mainClass = 'proguard.ProGuard' +} + dependencies { implementation project(':base') } jar.manifest.attributes('Implementation-Version': version) -def fatJar = tasks.register("fatJar",ShadowJar) { - mainClassName = 'proguard.ProGuard' +tasks.named('shadowJar', ShadowJar) { destinationDirectory.set(file("$rootDir/lib")) archiveFileName.set('proguard.jar') - configurations = [project.configurations.runtimeClasspath] manifest { attributes( 'Main-Class': 'proguard.ProGuard', 'Multi-Release': true, - 'Implementation-Version': archiveVersion.get()) + ) } } - -assemble.dependsOn fatJar diff --git a/retrace/build.gradle b/retrace/build.gradle index 52d26f94..14ae2595 100644 --- a/retrace/build.gradle +++ b/retrace/build.gradle @@ -1,7 +1,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { - id 'com.github.johnrengelman.shadow' + id 'com.gradleup.shadow' id 'java' id 'maven-publish' } @@ -14,21 +14,17 @@ dependencies { implementation project(':base') } -def fatJar = tasks.register("fatJar", ShadowJar) { +tasks.named('shadowJar', ShadowJar) { destinationDirectory.set(file("$rootDir/lib")) archiveFileName.set('retrace.jar') - from sourceSets.main.output - configurations = [project.configurations.runtimeClasspath] manifest { attributes( - 'Manifest-Version': '1.0', 'Multi-Release': true, - 'Main-Class': 'proguard.retrace.ReTrace') + 'Main-Class': 'proguard.retrace.ReTrace', + ) } } -assemble.dependsOn fatJar - afterEvaluate { publishing { publications.named(project.name) { diff --git a/settings.gradle b/settings.gradle index a0337223..e3a34f96 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,9 +1,6 @@ pluginManagement { resolutionStrategy { eachPlugin { - if (requested.id.id == 'com.github.johnrengelman.shadow') { - useVersion '8.1.1' - } if (requested.id.id == 'io.github.gradle-nexus.publish-plugin') { useVersion '2.0.0' }