Skip to content

Commit

Permalink
groovy-eclipse-compiler 3.9.0 and groovy-eclipse-batch 3.0.17-03
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed May 13, 2023
1 parent 063eb38 commit a0c93fe
Show file tree
Hide file tree
Showing 13 changed files with 84 additions and 74 deletions.
2 changes: 1 addition & 1 deletion extras/groovy-eclipse-batch-builder/build.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# version numbers
version3.0=3.0.17-02
version3.0=3.0.17-03
version4.0=4.0.12-02

# uncomment to do a particular build -- only one should be uncommented at a time
Expand Down
2 changes: 1 addition & 1 deletion extras/groovy-eclipse-compiler-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<groovy.xx.version>4.0.12-02</groovy.xx.version>
<!-- maven-compiler versions to use for tests: -->
<maven-compiler-plugin.version>3.6.2</maven-compiler-plugin.version>
<maven-compiler-adapter.version>3.8.0</maven-compiler-adapter.version>
<maven-compiler-adapter.version>3.9.0</maven-compiler-adapter.version>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
Expand Down
6 changes: 3 additions & 3 deletions extras/groovy-eclipse-compiler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>3.8.0-SNAPSHOT</version>
<version>3.9.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>

<name>Groovy-Eclipse Compiler Plugin</name>
Expand Down Expand Up @@ -97,7 +97,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.1.0</version>
<version>3.3.0</version>
<executions>
<execution>
<id>enforce-versions</id>
Expand All @@ -121,7 +121,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.1</version>
<version>3.5.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2009-2022 the original author or authors.
* Copyright 2009-2023 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2009-2022 the original author or authors.
* Copyright 2009-2023 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.
Expand Down Expand Up @@ -36,6 +36,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.StringJoiner;
import java.util.TreeSet;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
Expand Down Expand Up @@ -264,6 +265,8 @@ public String put(String k, String v) {
} else {
args.put("-g", null);
}
} else if (config.isOptimize()) {
args.put("-O", null);
}

if (isNotBlank(config.getSourceEncoding())) {
Expand All @@ -273,6 +276,12 @@ public String put(String k, String v) {
String release = config.getReleaseVersion();
if (isNotBlank(release)) {
args.put("--release", release.trim());
if (!config.isFork()) { // check tycho useJDK
String javaHome = config.getCustomCompilerArgumentsAsMap().get("use.java.home");
if (isNotBlank(javaHome)) {
args.put("--system", javaHome.trim());
}
}
} else {
String source = config.getSourceVersion();
if (isNotBlank(source)) {
Expand All @@ -287,6 +296,7 @@ public String put(String k, String v) {

if (config.isShowDeprecation()) {
args.put("-deprecation", null);
config.setShowWarnings(true);
}
if (config.isFailOnWarning()) {
args.put("-failOnWarning", null);
Expand All @@ -305,38 +315,34 @@ public String put(String k, String v) {
}

if (config.getAnnotationProcessors() != null) {
StringBuilder processor = new StringBuilder();
StringJoiner processor = new StringJoiner(",");
for (String item : config.getAnnotationProcessors()) {
if (isNotBlank(item)) {
processor.append(item.trim()).append(',');
processor.add(item.trim());
}
}
if (processor.length() > 0) {
// remove the trailing comma
processor.setLength(processor.length() - 1);
args.put("-processor", processor.toString());
}
}

if (config.getProcessorPathEntries() != null) {
StringBuilder processorpath = new StringBuilder();
StringJoiner processorpath = new StringJoiner(";");
for (String item : config.getProcessorPathEntries()) {
if (isNotBlank(item)) {
processorpath.append(item.trim()).append(';');
processorpath.add(item.trim());
}
}
if (processorpath.length() > 0) {
// remove the trailing semicolon
processorpath.setLength(processorpath.length() - 1);
args.put("-processorpath", processorpath.toString());
}
}

String prev = null;
for (Map.Entry<String, String> entry : config.getCustomCompilerArgumentsAsMap().entrySet()) {
for (Map.Entry<String, String> entry : config.getCustomCompilerArgumentsEntries()) {
String key = entry.getKey();
if (key.startsWith("-")) {
if ("-javaAgentClass".equals(key)) {
if (key.equals("-javaAgentClass")) {
setJavaAgentClass(entry.getValue());
} else if (!key.startsWith("-J")) {
args.put(key, entry.getValue());
Expand All @@ -347,7 +353,7 @@ public String put(String k, String v) {
} else {
if (prev != null && entry.getValue() == null) {
args.put(prev, key);
} else if (!"org.osgi.framework.system.packages".equals(key)) { // GRECLIPSE-1418: ignore the system packages option
} else if (!key.startsWith("@") && !key.equals("use.java.home") && !key.equals("org.osgi.framework.system.packages")) { // GRECLIPSE-1418: ignore system packages
args.put("-" + key, entry.getValue());
}
prev = null;
Expand Down Expand Up @@ -593,14 +599,18 @@ private String getJavaExecutable(final CompilerConfiguration config) {
return executable;
}

Toolchain jdkToolchain = toolchainManager.getToolchainFromBuildContext("jdk", session);
if (jdkToolchain != null) executable = jdkToolchain.findTool("java");
if (isNotBlank(executable)) {
return executable;
String javaHome = config.getCustomCompilerArgumentsAsMap().get("use.java.home");
if (isBlank(javaHome)) {
javaHome = System.getProperty("java.home"); // fallback to current java home

Toolchain jdkToolchain = toolchainManager.getToolchainFromBuildContext("jdk", session);
if (jdkToolchain != null) executable = jdkToolchain.findTool("java");
if (isNotBlank(executable)) {
return executable;
}
}

String javaCommand = "java" + (Os.isFamily(Os.FAMILY_WINDOWS) ? ".exe" : "");
String javaHome = System.getProperty("java.home");
File javaPath;
if (Os.isName("AIX")) {
javaPath = new File(javaHome + File.separator + ".." + File.separator + "sh", javaCommand);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2009-2022 the original author or authors.
* Copyright 2009-2023 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,28 @@
org.codehaus.groovy:groovy-eclipse-compiler:add-groovy-build-paths
</initialize>
<process-resources>
org.apache.maven.plugins:maven-resources-plugin:2.6:resources
org.apache.maven.plugins:maven-resources-plugin:3.3.1:resources
</process-resources>
<compile>
org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile
org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile
</compile>
<process-test-resources>
org.apache.maven.plugins:maven-resources-plugin:2.6:testResources
org.apache.maven.plugins:maven-resources-plugin:3.3.1:testResources
</process-test-resources>
<test-compile>
org.apache.maven.plugins:maven-compiler-plugin:3.6.2:testCompile
org.apache.maven.plugins:maven-compiler-plugin:3.11.0:testCompile
</test-compile>
<test>
org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
org.apache.maven.plugins:maven-surefire-plugin:3.1.0:test
</test>
<package>
org.apache.maven.plugins:maven-jar-plugin:2.4:jar
org.apache.maven.plugins:maven-jar-plugin:3.3.0:jar
</package>
<install>
org.apache.maven.plugins:maven-install-plugin:2.4:install
org.apache.maven.plugins:maven-install-plugin:3.1.1:install
</install>
<deploy>
org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy
org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy
</deploy>
</phases>
</lifecycle>
Expand All @@ -62,28 +62,28 @@
org.codehaus.groovy:groovy-eclipse-compiler:add-groovy-build-paths
</initialize>
<process-resources>
org.apache.maven.plugins:maven-resources-plugin:2.6:resources
org.apache.maven.plugins:maven-resources-plugin:3.3.1:resources
</process-resources>
<compile>
org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile
org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile
</compile>
<process-test-resources>
org.apache.maven.plugins:maven-resources-plugin:2.6:testResources
org.apache.maven.plugins:maven-resources-plugin:3.3.1:testResources
</process-test-resources>
<test-compile>
org.apache.maven.plugins:maven-compiler-plugin:3.6.2:testCompile
org.apache.maven.plugins:maven-compiler-plugin:3.11.0:testCompile
</test-compile>
<test>
org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
org.apache.maven.plugins:maven-surefire-plugin:3.1.0:test
</test>
<package>
org.apache.maven.plugins:maven-war-plugin:2.2:war
org.apache.maven.plugins:maven-war-plugin:3.3.2:war
</package>
<install>
org.apache.maven.plugins:maven-install-plugin:2.4:install
org.apache.maven.plugins:maven-install-plugin:3.1.1:install
</install>
<deploy>
org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy
org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy
</deploy>
</phases>
</lifecycle>
Expand All @@ -103,28 +103,28 @@
org.codehaus.groovy:groovy-eclipse-compiler:add-groovy-build-paths
</initialize>
<process-resources>
org.apache.maven.plugins:maven-resources-plugin:2.6:resources
org.apache.maven.plugins:maven-resources-plugin:3.3.1:resources
</process-resources>
<compile>
org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile
org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile
</compile>
<process-test-resources>
org.apache.maven.plugins:maven-resources-plugin:2.6:testResources
org.apache.maven.plugins:maven-resources-plugin:3.3.1:testResources
</process-test-resources>
<test-compile>
org.apache.maven.plugins:maven-compiler-plugin:3.6.2:testCompile
org.apache.maven.plugins:maven-compiler-plugin:3.11.0:testCompile
</test-compile>
<test>
org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
org.apache.maven.plugins:maven-surefire-plugin:3.1.0:test
</test>
<package>
org.apache.maven.plugins:maven-rar-plugin:2.2:rar
org.apache.maven.plugins:maven-rar-plugin:3.0.0:rar
</package>
<install>
org.apache.maven.plugins:maven-install-plugin:2.4:install
org.apache.maven.plugins:maven-install-plugin:3.1.1:install
</install>
<deploy>
org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy
org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy
</deploy>
</phases>
</lifecycle>
Expand All @@ -144,28 +144,28 @@
org.codehaus.groovy:groovy-eclipse-compiler:add-groovy-build-paths
</initialize>
<process-resources>
org.apache.maven.plugins:maven-resources-plugin:2.6:resources
org.apache.maven.plugins:maven-resources-plugin:3.3.1:resources
</process-resources>
<compile>
org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile
org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile
</compile>
<process-test-resources>
org.apache.maven.plugins:maven-resources-plugin:2.6:testResources
org.apache.maven.plugins:maven-resources-plugin:3.3.1:testResources
</process-test-resources>
<test-compile>
org.apache.maven.plugins:maven-compiler-plugin:3.6.2:testCompile
org.apache.maven.plugins:maven-compiler-plugin:3.11.0:testCompile
</test-compile>
<test>
org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
org.apache.maven.plugins:maven-surefire-plugin:3.1.0:test
</test>
<package>
org.apache.maven.plugins:maven-ejb-plugin:2.3:ejb
org.apache.maven.plugins:maven-ejb-plugin:3.2.1:ejb
</package>
<install>
org.apache.maven.plugins:maven-install-plugin:2.4:install
org.apache.maven.plugins:maven-install-plugin:3.1.1:install
</install>
<deploy>
org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy
org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy
</deploy>
</phases>
</lifecycle>
Expand All @@ -185,32 +185,32 @@
org.codehaus.groovy:groovy-eclipse-compiler:add-groovy-build-paths
</initialize>
<process-resources>
org.apache.maven.plugins:maven-resources-plugin:2.6:resources
org.apache.maven.plugins:maven-resources-plugin:3.3.1:resources
</process-resources>
<compile>
org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile
org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile
</compile>
<process-classes>
org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor
</process-classes>
<process-test-resources>
org.apache.maven.plugins:maven-resources-plugin:2.6:testResources
org.apache.maven.plugins:maven-resources-plugin:3.3.1:testResources
</process-test-resources>
<test-compile>
org.apache.maven.plugins:maven-compiler-plugin:3.6.2:testCompile
org.apache.maven.plugins:maven-compiler-plugin:3.11.0:testCompile
</test-compile>
<test>
org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
org.apache.maven.plugins:maven-surefire-plugin:3.1.0:test
</test>
<package>
org.apache.maven.plugins:maven-jar-plugin:2.4:jar,
org.apache.maven.plugins:maven-plugin-plugin:3.2:addPluginArtifactMetadata
org.apache.maven.plugins:maven-jar-plugin:3.3.0:jar,
org.apache.maven.plugins:maven-plugin-plugin:3.8.2:addPluginArtifactMetadata
</package>
<install>
org.apache.maven.plugins:maven-install-plugin:2.4:install
org.apache.maven.plugins:maven-install-plugin:3.1.1:install
</install>
<deploy>
org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy
org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy
</deploy>
</phases>
</lifecycle>
Expand Down
4 changes: 2 additions & 2 deletions extras/groovy-eclipse-maven-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>3.8.0</version>
<version>3.9.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>3.0.17-01</version>
<version>3.0.17-03</version>
</dependency>
</dependencies>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>3.8.0</version>
<version>3.9.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>3.0.17-02</version>
<version>3.0.17-03</version>
</dependency>
</dependencies>
</plugin>
Expand Down
Loading

0 comments on commit a0c93fe

Please sign in to comment.