From df03fb974bec4f81bf4f017c1480ed2261d35e56 Mon Sep 17 00:00:00 2001 From: per Date: Sun, 30 Jan 2022 10:59:00 +0100 Subject: [PATCH] upgrade dependencies: - aetherVersion = "1.0.2.v20150114" to "1.1.0" - mavenVersion = "3.1.0" to "3.3.9" - org.apache.maven:maven-plugin-api:2.0 -> 3.3.9 - org.apache.maven:maven-model:2.0 -> 3.3.9 - org.codehaus.plexus:plexus-compiler-api:${plexusCompilerVersion} -> 2.9.0 - org.apache.maven.plugin-tools:maven-plugin-annotations:3.4' - > 3.6.4 - org.apache.maven.surefire:surefire-api:2.13 -> 2.22.2 - org.json:json:20180130 - > 20211205 - add "org.eclipse.sisu:org.eclipse.sisu.plexus:0.3.5" to get org.codehaus.plexus.logging.AbstractLogEnabled . Junit:4.11 -> 4.13.2 - org.slf4j:slf4j-api:1.6.1, 1.7.5 - 1.7.35 - org.slf4j:slf4j-jdk14:1.6.1 -> 1.7.35 - org.slf4j:slf4j-simple:1.7.5 -> 1.7.35 - org.easymock:easymock:3.1 -> 4.3 - javax.servlet:javax.servlet-api:3.0.1 -> 4.0.1 - javax.servlet:javax.servlet-api:3.0.1 -> 4.0.1 - org.jfree:jfreesvg:3.3 -> 3.4.2 - org.soot-oss:soot:4.2.1 -> 4.3.0 - org.apache.commons:commons-compress:1.18 -> 1.21 - org.tukaani:xz:1.8 -> 1.9 - com.fasterxml.jackson.core:jackson-databind:2.8.11.1 -> 2.13.1 - com.fasterxml.jackson.core:jackson-annotations:2.8.0 -> 2.13.1 - com.fasterxml.jackson.core:jackson-core:2.8.10 -> 2.13.1 - com.google.code.findbugs:jsr305:3.0.0 -> 3.0.2 Mirror .m2 dir to /home/vagrant/.m2 to enable ./gradlew publishToMavenLocal Minor code cleanup --- Vagrantfile | 3 +++ appengine/build.gradle | 6 ++--- core/build.gradle | 4 ++-- .../org/renjin/primitives/files/Files.java | 4 ++-- gradle/libraries.gradle | 8 +++---- packages/grDevices/build.gradle | 2 +- .../org/renjin/grDevices/GraphicsDevices.java | 4 ++-- tools/aether-package-loader/build.gradle | 8 +++---- .../renjin/aether/MavenSettingsDecrypter.java | 16 ++++++------- tools/gcc-bridge/compiler/build.gradle | 4 ++-- .../java/org/renjin/gcc/GimpleCompiler.java | 2 +- tools/gcc-bridge/maven-plugin/build.gradle | 6 ++--- tools/gcc-bridge/maven-plugin/pom.xml | 2 +- tools/gnur-compiler/build.gradle | 2 +- tools/maven-plugin/build.gradle | 10 ++++---- .../main/resources/META-INF/maven/plugin.xml | 14 +++++------ .../maven/test/ForkedTestControllerTest.java | 4 +++- .../renjin/packaging/test/TestReporter.java | 23 +++++++++++-------- 18 files changed, 65 insertions(+), 57 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 09bcb8678c..cb3fc2e3f6 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -13,6 +13,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.provision :shell, inline: "apt-get update && apt-get install openjdk-8-jdk maven make gcc-4.7 gcc-4.7-plugin-dev gfortran-4.7 g++-4.7 gcc-4.7.multilib g++-4.7-multilib unzip libz-dev -y" config.vm.synced_folder ".", "/home/ubuntu/renjin" + # So we can do ./gradlew publishToMavenLocal and also save some disk space + config.vm.synced_folder "~/.m2", "/home/vagrant/.m2" + config.vm.provider "virtualbox" do |v| v.memory = 4096 v.cpus = 2 diff --git a/appengine/build.gradle b/appengine/build.gradle index 63ebef2546..cde2c716aa 100644 --- a/appengine/build.gradle +++ b/appengine/build.gradle @@ -4,8 +4,8 @@ apply from: "../gradle/maven.gradle" dependencies { compile project(':script-engine') - compileOnly 'javax.servlet:javax.servlet-api:3.0.1' - testCompile 'org.easymock:easymock:3.3' - testCompile 'javax.servlet:javax.servlet-api:3.0.1' + compileOnly 'javax.servlet:javax.servlet-api:4.0.1' + testCompile 'org.easymock:easymock:4.3' + testCompile 'javax.servlet:javax.servlet-api:4.0.1' } \ No newline at end of file diff --git a/core/build.gradle b/core/build.gradle index 6c78c5d7c9..7bf183ce82 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -32,8 +32,8 @@ dependencies { compile 'org.apache.commons:commons-math:2.2' compile 'com.github.fommil.netlib:core:1.1.2' compile 'org.apache.commons:commons-vfs2:2.0' - compile 'org.apache.commons:commons-compress:1.18' - compile 'org.tukaani:xz:1.8' + compile 'org.apache.commons:commons-compress:1.21' + compile 'org.tukaani:xz:1.9' compile libraries.asm compile libraries.guava diff --git a/core/src/main/java/org/renjin/primitives/files/Files.java b/core/src/main/java/org/renjin/primitives/files/Files.java index 18e7958c42..9b0bee5cbd 100644 --- a/core/src/main/java/org/renjin/primitives/files/Files.java +++ b/core/src/main/java/org/renjin/primitives/files/Files.java @@ -378,7 +378,7 @@ public static String dirname(String path) { * @return true if the operation succeeded for each of the files attempted. * Using a missing value for a path name will always be regarded as a failure. * returns false if the directory already exists - * @throws FileSystemException + * @throws FileSystemException if FileObject.createFolder failed */ @Internal("dir.create") public static SEXP dirCreate(@Current Context context, String path, boolean showWarnings, boolean recursive, int mode) throws FileSystemException { @@ -395,7 +395,7 @@ public static SEXP dirCreate(@Current Context context, String path, boolean show * Checks if input directory exists. * @param context the current call Context - * @param paths character vectors containing file or directory paths. + * @param uri character vectors containing file or directory paths. * Tilde expansion (see ‘path.expand’) is done. * @return true if the operation succeeded for each of the directory attempted. * Using a missing value for a path name will always be regarded as a failure. diff --git a/gradle/libraries.gradle b/gradle/libraries.gradle index 031b3828d4..c9e1825399 100644 --- a/gradle/libraries.gradle +++ b/gradle/libraries.gradle @@ -14,13 +14,13 @@ ext { asm: "org.renjin:renjin-asm:5.0.4b", airline: 'io.airlift:airline:0.9', slf4j: [ - api: 'org.slf4j:slf4j-api:1.6.1', - impl: 'org.slf4j:slf4j-jdk14:1.6.1' + api: 'org.slf4j:slf4j-api:1.7.35', + impl: 'org.slf4j:slf4j-jdk14:1.7.35' ], - junit: 'junit:junit:4.13.1', + junit: 'junit:junit:4.13.2', hamcrest: 'org.hamcrest:hamcrest-library:1.3', - easymock: 'org.easymock:easymock:3.1' + easymock: 'org.easymock:easymock:4.3' ] } diff --git a/packages/grDevices/build.gradle b/packages/grDevices/build.gradle index 18ee98d944..c52c57352c 100644 --- a/packages/grDevices/build.gradle +++ b/packages/grDevices/build.gradle @@ -25,7 +25,7 @@ dependencies { compile project(':core') compile project(':tools:gnur-runtime') - compile 'org.jfree:jfreesvg:3.3' + compile 'org.jfree:jfreesvg:3.4.2' testCompile project(':packages:hamcrest') } diff --git a/packages/grDevices/java/org/renjin/grDevices/GraphicsDevices.java b/packages/grDevices/java/org/renjin/grDevices/GraphicsDevices.java index 10261fa35f..232f0e0e84 100644 --- a/packages/grDevices/java/org/renjin/grDevices/GraphicsDevices.java +++ b/packages/grDevices/java/org/renjin/grDevices/GraphicsDevices.java @@ -44,7 +44,7 @@ public static Ptr newDevice(Ptr deviceClassPtr, SEXP deviceOptions) { String deviceClassName = Stdlib.nullTerminatedString(deviceClassPtr); - Class deviceClass; + Class deviceClass; try { deviceClass = Class.forName(deviceClassName); } catch (ClassNotFoundException e) { @@ -53,7 +53,7 @@ public static Ptr newDevice(Ptr deviceClassPtr, SEXP deviceOptions) { GraphicsDevice device; try { - Constructor constructor = deviceClass.getConstructor(Session.class, ListVector.class); + Constructor constructor = deviceClass.getConstructor(Session.class, ListVector.class); Session session = Native.currentContext().getSession(); device = (GraphicsDevice) constructor.newInstance(session, deviceOptions); } catch (Exception e) { diff --git a/tools/aether-package-loader/build.gradle b/tools/aether-package-loader/build.gradle index d0d7f3b316..68e64a17e5 100644 --- a/tools/aether-package-loader/build.gradle +++ b/tools/aether-package-loader/build.gradle @@ -1,7 +1,6 @@ -def aetherVersion = "1.0.2.v20150114" -def mavenVersion = "3.1.0" -def wagonVersion = "1.0" +def aetherVersion = "1.1.0" +def mavenVersion = "3.3.9" dependencies { compile project(":core") @@ -14,5 +13,6 @@ dependencies { compile "org.eclipse.aether:aether-transport-http:${aetherVersion}" compile "org.apache.maven:maven-aether-provider:${mavenVersion}" compile "org.apache.maven:maven-settings-builder:${mavenVersion}" - compile "org.json:json:20180130" + compile "org.eclipse.sisu:org.eclipse.sisu.plexus:0.3.5" + compile "org.json:json:20211205" } \ No newline at end of file diff --git a/tools/aether-package-loader/src/main/java/org/renjin/aether/MavenSettingsDecrypter.java b/tools/aether-package-loader/src/main/java/org/renjin/aether/MavenSettingsDecrypter.java index 30342a74e0..e2cc447f60 100644 --- a/tools/aether-package-loader/src/main/java/org/renjin/aether/MavenSettingsDecrypter.java +++ b/tools/aether-package-loader/src/main/java/org/renjin/aether/MavenSettingsDecrypter.java @@ -35,14 +35,12 @@ public class MavenSettingsDecrypter implements SettingsDecrypter { // Copied from Maven as there was no constructor to set the security Dispatcher - - private SecDispatcher securityDispatcher = new MavenSecDispatcher(); - + private final SecDispatcher securityDispatcher = new MavenSecDispatcher(); public SettingsDecryptionResult decrypt(SettingsDecryptionRequest request) { - List problems = new ArrayList(); + List problems = new ArrayList<>(); - List servers = new ArrayList(); + List servers = new ArrayList<>(); for (Server server : request.getServers()) { server = server.clone(); @@ -64,7 +62,7 @@ public SettingsDecryptionResult decrypt(SettingsDecryptionRequest request) { } } - List proxies = new ArrayList(); + List proxies = new ArrayList<>(); for (Proxy proxy : request.getProxies()) { proxy = proxy.clone(); @@ -97,9 +95,9 @@ class DefaultSettingsDecryptionResult private List problems; public DefaultSettingsDecryptionResult(List servers, List proxies, List problems) { - this.servers = (servers != null) ? servers : new ArrayList(); - this.proxies = (proxies != null) ? proxies : new ArrayList(); - this.problems = (problems != null) ? problems : new ArrayList(); + this.servers = (servers != null) ? servers : new ArrayList<>(); + this.proxies = (proxies != null) ? proxies : new ArrayList<>(); + this.problems = (problems != null) ? problems : new ArrayList<>(); } public Server getServer() { diff --git a/tools/gcc-bridge/compiler/build.gradle b/tools/gcc-bridge/compiler/build.gradle index 9162230dee..c88fc647bb 100644 --- a/tools/gcc-bridge/compiler/build.gradle +++ b/tools/gcc-bridge/compiler/build.gradle @@ -4,8 +4,8 @@ dependencies { compile project(':tools:gcc-bridge:runtime') compile libraries.guava compile libraries.asm - compile 'com.fasterxml.jackson.core:jackson-databind:2.8.11.1' - compile('org.soot-oss:soot:4.2.1') { + compile 'com.fasterxml.jackson.core:jackson-databind:2.13.1' + compile('org.soot-oss:soot:4.3.0') { exclude group: 'org.smali', module: 'dexlib2' } implementation libraries.airline diff --git a/tools/gcc-bridge/compiler/src/main/java/org/renjin/gcc/GimpleCompiler.java b/tools/gcc-bridge/compiler/src/main/java/org/renjin/gcc/GimpleCompiler.java index 02f84095a0..d9d2372e3f 100644 --- a/tools/gcc-bridge/compiler/src/main/java/org/renjin/gcc/GimpleCompiler.java +++ b/tools/gcc-bridge/compiler/src/main/java/org/renjin/gcc/GimpleCompiler.java @@ -619,7 +619,7 @@ private String findClasspath() { paths.add(url.toString()); } } - return paths.stream().collect(Collectors.joining(":")); + return String.join(":", paths); } diff --git a/tools/gcc-bridge/maven-plugin/build.gradle b/tools/gcc-bridge/maven-plugin/build.gradle index 846d6340c0..250559ce5d 100644 --- a/tools/gcc-bridge/maven-plugin/build.gradle +++ b/tools/gcc-bridge/maven-plugin/build.gradle @@ -1,10 +1,10 @@ dependencies { - compile 'org.apache.maven:maven-plugin-api:2.0' + compile 'org.apache.maven:maven-plugin-api:3.3.9' compile 'org.apache.maven:maven-project:2.2.1' - compileOnly 'org.apache.maven.plugin-tools:maven-plugin-annotations:3.4' - compile 'org.codehaus.plexus:plexus-compiler-api:${plexusCompilerVersion}' + compileOnly 'org.apache.maven.plugin-tools:maven-plugin-annotations:3.6.4' + compile 'org.codehaus.plexus:plexus-compiler-api:2.9.0' compile 'org.renjin:gcc-bridge-compiler:${project.version}' testCompile libraries.junit } \ No newline at end of file diff --git a/tools/gcc-bridge/maven-plugin/pom.xml b/tools/gcc-bridge/maven-plugin/pom.xml index 62e2d8bb15..b5a25c18ea 100644 --- a/tools/gcc-bridge/maven-plugin/pom.xml +++ b/tools/gcc-bridge/maven-plugin/pom.xml @@ -67,7 +67,7 @@ junit junit - 4.11 + 4.13.2 test diff --git a/tools/gnur-compiler/build.gradle b/tools/gnur-compiler/build.gradle index 6cd52915a3..a785bb6ad6 100644 --- a/tools/gnur-compiler/build.gradle +++ b/tools/gnur-compiler/build.gradle @@ -21,7 +21,7 @@ dependencies { compile libraries.guava - compile 'com.google.code.findbugs:jsr305:3.0.0' + compile 'com.google.code.findbugs:jsr305:3.0.2' compile project(':tools:gnur-runtime') compile project(':tools:gcc-bridge:gcc-bridge-compiler') compile libraries.airline diff --git a/tools/maven-plugin/build.gradle b/tools/maven-plugin/build.gradle index b7fe3b8cec..d04d6795cd 100644 --- a/tools/maven-plugin/build.gradle +++ b/tools/maven-plugin/build.gradle @@ -8,12 +8,12 @@ dependencies { compile project(':tools:gnur-compiler') compile project(':tools:packager') - compile 'org.apache.maven:maven-plugin-api:2.0' - compile 'org.apache.maven:maven-model:2.0' + compile 'org.apache.maven:maven-plugin-api:3.3.9' + compile 'org.apache.maven:maven-model:3.3.9' compile 'org.apache.maven:maven-project:2.2.1' - compile 'org.apache.maven.surefire:surefire-api:2.13' - compile 'org.apache.maven:maven-core:3.0.4' - compileOnly 'org.apache.maven.plugin-tools:maven-plugin-annotations:3.4' + compile 'org.apache.maven.surefire:surefire-api:2.22.2' + compile 'org.apache.maven:maven-core:3.3.9' + compile 'org.apache.maven.plugin-tools:maven-plugin-annotations:3.6.4' testCompile libraries.junit } diff --git a/tools/maven-plugin/src/main/resources/META-INF/maven/plugin.xml b/tools/maven-plugin/src/main/resources/META-INF/maven/plugin.xml index 1d1bf77e34..b2ec65c122 100644 --- a/tools/maven-plugin/src/main/resources/META-INF/maven/plugin.xml +++ b/tools/maven-plugin/src/main/resources/META-INF/maven/plugin.xml @@ -426,13 +426,13 @@ org.apache.commons commons-compress jar - 1.18 + 1.21 org.tukaani xz jar - 1.8 + 1.9 org.renjin @@ -486,19 +486,19 @@ com.fasterxml.jackson.core jackson-databind jar - 2.8.11.1 + 2.13.1 com.fasterxml.jackson.core jackson-annotations jar - 2.8.0 + 2.13.1 com.fasterxml.jackson.core jackson-core jar - 2.8.10 + 2.13.1 io.airlift @@ -570,13 +570,13 @@ org.slf4j slf4j-api jar - 1.7.5 + 1.7.35 org.slf4j slf4j-simple jar - 1.7.5 + 1.7.35 org.renjin diff --git a/tools/maven-plugin/src/test/java/org/renjin/maven/test/ForkedTestControllerTest.java b/tools/maven-plugin/src/test/java/org/renjin/maven/test/ForkedTestControllerTest.java index d748301670..d50848eddd 100644 --- a/tools/maven-plugin/src/test/java/org/renjin/maven/test/ForkedTestControllerTest.java +++ b/tools/maven-plugin/src/test/java/org/renjin/maven/test/ForkedTestControllerTest.java @@ -149,7 +149,9 @@ private String getCurrentClassPath() { private File testFile(String name) { URL resource = Resources.getResource(name); - return new File(resource.getFile()); + File file = new File(resource.getFile()); + assertTrue(name + " does not exist", file.exists()); + return file; } public void assertTestCaseSucceeded(File file, boolean expectSuccess) { diff --git a/tools/packager/src/main/java/org/renjin/packaging/test/TestReporter.java b/tools/packager/src/main/java/org/renjin/packaging/test/TestReporter.java index 28c34a1107..1863685608 100644 --- a/tools/packager/src/main/java/org/renjin/packaging/test/TestReporter.java +++ b/tools/packager/src/main/java/org/renjin/packaging/test/TestReporter.java @@ -82,13 +82,13 @@ public void fileComplete() { private void printResultsBanner(PrintStream out) { - out.println(format("Tests run: %d, Failures: %d, Errors: %d, Skipped: %d, Time elapsed: %.3f %s", + out.printf("Tests run: %d, Failures: %d, Errors: %d, Skipped: %d, Time elapsed: %.3f %s%n", currentSuite.getResults().size(), currentSuite.countOutcomes(TestOutcome.FAILURE), currentSuite.countOutcomes(TestOutcome.ERROR), currentSuite.countOutcomes(TestOutcome.SKIPPED), currentSuite.getTime(), - currentSuite.hasFailures() ? " << FAILURE!" : "")); + currentSuite.hasFailures() ? " << FAILURE!" : ""); } public void testCaseStarting(String name) { @@ -105,14 +105,19 @@ public void testCaseStarting(String name) { public void timeout(long timeoutLengthMs) { + if (currentCase == null) { + System.err.println("currentCase is null, testCaseStarting was not called before timeout"); + testCaseStarting("unknown"); + } + currentCase.setOutcome(TestOutcome.ERROR); currentCase.setErrorMessage("Timed out after " + timeoutLengthMs + " ms"); if (currentCase.isRootScript()) { - System.err.println(format("Evaluation of %s timed out", currentSuite.getScriptFile().getName())); + System.err.printf("Evaluation of %s timed out%n", currentSuite.getScriptFile().getName()); } else { - System.err.println(format("%s() in %s timed out", + System.err.printf("%s() in %s timed out%n", currentCase.getName(), - currentSuite.getScriptFile().getName())); + currentSuite.getScriptFile().getName()); } functionComplete(); } @@ -130,12 +135,12 @@ public void testCaseFailed(String message) { currentCase.setErrorMessage(message); currentCase.setOutcome(TestOutcome.ERROR); if(currentCase.isRootScript()) { - System.err.println(format("Evaluation of %s failed", - currentSuite.getScriptFile().getName())); + System.err.printf("Evaluation of %s failed%n", + currentSuite.getScriptFile().getName()); } else { - System.err.println(format("%s() in %s failed", + System.err.printf("%s() in %s failed%n", currentCase.getName(), - currentSuite.getScriptFile().getName())); + currentSuite.getScriptFile().getName()); } functionComplete(); }