diff --git a/extras/groovy-eclipse-batch-builder/build.properties b/extras/groovy-eclipse-batch-builder/build.properties index 47c9512b0d..d84b558883 100644 --- a/extras/groovy-eclipse-batch-builder/build.properties +++ b/extras/groovy-eclipse-batch-builder/build.properties @@ -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 diff --git a/extras/groovy-eclipse-compiler-tests/pom.xml b/extras/groovy-eclipse-compiler-tests/pom.xml index 174d22bff5..bfc69b111f 100644 --- a/extras/groovy-eclipse-compiler-tests/pom.xml +++ b/extras/groovy-eclipse-compiler-tests/pom.xml @@ -14,7 +14,7 @@ 4.0.12-02 3.6.2 - 3.8.0 + 3.9.0 UTF-8 diff --git a/extras/groovy-eclipse-compiler/pom.xml b/extras/groovy-eclipse-compiler/pom.xml index 591703ea61..04ab427ef8 100644 --- a/extras/groovy-eclipse-compiler/pom.xml +++ b/extras/groovy-eclipse-compiler/pom.xml @@ -3,7 +3,7 @@ org.codehaus.groovy groovy-eclipse-compiler - 3.8.0-SNAPSHOT + 3.9.0-SNAPSHOT maven-plugin Groovy-Eclipse Compiler Plugin @@ -97,7 +97,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.1.0 + 3.3.0 enforce-versions @@ -121,7 +121,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.1 + 3.5.0 attach-javadocs diff --git a/extras/groovy-eclipse-compiler/src/main/java/org/codehaus/groovy/eclipse/compiler/AddGroovySourceFolders.java b/extras/groovy-eclipse-compiler/src/main/java/org/codehaus/groovy/eclipse/compiler/AddGroovySourceFolders.java index f0c970b1eb..49268ba790 100644 --- a/extras/groovy-eclipse-compiler/src/main/java/org/codehaus/groovy/eclipse/compiler/AddGroovySourceFolders.java +++ b/extras/groovy-eclipse-compiler/src/main/java/org/codehaus/groovy/eclipse/compiler/AddGroovySourceFolders.java @@ -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. diff --git a/extras/groovy-eclipse-compiler/src/main/java/org/codehaus/groovy/eclipse/compiler/GroovyEclipseCompiler.java b/extras/groovy-eclipse-compiler/src/main/java/org/codehaus/groovy/eclipse/compiler/GroovyEclipseCompiler.java index bb025d2bdb..483c1f93da 100644 --- a/extras/groovy-eclipse-compiler/src/main/java/org/codehaus/groovy/eclipse/compiler/GroovyEclipseCompiler.java +++ b/extras/groovy-eclipse-compiler/src/main/java/org/codehaus/groovy/eclipse/compiler/GroovyEclipseCompiler.java @@ -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. @@ -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; @@ -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())) { @@ -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)) { @@ -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); @@ -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 entry : config.getCustomCompilerArgumentsAsMap().entrySet()) { + for (Map.Entry 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()); @@ -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; @@ -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); diff --git a/extras/groovy-eclipse-compiler/src/main/java/org/codehaus/groovy/eclipse/compiler/InternalCompiler.java b/extras/groovy-eclipse-compiler/src/main/java/org/codehaus/groovy/eclipse/compiler/InternalCompiler.java index 314e999559..e2af1e7fa1 100644 --- a/extras/groovy-eclipse-compiler/src/main/java/org/codehaus/groovy/eclipse/compiler/InternalCompiler.java +++ b/extras/groovy-eclipse-compiler/src/main/java/org/codehaus/groovy/eclipse/compiler/InternalCompiler.java @@ -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. diff --git a/extras/groovy-eclipse-compiler/src/main/resources/META-INF/plexus/components.xml b/extras/groovy-eclipse-compiler/src/main/resources/META-INF/plexus/components.xml index 8336738b5e..7c07df2cf3 100644 --- a/extras/groovy-eclipse-compiler/src/main/resources/META-INF/plexus/components.xml +++ b/extras/groovy-eclipse-compiler/src/main/resources/META-INF/plexus/components.xml @@ -21,28 +21,28 @@ org.codehaus.groovy:groovy-eclipse-compiler:add-groovy-build-paths - org.apache.maven.plugins:maven-resources-plugin:2.6:resources + org.apache.maven.plugins:maven-resources-plugin:3.3.1:resources - org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile + org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile - org.apache.maven.plugins:maven-resources-plugin:2.6:testResources + org.apache.maven.plugins:maven-resources-plugin:3.3.1:testResources - org.apache.maven.plugins:maven-compiler-plugin:3.6.2:testCompile + org.apache.maven.plugins:maven-compiler-plugin:3.11.0:testCompile - org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test + org.apache.maven.plugins:maven-surefire-plugin:3.1.0:test - org.apache.maven.plugins:maven-jar-plugin:2.4:jar + org.apache.maven.plugins:maven-jar-plugin:3.3.0:jar - org.apache.maven.plugins:maven-install-plugin:2.4:install + org.apache.maven.plugins:maven-install-plugin:3.1.1:install - org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy + org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy @@ -62,28 +62,28 @@ org.codehaus.groovy:groovy-eclipse-compiler:add-groovy-build-paths - org.apache.maven.plugins:maven-resources-plugin:2.6:resources + org.apache.maven.plugins:maven-resources-plugin:3.3.1:resources - org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile + org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile - org.apache.maven.plugins:maven-resources-plugin:2.6:testResources + org.apache.maven.plugins:maven-resources-plugin:3.3.1:testResources - org.apache.maven.plugins:maven-compiler-plugin:3.6.2:testCompile + org.apache.maven.plugins:maven-compiler-plugin:3.11.0:testCompile - org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test + org.apache.maven.plugins:maven-surefire-plugin:3.1.0:test - org.apache.maven.plugins:maven-war-plugin:2.2:war + org.apache.maven.plugins:maven-war-plugin:3.3.2:war - org.apache.maven.plugins:maven-install-plugin:2.4:install + org.apache.maven.plugins:maven-install-plugin:3.1.1:install - org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy + org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy @@ -103,28 +103,28 @@ org.codehaus.groovy:groovy-eclipse-compiler:add-groovy-build-paths - org.apache.maven.plugins:maven-resources-plugin:2.6:resources + org.apache.maven.plugins:maven-resources-plugin:3.3.1:resources - org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile + org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile - org.apache.maven.plugins:maven-resources-plugin:2.6:testResources + org.apache.maven.plugins:maven-resources-plugin:3.3.1:testResources - org.apache.maven.plugins:maven-compiler-plugin:3.6.2:testCompile + org.apache.maven.plugins:maven-compiler-plugin:3.11.0:testCompile - org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test + org.apache.maven.plugins:maven-surefire-plugin:3.1.0:test - org.apache.maven.plugins:maven-rar-plugin:2.2:rar + org.apache.maven.plugins:maven-rar-plugin:3.0.0:rar - org.apache.maven.plugins:maven-install-plugin:2.4:install + org.apache.maven.plugins:maven-install-plugin:3.1.1:install - org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy + org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy @@ -144,28 +144,28 @@ org.codehaus.groovy:groovy-eclipse-compiler:add-groovy-build-paths - org.apache.maven.plugins:maven-resources-plugin:2.6:resources + org.apache.maven.plugins:maven-resources-plugin:3.3.1:resources - org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile + org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile - org.apache.maven.plugins:maven-resources-plugin:2.6:testResources + org.apache.maven.plugins:maven-resources-plugin:3.3.1:testResources - org.apache.maven.plugins:maven-compiler-plugin:3.6.2:testCompile + org.apache.maven.plugins:maven-compiler-plugin:3.11.0:testCompile - org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test + org.apache.maven.plugins:maven-surefire-plugin:3.1.0:test - org.apache.maven.plugins:maven-ejb-plugin:2.3:ejb + org.apache.maven.plugins:maven-ejb-plugin:3.2.1:ejb - org.apache.maven.plugins:maven-install-plugin:2.4:install + org.apache.maven.plugins:maven-install-plugin:3.1.1:install - org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy + org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy @@ -185,32 +185,32 @@ org.codehaus.groovy:groovy-eclipse-compiler:add-groovy-build-paths - org.apache.maven.plugins:maven-resources-plugin:2.6:resources + org.apache.maven.plugins:maven-resources-plugin:3.3.1:resources - org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile + org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor - org.apache.maven.plugins:maven-resources-plugin:2.6:testResources + org.apache.maven.plugins:maven-resources-plugin:3.3.1:testResources - org.apache.maven.plugins:maven-compiler-plugin:3.6.2:testCompile + org.apache.maven.plugins:maven-compiler-plugin:3.11.0:testCompile - org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test + org.apache.maven.plugins:maven-surefire-plugin:3.1.0:test - 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 - org.apache.maven.plugins:maven-install-plugin:2.4:install + org.apache.maven.plugins:maven-install-plugin:3.1.1:install - org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy + org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy diff --git a/extras/groovy-eclipse-maven-tests/pom.xml b/extras/groovy-eclipse-maven-tests/pom.xml index 9c16654254..6f7f9395a7 100644 --- a/extras/groovy-eclipse-maven-tests/pom.xml +++ b/extras/groovy-eclipse-maven-tests/pom.xml @@ -67,12 +67,12 @@ org.codehaus.groovy groovy-eclipse-compiler - 3.8.0 + 3.9.0 org.codehaus.groovy groovy-eclipse-batch - 3.0.17-01 + 3.0.17-03 diff --git a/extras/groovy-eclipse-quickstart/src/main/resources/archetype-resources/pom.xml b/extras/groovy-eclipse-quickstart/src/main/resources/archetype-resources/pom.xml index 1af9e24a7e..6b714ec7fe 100755 --- a/extras/groovy-eclipse-quickstart/src/main/resources/archetype-resources/pom.xml +++ b/extras/groovy-eclipse-quickstart/src/main/resources/archetype-resources/pom.xml @@ -59,12 +59,12 @@ org.codehaus.groovy groovy-eclipse-compiler - 3.8.0 + 3.9.0 org.codehaus.groovy groovy-eclipse-batch - 3.0.17-02 + 3.0.17-03 diff --git a/jdt-patch/e427/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247.java b/jdt-patch/e427/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247.java index 3b43ad3df1..e3bbb69c4b 100644 --- a/jdt-patch/e427/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247.java +++ b/jdt-patch/e427/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247.java @@ -81,7 +81,7 @@ public NameEnvironmentAnswer findClass(char[] typeName, String qualifiedPackageN Path p = null; if (this.subReleases != null && this.subReleases.length > 0) { for (String rel : this.subReleases) { - this.fs.getPath(rel, qualifiedBinaryFileName); + p = this.fs.getPath(rel, qualifiedBinaryFileName); if (Files.exists(p)) { content = JRTUtil.safeReadBytes(p); if (content != null) diff --git a/jdt-patch/e427/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/batch/FileSystem.java b/jdt-patch/e427/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/batch/FileSystem.java index c511fc1276..a706fb8288 100644 --- a/jdt-patch/e427/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/batch/FileSystem.java +++ b/jdt-patch/e427/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/batch/FileSystem.java @@ -303,7 +303,7 @@ public static Classpath getClasspath(String classpathName, String encoding, String destinationPath, Map options, String release) { Classpath result = null; File file = new File(convertPathSeparators(classpathName)); - if (file.isDirectory()) { + if (file.isDirectory() || classpathName.endsWith("-classes")) {//$NON-NLS-1$ if (file.exists()) { result = new ClasspathDirectory(file, encoding, isSourceOnly ? ClasspathLocation.SOURCE : diff --git a/jdt-patch/e428/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/batch/FileSystem.java b/jdt-patch/e428/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/batch/FileSystem.java index c511fc1276..a706fb8288 100644 --- a/jdt-patch/e428/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/batch/FileSystem.java +++ b/jdt-patch/e428/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/batch/FileSystem.java @@ -303,7 +303,7 @@ public static Classpath getClasspath(String classpathName, String encoding, String destinationPath, Map options, String release) { Classpath result = null; File file = new File(convertPathSeparators(classpathName)); - if (file.isDirectory()) { + if (file.isDirectory() || classpathName.endsWith("-classes")) {//$NON-NLS-1$ if (file.exists()) { result = new ClasspathDirectory(file, encoding, isSourceOnly ? ClasspathLocation.SOURCE : diff --git a/pom.xml b/pom.xml index 545d59814c..7c9529edc4 100644 --- a/pom.xml +++ b/pom.xml @@ -21,10 +21,10 @@ tycho ecj compiler. These two properties define what compiler will be used for those bundles. --> - 3.8.0 + 3.9.0 - 3.0.17-02 + 3.0.17-03 UTF-8