Refactor: gradle update
This commit is contained in:
committed by
Sheepit Renderfarm
parent
3f4a45c2c4
commit
624b3d2234
32
build.gradle
32
build.gradle
@@ -1,13 +1,7 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
plugins {
|
||||
id 'java-library'
|
||||
id 'com.github.johnrengelman.shadow' version '7.0.0'
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.4'
|
||||
}
|
||||
}
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'com.github.johnrengelman.shadow'
|
||||
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
@@ -24,22 +18,22 @@ shadowJar {
|
||||
}
|
||||
|
||||
repositories {
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly 'org.projectlombok:lombok:1.18.12'
|
||||
annotationProcessor 'org.projectlombok:lombok:1.18.12'
|
||||
compileOnly 'org.projectlombok:lombok:1.18.20'
|
||||
annotationProcessor 'org.projectlombok:lombok:1.18.20'
|
||||
|
||||
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'
|
||||
compile 'javax.xml.bind:jaxb-api:2.3.1'
|
||||
implementation 'com.formdev:flatlaf:0.30'
|
||||
implementation 'args4j:args4j:2.33'
|
||||
implementation group: 'net.lingala.zip4j', name: 'zip4j', version: '2.7.0'
|
||||
implementation 'net.java.dev.jna:jna-platform:5.0.0' // couldnt upgrade
|
||||
implementation 'org.simpleframework:simple-xml:2.7.1'
|
||||
implementation 'javax.xml.bind:jaxb-api:2.3.1'
|
||||
implementation 'com.formdev:flatlaf:1.1.2'
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.7.2'
|
||||
implementation 'com.squareup.okhttp3:okhttp-urlconnection:4.7.2'
|
||||
// implementation "com.squareup.okhttp3:okhttp:4.9.0" //missing JavaNetCookieJar
|
||||
}
|
||||
|
||||
jar {
|
||||
@@ -48,7 +42,7 @@ jar {
|
||||
}
|
||||
|
||||
from {
|
||||
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
|
||||
configurations.implementation.collect { it.isDirectory() ? it : zipTree(it) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
5
gradle/wrapper/gradle-wrapper.properties
vendored
5
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,5 @@
|
||||
#Fri Apr 10 00:43:49 CST 2020
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
2
gradlew
vendored
2
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
|
||||
|
||||
22
gradlew.bat
vendored
22
gradlew.bat
vendored
@@ -40,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.
|
||||
@@ -54,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%
|
||||
@@ -64,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
|
||||
|
||||
@@ -19,6 +19,14 @@
|
||||
|
||||
package com.sheepit.client;
|
||||
|
||||
import com.sheepit.client.Configuration.ComputeType;
|
||||
import com.sheepit.client.Error.Type;
|
||||
import com.sheepit.client.hardware.cpu.CPU;
|
||||
import com.sheepit.client.hardware.gpu.opencl.OpenCL;
|
||||
import com.sheepit.client.os.OS;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
@@ -40,16 +48,8 @@ import java.util.Observer;
|
||||
import java.util.TimeZone;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
import com.sheepit.client.Configuration.ComputeType;
|
||||
import com.sheepit.client.Error.Type;
|
||||
import com.sheepit.client.hardware.cpu.CPU;
|
||||
import com.sheepit.client.hardware.gpu.opencl.OpenCL;
|
||||
import com.sheepit.client.os.OS;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@Data public class Job {
|
||||
public static final String UPDATE_METHOD_BY_REMAINING_TIME = "remainingtime";
|
||||
@@ -70,7 +70,7 @@ import lombok.Getter;
|
||||
private String script;
|
||||
private boolean useGPU;
|
||||
private String name;
|
||||
private String password;
|
||||
private char[] password;
|
||||
private String extras;
|
||||
private String updateRenderingStatusMethod;
|
||||
private String blenderShortVersion;
|
||||
@@ -85,7 +85,7 @@ import lombok.Getter;
|
||||
private Log log;
|
||||
|
||||
public Job(Configuration config_, Gui gui_, Log log_, String id_, String frame_, String path_, boolean use_gpu, String command_, String validationUrl_,
|
||||
String script_, String sceneMd5_, String rendererMd5_, String name_, String password_, String extras_, boolean synchronous_upload_,
|
||||
String script_, String sceneMd5_, String rendererMd5_, String name_, char[] password_, String extras_, boolean synchronous_upload_,
|
||||
String update_method_) {
|
||||
configuration = config_;
|
||||
id = id_;
|
||||
@@ -208,16 +208,16 @@ import lombok.Getter;
|
||||
|
||||
core_script += ignore_signal_script;
|
||||
File script_file = null;
|
||||
String command1[] = getRendererCommand().split(" ");
|
||||
String[] command1 = getRendererCommand().split(" ");
|
||||
int size_command = command1.length + 2; // + 2 for script
|
||||
|
||||
if (configuration.getNbCores() > 0) { // user has specified something
|
||||
size_command += 2;
|
||||
}
|
||||
|
||||
List<String> command = new ArrayList<String>(size_command);
|
||||
List<String> command = new ArrayList<>(size_command);
|
||||
|
||||
Map<String, String> new_env = new HashMap<String, String>();
|
||||
Map<String, String> new_env = new HashMap<>();
|
||||
|
||||
new_env.put("BLENDER_USER_CONFIG", configuration.getWorkingDirectory().getAbsolutePath().replace("\\", "\\\\"));
|
||||
new_env.put("TEMP", configuration.getWorkingDirectory().getAbsolutePath().replace("\\", "\\\\"));
|
||||
@@ -366,7 +366,7 @@ import lombok.Getter;
|
||||
return error;
|
||||
}
|
||||
|
||||
if (event.isStarted() == false && (process.getMemoryUsed() > 0 || process.getRemainingDuration() > 0)) {
|
||||
if (!event.isStarted() && (process.getMemoryUsed() > 0 || process.getRemainingDuration() > 0)) {
|
||||
event.doNotifyIsStarted();
|
||||
}
|
||||
}
|
||||
@@ -581,7 +581,7 @@ import lombok.Getter;
|
||||
String[] elements = line.toLowerCase().split("(peak)");
|
||||
|
||||
for (String element : elements) {
|
||||
if (element.isEmpty() == false && element.charAt(0) == ' ') {
|
||||
if (!element.isEmpty() && element.charAt(0) == ' ') {
|
||||
int end = element.indexOf(')');
|
||||
if (end > 0) {
|
||||
try {
|
||||
@@ -596,7 +596,7 @@ import lombok.Getter;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (element.isEmpty() == false && element.charAt(0) == ':') {
|
||||
if (!element.isEmpty() && element.charAt(0) == ':') {
|
||||
int end = element.indexOf('|');
|
||||
if (end > 0) {
|
||||
try {
|
||||
|
||||
@@ -19,6 +19,15 @@
|
||||
|
||||
package com.sheepit.client;
|
||||
|
||||
import com.sheepit.client.Error.ServerCode;
|
||||
import com.sheepit.client.exception.FermeExceptionNoSpaceLeftOnDevice;
|
||||
import net.lingala.zip4j.ZipFile;
|
||||
import net.lingala.zip4j.exception.ZipException;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@@ -38,31 +47,18 @@ import java.util.TimeZone;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
|
||||
import net.lingala.zip4j.model.UnzipParameters;
|
||||
import net.lingala.zip4j.core.ZipFile;
|
||||
import net.lingala.zip4j.exception.ZipException;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import com.sheepit.client.Error.ServerCode;
|
||||
import com.sheepit.client.exception.FermeExceptionNoSpaceLeftOnDevice;
|
||||
|
||||
public class Utils {
|
||||
public static int unzipFileIntoDirectory(String zipFileName_, String destinationDirectory, String password, Log log)
|
||||
public static int unzipFileIntoDirectory(String zipFileName_, String destinationDirectory, char[] password, Log log)
|
||||
throws FermeExceptionNoSpaceLeftOnDevice {
|
||||
try {
|
||||
ZipFile zipFile = new ZipFile(zipFileName_);
|
||||
UnzipParameters unzipParameters = new UnzipParameters();
|
||||
unzipParameters.setIgnoreDateTimeAttributes(true);
|
||||
// unzipParameters.setIgnoreDateTimeAttributes(true);
|
||||
|
||||
if (password != null && zipFile.isEncrypted()) {
|
||||
zipFile.setPassword(password);
|
||||
}
|
||||
zipFile.extractAll(destinationDirectory, unzipParameters);
|
||||
// zipFile.extractAll(destinationDirectory, unzipParameters);
|
||||
zipFile.extractAll(destinationDirectory);
|
||||
}
|
||||
catch (ZipException e) {
|
||||
StringWriter sw = new StringWriter();
|
||||
@@ -135,7 +131,7 @@ public class Utils {
|
||||
return;
|
||||
}
|
||||
if (file.isDirectory()) {
|
||||
String files[] = file.list();
|
||||
String[] files = file.list();
|
||||
if (files != null) {
|
||||
if (files.length != 0) {
|
||||
for (String temp : files) {
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.simpleframework.xml.Root;
|
||||
|
||||
@Attribute(name = "name") @Getter private String name;
|
||||
|
||||
@Attribute(name = "password") @Getter private String password;
|
||||
@Attribute(name = "password") @Getter private char[] password;
|
||||
|
||||
@Element(name = "renderer") @Getter private RendererInfos rendererInfos;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user