mirror of
https://github.com/Guardsquare/proguard.git
synced 2026-03-13 09:50:34 +08:00
Fix Gradle 7 deprecations (#123)
* ensure Gradle 7 compatibility by removing deprecation warnings and update to latest Gradle 6.8.x
This commit is contained in:
@@ -17,6 +17,7 @@ targetCompatibility = "${target}"
|
||||
sourceSets.main {
|
||||
java {
|
||||
srcDirs = ['src']
|
||||
include '**/*.java'
|
||||
}
|
||||
resources {
|
||||
srcDirs = ['src']
|
||||
@@ -28,16 +29,16 @@ sourceSets.main {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile project(':base')
|
||||
compile 'com.guardsquare:proguard-core'
|
||||
compile 'org.apache.ant:ant:1.9.7'
|
||||
implementation project(':base')
|
||||
implementation 'com.guardsquare:proguard-core'
|
||||
implementation 'org.apache.ant:ant:1.9.7'
|
||||
}
|
||||
|
||||
task fatJar(type: ShadowJar) {
|
||||
destinationDirectory.set(file("$rootDir/lib"))
|
||||
archiveFileName.set('proguard-ant.jar')
|
||||
from sourceSets.main.output
|
||||
configurations = [project.configurations.runtime]
|
||||
configurations = [project.configurations.runtimeClasspath]
|
||||
manifest {
|
||||
attributes(
|
||||
'Manifest-Version': '1.0',
|
||||
|
||||
@@ -28,8 +28,8 @@ sourceSets.main {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "com.guardsquare:proguard-core:${proguardCoreVersion}"
|
||||
compile "com.google.code.gson:gson:${gsonVersion}"
|
||||
implementation "com.guardsquare:proguard-core:${proguardCoreVersion}"
|
||||
implementation "com.google.code.gson:gson:${gsonVersion}"
|
||||
}
|
||||
|
||||
jar.manifest.attributes('Implementation-Version': version)
|
||||
@@ -38,7 +38,7 @@ task fatJar(type: ShadowJar) {
|
||||
destinationDirectory.set(file("$rootDir/lib"))
|
||||
archiveFileName.set('proguard.jar')
|
||||
from sourceSets.main.output
|
||||
configurations = [project.configurations.runtime]
|
||||
configurations = [project.configurations.runtimeClasspath]
|
||||
manifest {
|
||||
attributes(
|
||||
'Main-Class': 'proguard.ProGuard',
|
||||
|
||||
@@ -10,11 +10,6 @@ allprojects {
|
||||
version = proguardVersion
|
||||
}
|
||||
|
||||
wrapper {
|
||||
gradleVersion = '6.8'
|
||||
distributionType = Wrapper.DistributionType.ALL
|
||||
}
|
||||
|
||||
task buildDocumentation(type: Exec) {
|
||||
inputs.dir 'docs/md'
|
||||
inputs.file 'docs/mkdocs.yml'
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
2
examples/gradlekotlindsl/gradlew
vendored
2
examples/gradlekotlindsl/gradlew
vendored
@@ -82,6 +82,7 @@ esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
@@ -129,6 +130,7 @@ fi
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
|
||||
25
examples/gradlekotlindsl/gradlew.bat
vendored
25
examples/gradlekotlindsl/gradlew.bat
vendored
@@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
@@ -51,7 +54,7 @@ goto fail
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
@@ -61,28 +64,14 @@ echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
||||
@@ -60,8 +60,8 @@ task repackage(type: Zip) {
|
||||
|
||||
from "${buildDir}/extracted"
|
||||
entryCompression ZipEntryCompression.STORED
|
||||
archiveName "demo-$version-obfuscated.jar"
|
||||
destinationDir(file("${buildDir}/libs"))
|
||||
archiveFileName= "demo-$archiveVersion-obfuscated.jar"
|
||||
destinationDirectory = file("${buildDir}/libs")
|
||||
}
|
||||
|
||||
task proguard(type: ProGuardTask) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -16,10 +16,14 @@ targetCompatibility = "${target}"
|
||||
sourceSets.main {
|
||||
java {
|
||||
srcDirs = ['src']
|
||||
include '**/*.java'
|
||||
exclude 'META-INF/**'
|
||||
}
|
||||
|
||||
groovy {
|
||||
srcDirs = ['src']
|
||||
include '**/*.groovy'
|
||||
exclude 'META-INF/**'
|
||||
}
|
||||
|
||||
resources {
|
||||
@@ -57,11 +61,6 @@ jar {
|
||||
metaInf.from 'src/META-INF'
|
||||
}
|
||||
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(':base')
|
||||
implementation 'com.guardsquare:proguard-core'
|
||||
@@ -70,7 +69,7 @@ dependencies {
|
||||
implementation localGroovy()
|
||||
testImplementation gradleTestKit()
|
||||
testImplementation 'junit:junit:4.13.1'
|
||||
testImplementation "org.spockframework:spock-core:1.1-groovy-2.4@jar"
|
||||
testImplementation "org.spockframework:spock-core:1.3-groovy-2.5"
|
||||
testImplementation "commons-io:commons-io:2.8.0"
|
||||
}
|
||||
|
||||
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -17,6 +17,7 @@ targetCompatibility = "${target}"
|
||||
sourceSets.main {
|
||||
java {
|
||||
srcDirs = ['src']
|
||||
include '**/*.java'
|
||||
}
|
||||
resources {
|
||||
srcDirs = ['src']
|
||||
@@ -28,16 +29,16 @@ sourceSets.main {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile project(':base')
|
||||
compile 'com.guardsquare:proguard-core'
|
||||
compile project(':retrace')
|
||||
implementation project(':base')
|
||||
implementation 'com.guardsquare:proguard-core'
|
||||
implementation project(':retrace')
|
||||
}
|
||||
|
||||
task fatJar(type: ShadowJar) {
|
||||
destinationDirectory.set(file("$rootDir/lib"))
|
||||
archiveFileName.set('proguardgui.jar')
|
||||
from sourceSets.main.output
|
||||
configurations = [project.configurations.runtime]
|
||||
configurations = [project.configurations.runtimeClasspath]
|
||||
manifest {
|
||||
attributes(
|
||||
'Manifest-Version': '1.0',
|
||||
|
||||
@@ -28,15 +28,15 @@ sourceSets.main {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile project(':base')
|
||||
compile 'com.guardsquare:proguard-core'
|
||||
implementation project(':base')
|
||||
implementation 'com.guardsquare:proguard-core'
|
||||
}
|
||||
|
||||
task fatJar(type: ShadowJar) {
|
||||
destinationDirectory.set(file("$rootDir/lib"))
|
||||
archiveFileName.set('retrace.jar')
|
||||
from sourceSets.main.output
|
||||
configurations = [project.configurations.runtime]
|
||||
configurations = [project.configurations.runtimeClasspath]
|
||||
manifest {
|
||||
attributes(
|
||||
'Manifest-Version': '1.0',
|
||||
@@ -44,4 +44,4 @@ task fatJar(type: ShadowJar) {
|
||||
}
|
||||
}
|
||||
|
||||
assemble.dependsOn fatJar
|
||||
assemble.dependsOn fatJar
|
||||
|
||||
Reference in New Issue
Block a user