File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
semanticdb-javac/src/main/java/com/sourcegraph/semanticdb_javac Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 77import java .util .List ;
88
99public class InjectSemanticdbOptions {
10+ /**
11+ * Updates a list of Java compiler arguments to include -Xplugin:semanticdb.
12+ *
13+ * This main method should be used by a `javac` wrapper script like this:
14+ *
15+ * <pre>
16+ * NEW_OPTIONS_PATH=$(mktemp)
17+ * java -cp semanticdb.jar \
18+ * -Dsemanticdb.output=NEW_OPTIONS_PATH \
19+ * com.sourcegraph.semanticdb_javac.InjectSemanticdbOptions $@
20+ * javac @$NEW_OPTIONS_PATH
21+ * </pre>
22+ *
23+ * Requires the following system properties:
24+ *
25+ * <ul>
26+ * <li>-Dsemanticdb.output=PATH: the file to write the updated compiler options</li>
27+ * <li>-Dsemanticdb.old-output=PATH: the file to write the original compiler options. Only used for debugging purposes.</li>
28+ * <li>-Dsemanticdb.pluginpath=PATH: the path to the SemanticDB compiler plugin jar</li>
29+ * <li>-Dsemanticdb.sourceroot=PATH: the path to use in -Xplugin:semanticdb -sourceroot:PATH</li>
30+ * <li>-Dsemanticdb.targetroot=PATH: the path to use in -Xplugin:semanticdb -targetroot:PATH</li>
31+ * </ul>
32+ *
33+ * @param args the Java compiler arguments to update.
34+ */
1035 public static void main (String [] args ) throws IOException {
1136 SemanticdbOptionBuilder newArgs = new SemanticdbOptionBuilder ();
1237 for (String arg : args ) {
You can’t perform that action at this time.
0 commit comments