src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Options.java
Print this page
rev 2819 : imported patch my-classpath-deps-00
@@ -34,10 +34,11 @@
import java.util.Map;
import java.util.Set;
import java.util.HashSet;
import com.sun.tools.sjavac.Transformer;
+import com.sun.tools.sjavac.Util;
/**
* Instances of this class represent values for sjavac command line options.
*
* <p><b>This is NOT part of any supported API.
@@ -284,10 +285,12 @@
/** Extract the arguments to be passed on to javac. */
public String[] prepJavacArgs() {
List<String> args = new ArrayList<>();
+//args.add("-doe");
+
// Output directories
args.add("-d");
args.add(destDir.toString());
if (getGenSrcDir() != null) {
@@ -316,10 +319,22 @@
}
// This can't be anything but 'none'. Enforced by sjavac main method.
args.add("-implicit:" + implicitPolicy);
+ // If this option is not used, Object for instance is picked up from
+ // PLATFORM_CLASS_PATH.
+ //
+ // Turns out that bootclasspath = classpath, in the JDK build so it's
+ // still actually the correct file that is looked up. However, we don't
+ // want non-JDK-builds to track files on the bootclasspath, so we enable
+ // this option, to allow us to ignore dependencies on bootclasspath.
+ //
+ // It may make more sense to use an empty bootclasspath when building
+ // the JDK.
+ //args.add("-XXuserPathsFirst");
+
// Append javac-options (i.e. pass through options not recognized by
// sjavac to javac.)
args.addAll(javacArgs);
return args.toArray(new String[args.size()]);
@@ -356,25 +371,29 @@
sources.addAll(createSourceLocations(paths));
}
@Override
public void exclude(String exclPattern) {
+ exclPattern = Util.normalizeDriveLetter(exclPattern);
excludes.add(exclPattern);
}
@Override
public void include(String inclPattern) {
+ inclPattern = Util.normalizeDriveLetter(inclPattern);
includes.add(inclPattern);
}
@Override
public void excludeFile(String exclFilePattern) {
+ exclFilePattern = Util.normalizeDriveLetter(exclFilePattern);
excludeFiles.add(exclFilePattern);
}
@Override
public void includeFile(String inclFilePattern) {
+ inclFilePattern = Util.normalizeDriveLetter(inclFilePattern);
includeFiles.add(inclFilePattern);
}
@Override
public void addTransformer(String suffix, Transformer tr) {