diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-06-26 08:48:35 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-06-26 16:23:25 +0700 |
commit | 18b5bb07747084fb0857148139260c085bfb196f (patch) | |
tree | efad2449d24f30b66987fd5ed6e34b180c327a85 | |
parent | 4960952bc2b6f253a9763534b5a492074d69318c (diff) | |
download | aspectj-18b5bb07747084fb0857148139260c085bfb196f.tar.gz aspectj-18b5bb07747084fb0857148139260c085bfb196f.zip |
Quick fix for AJC '--release' option
Work in progress, relates to #70
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
-rw-r--r-- | org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java | 4 | ||||
-rw-r--r-- | org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java | 16 |
2 files changed, 19 insertions, 1 deletions
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java index 574f1e71e..175c813ed 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java @@ -415,6 +415,10 @@ public class BuildArgParser extends Main { return ret; } + public FileSystem.Classpath[] getCheckedClasspaths() { + return checkedClasspaths; + } + private void addExtDirs(String extdirs, List classpathCollector) { StringTokenizer tokenizer = new StringTokenizer(extdirs, File.pathSeparator); while (tokenizer.hasMoreTokens()) { diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java index 0b2ab939f..5279ad940 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java @@ -19,6 +19,7 @@ package org.aspectj.ajdt.internal.core.builder; import java.io.File; import java.io.FileFilter; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -27,9 +28,11 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.StringTokenizer; +import java.util.stream.Collectors; import org.aspectj.ajdt.ajc.BuildArgParser; import org.aspectj.ajdt.internal.compiler.CompilationResultDestinationManager; +import org.aspectj.org.eclipse.jdt.internal.compiler.batch.ClasspathJep247; import org.aspectj.org.eclipse.jdt.internal.compiler.batch.ClasspathLocation; import org.aspectj.org.eclipse.jdt.internal.compiler.batch.FileSystem; import org.aspectj.org.eclipse.jdt.internal.compiler.batch.FileSystem.Classpath; @@ -930,7 +933,18 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags { // ArrayList<Classpath> allPaths = handleBootclasspath(bootclasspaths, customEncoding); ArrayList<FileSystem.Classpath> allPaths = new ArrayList<>(); - allPaths.addAll(processStringPath(bootclasspath, encoding)); + if ( + Arrays.stream(buildArgParser.getCheckedClasspaths()) + .anyMatch(cp -> cp instanceof ClasspathJep247) + ) { + allPaths.addAll( + Arrays.stream(buildArgParser.getCheckedClasspaths()) + .filter(cp -> cp instanceof ClasspathJep247) + .collect(Collectors.toList()) + ); + } + else + allPaths.addAll(processStringPath(bootclasspath, encoding)); allPaths.addAll(processFilePath(inJars, encoding)); allPaths.addAll(processFilePath(inPath, encoding)); allPaths.addAll(processFilePath(aspectpath, encoding)); |