]> source.dussan.org Git - aspectj.git/commitdiff
Quick fix for AJC '--release' option
authorAlexander Kriegisch <Alexander@Kriegisch.name>
Sat, 26 Jun 2021 01:48:35 +0000 (08:48 +0700)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Sat, 26 Jun 2021 09:23:25 +0000 (16:23 +0700)
Work in progress, relates to #70

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java

index 574f1e71e43ff3e9b9eae973c760c51fbf795b40..175c813edd90fefd02adc92fbedb7b7b7e991b17 100644 (file)
@@ -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()) {
index 0b2ab939f32cb3edef99564da2f78a0e6591a2c5..5279ad94070c6694525f18c42bcf6b3c1e1c1189 100644 (file)
@@ -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));