Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions ant/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
}
Expand All @@ -15,21 +15,17 @@ dependencies {
implementation 'org.apache.ant:ant:1.10.15'
}

task fatJar(type: 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',
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the default value, we don't need to declare them explicitly.

'Multi-Release': true,
'Implementation-Version': archiveVersion.get())
'Implementation-Version': archiveVersion.get(),
)
}
}

assemble.dependsOn fatJar
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shadowJar tasks are relied on by assemble tasks from Shadow 9.


afterEvaluate {
publishing {
publications.getByName(project.name) {
Expand Down
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id 'io.github.gradle-nexus.publish-plugin'
id 'signing'
id "org.jetbrains.kotlin.jvm" version "$kotlinVersion" apply false
id "com.gradleup.shadow" version "9.2.1" apply false
}

allprojects {
Expand Down Expand Up @@ -150,10 +151,10 @@ distributions {
distributionBaseName.set('proguard')
contents {
into('lib') {
from tasks.getByPath(':proguard-app:fatJar').outputs
from tasks.getByPath(':gui:fatJar').outputs
from tasks.getByPath(':retrace:fatJar').outputs
from tasks.getByPath(':ant:fatJar').outputs
from tasks.getByPath(':proguard-app:shadowJar').outputs
from tasks.getByPath(':gui:shadowJar').outputs
from tasks.getByPath(':retrace:shadowJar').outputs
from tasks.getByPath(':ant:shadowJar').outputs
}
into('docs') {
from('docs/md') {
Expand Down
12 changes: 6 additions & 6 deletions gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -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-gradle-plugin'
id 'org.jetbrains.kotlin.jvm'
id 'maven-publish'
Expand Down Expand Up @@ -67,20 +67,20 @@ test {

def localRepo = file("$buildDir/local-repo")

task fatJar(type: 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 tasks.named('shadowJar')
systemProperty "local.repo", localRepo.toURI()
systemProperty "proguard.version", version
systemProperty "agp.version", agpVersion
Expand Down
12 changes: 4 additions & 8 deletions gui/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
}
Expand All @@ -17,22 +17,18 @@ dependencies {
implementation 'org.apache.logging.log4j:log4j-core:2.24.2'
}

task fatJar(type: 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.getByName(project.name) {
Expand Down
9 changes: 3 additions & 6 deletions proguard-app/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
}
Expand All @@ -16,17 +16,14 @@ dependencies {

jar.manifest.attributes('Implementation-Version': version)

task fatJar(type: ShadowJar) {
tasks.named('shadowJar', ShadowJar) {
mainClassName = 'proguard.ProGuard'
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
12 changes: 4 additions & 8 deletions retrace/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
}
Expand All @@ -14,21 +14,17 @@ dependencies {
implementation project(':base')
}

task fatJar(type: 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.getByName(project.name) {
Expand Down
3 changes: 0 additions & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -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'
}
Expand Down
Loading