Files
proguard/examples/application/build.gradle
niccolo.piazzesi 6776d6a3aa Prepare for 7.8.2 release
Summary: Update all relevant docs to prepare for release containing D56358

Reviewers: dominik.huber, thomas.vochten

Reviewed By: dominik.huber, thomas.vochten

Differential Revision: https://phabricator.guardsquare.com/D57357
2025-12-03 12:32:49 +01:00

61 lines
1.4 KiB
Groovy

import proguard.gradle.ProGuardTask
buildscript {
repositories {
mavenLocal()
mavenCentral()
google()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.8.2'
}
}
plugins {
id 'application'
id 'java'
}
group = 'com.example'
version = '0.0.1'
application {
mainClass.set('com.example.App')
}
repositories {
mavenCentral()
}
dependencies {
implementation 'com.google.guava:guava:30.1.1-jre'
}
ext.baseCoordinates = "${project.name}-${project.version}"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(22)
}
}
tasks.register('proguard', ProGuardTask) {
configuration file('proguard.pro')
injars(tasks.named('jar', Jar).flatMap { it.archiveFile })
// Automatically handle the Java version of this build.
if (System.getProperty('java.version').startsWith('1.')) {
// Before Java 9, the runtime classes were packaged in a single jar file.
libraryjars "${System.getProperty('java.home')}/lib/rt.jar"
} else {
// As of Java 9, the runtime classes are packaged in modular jmod files.
libraryjars "${System.getProperty('java.home')}/jmods/java.base.jmod", jarfilter: '!**.jar', filter: '!module-info.class'
//libraryjars "${System.getProperty('java.home')}/jmods/....."
}
verbose
outjars(layout.buildDirectory.file("libs/${baseCoordinates}-minified.jar"))
}