Compare commits

..

3 Commits
pgc ... master

Author SHA1 Message Date
niccolo.piazzesi
8f67c1977b Fix test task dependency 2026-02-12 09:11:03 +01:00
niccolo.piazzesi
0303116af9 Update and clean gradle configuration 2026-02-12 09:07:16 +01:00
niccolo.piazzesi
8425e86946 Update ProguardCORE, address API changes 2026-02-12 09:03:30 +01:00
9 changed files with 62 additions and 57 deletions

View File

@@ -5,7 +5,7 @@ plugins {
afterEvaluate {
publishing {
publications.getByName(project.name) {
publications.named(project.name) {
pom {
description = 'Java annotations to configure ProGuard, the free shrinker, optimizer, obfuscator, and preverifier for Java bytecode'
}

View File

@@ -15,7 +15,7 @@ dependencies {
implementation 'org.apache.ant:ant:1.10.15'
}
task fatJar(type: ShadowJar) {
def fatJar = tasks.register("fatJar", ShadowJar) {
destinationDirectory.set(file("$rootDir/lib"))
archiveFileName.set('proguard-ant.jar')
from sourceSets.main.output
@@ -32,7 +32,7 @@ assemble.dependsOn fatJar
afterEvaluate {
publishing {
publications.getByName(project.name) {
publications.named(project.name) {
pom {
description = 'Ant plugin for ProGuard, the free shrinker, optimizer, obfuscator, and preverifier for Java bytecode'
}

View File

@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
id 'java-library'
id 'maven-publish'
@@ -11,10 +13,10 @@ repositories {
mavenCentral()
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
kotlinOptions {
jvmTarget = "${target}"
}
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.fromTarget(project.findProperty("target")))
}
}
dependencies {
@@ -54,24 +56,25 @@ test {
useJUnitPlatform()
}
task testAllJavaVersions() { testAllTask ->
def testAllJavaVersion = tasks.register("testAllJavaVersions"){ testAllTask ->
dependsOn(test) // the usual test runs on Java 8
}
javaVersionsForTest.each {version ->
task("testJava$version", type: Test) {
useJUnitPlatform()
ignoreFailures = true
javaVersionsForTest.each {version ->
def testJavaVersion = tasks.register("testJava$version", Test) {
useJUnitPlatform()
ignoreFailures = true
// The version of bytebuddy used by mockk only supports Java 22 experimentally so far
// if (version >= 22) systemProperty 'net.bytebuddy.experimental', true
// The version of bytebuddy used by mockk only supports Java 22 experimentally so far
// if (version >= 22) systemProperty 'net.bytebuddy.experimental', true
testAllTask.dependsOn(it)
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(version)
}
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(version)
}
}
testAllJavaVersion.configure { it.dependsOn(testJavaVersion) }
}
jacocoTestReport {
@@ -94,7 +97,7 @@ jacocoTestReport {
afterEvaluate {
publishing {
publications.getByName(project.name) {
publications.named(project.name) {
pom {
description = 'ProGuard is a free shrinker, optimizer, obfuscator, and preverifier for Java bytecode'
}

View File

@@ -398,6 +398,7 @@ implements KotlinMetadataVisitor,
return metadataElement != null &&
!usageMarker.isUsed(jvmElement);
}
private boolean shouldShrinkMetadata(KotlinPropertyAccessorMetadata kotlinPropertyAccessorMetadata) {
return kotlinPropertyAccessorMetadata != null && !usageMarker.isUsed(kotlinPropertyAccessorMetadata.referencedMethod);
}

View File

@@ -13,7 +13,7 @@ allprojects {
}
}
task buildDocumentation(type: Exec) {
tasks.register("buildDocumentation", Exec) {
inputs.dir 'docs/md'
inputs.file 'docs/mkdocs.yml'
outputs.dir 'docs/html'
@@ -60,7 +60,7 @@ allprojects { Project project ->
configure(project) {
publishing {
publications {
create(project.name, MavenPublication) {
register(project.name, MavenPublication) {
pom {
artifactId = "proguard-$project.name"
name = "$group:$artifactId"
@@ -115,7 +115,7 @@ allprojects { Project project ->
}
publishing {
publications {
getByName(project.name) {
named(project.name) {
from components.java
}
}
@@ -146,31 +146,34 @@ allprojects { Project project ->
}
distributions {
main {
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
}
into('docs') {
from('docs/md') {
includeEmptyDirs = false
include '**/*.md'
main {
distributionBaseName.set('proguard')
contents {
into("lib") {
def distProjects = [
project(":proguard-app"),
project(":gui"),
project(":retrace"),
project(":ant"),
]
from(distProjects.collect { it.tasks.named { it == "fatJar" } })
}
into('docs') {
from('docs/md') {
includeEmptyDirs = false
include '**/*.md'
}
}
from(rootDir) {
include 'bin/'
include 'examples/'
exclude 'examples/*/build'
exclude 'examples/*/.gradle'
include 'LICENSE'
include 'LICENSE_exception.md'
}
}
from(rootDir) {
include 'bin/'
include 'examples/'
exclude 'examples/*/build'
exclude 'examples/*/.gradle'
include 'LICENSE'
include 'LICENSE_exception.md'
}
}
}
}
distTar {

View File

@@ -1,5 +1,5 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
id 'com.github.johnrengelman.shadow'
id 'java-gradle-plugin'
@@ -24,12 +24,10 @@ gradlePlugin {
}
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.fromTarget(project.findProperty("target")))
}
}
configurations {
@@ -67,7 +65,7 @@ test {
def localRepo = file("$buildDir/local-repo")
task fatJar(type: ShadowJar) {
def fatJar = tasks.register("fatJar", ShadowJar) {
destinationDirectory.set(localRepo)
archiveFileName.set("proguard-gradle-${version}.jar")
from sourceSets.main.output

View File

@@ -17,7 +17,7 @@ dependencies {
implementation 'org.apache.logging.log4j:log4j-core:2.24.2'
}
task fatJar(type: ShadowJar) {
def fatJar = tasks.register("fatJar", ShadowJar) {
destinationDirectory.set(file("$rootDir/lib"))
archiveFileName.set('proguardgui.jar')
from sourceSets.main.output
@@ -35,7 +35,7 @@ assemble.dependsOn fatJar
afterEvaluate {
publishing {
publications.getByName(project.name) {
publications.named(project.name) {
pom {
description = 'ProGuardGUI is an interface for ProGuard, the free shrinker, optimizer, obfuscator, and preverifier for Java bytecode'
}

View File

@@ -16,7 +16,7 @@ dependencies {
jar.manifest.attributes('Implementation-Version': version)
task fatJar(type: ShadowJar) {
def fatJar = tasks.register("fatJar",ShadowJar) {
mainClassName = 'proguard.ProGuard'
destinationDirectory.set(file("$rootDir/lib"))
archiveFileName.set('proguard.jar')

View File

@@ -14,7 +14,7 @@ dependencies {
implementation project(':base')
}
task fatJar(type: ShadowJar) {
def fatJar = tasks.register("fatJar", ShadowJar) {
destinationDirectory.set(file("$rootDir/lib"))
archiveFileName.set('retrace.jar')
from sourceSets.main.output
@@ -31,7 +31,7 @@ assemble.dependsOn fatJar
afterEvaluate {
publishing {
publications.getByName(project.name) {
publications.named(project.name) {
pom {
description = "ReTrace is a companion tool for ProGuard and DexGuard that 'de-obfuscates' stack traces."
}