Cleanup dependencies (#201)

* We don't need to shadow in `lombok` itself. Gradle must be upgraded to at least 4.6 to support `annotationProcessor`, which is a version that still supports Java 7.
* `args4j-maven-plugin` is intended to use as a maven plugin.
* The requirement for `jaxb-api` was removed in 81cba7d58c0ce8a334204700dca669f2ad8e16ff
* We are only using `simple-xml`, don't need the whole `retrofit`+`okhttp`+`okio` chain.
* Resolve deprecation warnings in JNA code.
This commit is contained in:
Andy Li
2020-04-26 21:29:48 +08:00
committed by GitHub
parent 87533a1262
commit d529da172a
10 changed files with 71 additions and 38 deletions

View File

@@ -3,7 +3,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1' classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.4'
} }
} }
apply plugin: 'java' apply plugin: 'java'
@@ -19,20 +19,23 @@ compileJava {
options.compilerArgs << '-XDignore.symbol.file' options.compilerArgs << '-XDignore.symbol.file'
} }
shadowJar {
exclude 'OSGI-OPT/' // args4j garbage
}
repositories { repositories {
jcenter() jcenter()
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
compile 'org.projectlombok:lombok:1.18.8' compileOnly 'org.projectlombok:lombok:1.18.12'
compile 'org.kohsuke.args4j:args4j-maven-plugin:2.0.31' annotationProcessor 'org.projectlombok:lombok:1.18.12'
compile 'net.lingala.zip4j:zip4j:1.3.2'
compile 'net.java.dev.jna:jna-platform:4.0.0'
compile 'net.java.dev.jna:jna:4.0.0'
compile 'javax.xml.bind:jaxb-api:2.3.1'
compile 'com.squareup.retrofit2:converter-simplexml:2.3.0'
compile 'args4j:args4j:2.33'
compile 'net.lingala.zip4j:zip4j:1.3.3'
compile 'net.java.dev.jna:jna-platform:5.0.0'
compile 'org.simpleframework:simple-xml:2.7.1'
implementation 'com.formdev:flatlaf:0.30' implementation 'com.formdev:flatlaf:0.30'
} }

Binary file not shown.

View File

@@ -1,6 +1,6 @@
#Sun Aug 11 10:36:15 CEST 2019 #Fri Apr 10 00:43:49 CST 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip zipStoreBase=GRADLE_USER_HOME

51
gradlew vendored
View File

@@ -1,5 +1,21 @@
#!/usr/bin/env sh #!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
############################################################################## ##############################################################################
## ##
## Gradle start up script for UN*X ## Gradle start up script for UN*X
@@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"` APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS="" DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum" MAX_FD="maximum"
@@ -109,8 +125,8 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi fi
# For Cygwin, switch paths to Windows format before running java # For Cygwin or MSYS, switch paths to Windows format before running java
if $cygwin ; then if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"` APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"` JAVACMD=`cygpath --unix "$JAVACMD"`
@@ -138,19 +154,19 @@ if $cygwin ; then
else else
eval `echo args$i`="\"$arg\"" eval `echo args$i`="\"$arg\""
fi fi
i=$((i+1)) i=`expr $i + 1`
done done
case $i in case $i in
(0) set -- ;; 0) set -- ;;
(1) set -- "$args0" ;; 1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;; 2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;; 3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;; 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac esac
fi fi
@@ -159,14 +175,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " " echo " "
} }
APP_ARGS=$(save "$@") APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules # Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@" exec "$JAVACMD" "$@"

21
gradlew.bat vendored
View File

@@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off @if "%DEBUG%" == "" @echo off
@rem ########################################################################## @rem ##########################################################################
@rem @rem
@@ -13,8 +29,11 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% 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. @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= set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe @rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome if defined JAVA_HOME goto findJavaFromJavaHome

View File

@@ -22,7 +22,7 @@ public class Nvidia implements GPULister {
} }
CUDA cudalib = null; CUDA cudalib = null;
try { try {
cudalib = (CUDA) Native.loadLibrary(path, CUDA.class); cudalib = (CUDA) Native.load(path, CUDA.class);
} }
catch (java.lang.UnsatisfiedLinkError e) { catch (java.lang.UnsatisfiedLinkError e) {
return null; return null;

View File

@@ -40,7 +40,7 @@ public class OpenCL implements GPULister {
String path = "OpenCL"; String path = "OpenCL";
try { try {
lib = (OpenCLLib) Native.loadLibrary(path, OpenCLLib.class); lib = (OpenCLLib) Native.load(path, OpenCLLib.class);
} }
catch (java.lang.UnsatisfiedLinkError e) { catch (java.lang.UnsatisfiedLinkError e) {
System.out.println("OpenCL::getGpus failed(A) to load OpenCL lib (path: " + path + ")"); System.out.println("OpenCL::getGpus failed(A) to load OpenCL lib (path: " + path + ")");

View File

@@ -127,7 +127,7 @@ public class Windows extends OS {
// disable a popup because the renderer might crash (seg fault) // disable a popup because the renderer might crash (seg fault)
Kernel32Lib kernel32lib = null; Kernel32Lib kernel32lib = null;
try { try {
kernel32lib = (Kernel32Lib) Native.loadLibrary(Kernel32Lib.path, Kernel32Lib.class); kernel32lib = (Kernel32Lib) Native.load(Kernel32Lib.path, Kernel32Lib.class);
kernel32lib.SetErrorMode(Kernel32Lib.SEM_NOGPFAULTERRORBOX); kernel32lib.SetErrorMode(Kernel32Lib.SEM_NOGPFAULTERRORBOX);
} }
catch (java.lang.UnsatisfiedLinkError e) { catch (java.lang.UnsatisfiedLinkError e) {

View File

@@ -152,8 +152,8 @@ public interface Kernel32Lib extends Library {
public char[] szExeFile = new char[WinDef.MAX_PATH]; public char[] szExeFile = new char[WinDef.MAX_PATH];
@Override @Override
protected List getFieldOrder() { protected List<String> getFieldOrder() {
return Arrays.asList(new String[] { "dwSize", "cntUsage", "th32ProcessID", "th32DefaultHeapID", "th32ModuleID", "cntThreads", "th32ParentProcessID", "pcPriClassBase", "dwFlags", "szExeFile" }); return Arrays.asList("dwSize", "cntUsage", "th32ProcessID", "th32DefaultHeapID", "th32ModuleID", "cntThreads", "th32ParentProcessID", "pcPriClassBase", "dwFlags", "szExeFile");
} }
} }

View File

@@ -49,7 +49,7 @@ public class WinProcess {
this.pid = -1; this.pid = -1;
this.kernel32lib = null; this.kernel32lib = null;
try { try {
this.kernel32lib = (Kernel32Lib) Native.loadLibrary(Kernel32Lib.path, Kernel32Lib.class); this.kernel32lib = (Kernel32Lib) Native.load(Kernel32Lib.path, Kernel32Lib.class);
} }
catch (java.lang.UnsatisfiedLinkError e) { catch (java.lang.UnsatisfiedLinkError e) {
System.out.println("WinProcess::construct " + e); System.out.println("WinProcess::construct " + e);