langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/OptionHelper.java
changeset 26107 a4a156a33c94
parent 26098 32588700060b
parent 25874 83c19f00452c
child 27383 716ed9a6d607
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/OptionHelper.java	Wed Jul 05 19:56:33 2017 +0200
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/OptionHelper.java	Mon Aug 18 10:59:44 2014 +0100
@@ -25,17 +25,23 @@
 
 package com.sun.tools.sjavac.options;
 
-import java.nio.file.Files;
+import java.io.IOException;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.Arrays;
 import java.util.List;
 
+import com.sun.tools.javac.main.CommandLine;
 import com.sun.tools.sjavac.Transformer;
 
 /**
  * This class is used to decode sjavac options.
  * See com.sun.tools.sjavac.options.Options for example usage.
+ *
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
+ *  This code and its internal interfaces are subject to change or
+ *  deletion without notice.</b>
  */
 public abstract class OptionHelper {
 
@@ -78,6 +84,9 @@
     /** Record path for reference source list */
     public abstract void compareFoundSources(Path referenceList);
 
+    /** Record a single permitted artifact */
+    public abstract void permitArtifact(String f);
+
     /** Record the fact that unidentified artifacts are permitted */
     public abstract void permitUnidentifiedArtifacts();
 
@@ -102,6 +111,9 @@
     /** Sets the directory for generated headers */
     public abstract void headerDir(Path dir);
 
+    /** Sets the directory for state and log files generated by sjavac */
+    public abstract void stateDir(Path dir);
+
     /** Sets the implicit policy */
     public abstract void implicit(String policy);
 
@@ -112,7 +124,11 @@
      * @param args the arguments to traverse.
      */
     void traverse(String[] args) {
-
+        try {
+            args = CommandLine.parse(args); // Detect @file and load it as a command line.
+        } catch (java.io.IOException e) {
+            throw new IllegalArgumentException("Problem reading @"+e.getMessage());
+        }
         ArgumentIterator argIter = new ArgumentIterator(Arrays.asList(args));
 
         nextArg: