javadoclet

How to add multiple sourcepath to a doclet on windows?


I created a doclet, it will scan two projects(project A depend on project B) So I have to add two sourcepath.

Based on doclet docs, I have to use colon to separate multiple source folder: Colon-separated list of source-file directories, like this:

String sourcePath = "C:/projA/src/main/java/:C:/projB/src/main/java/";

But you can see my testing environment is on windows, the path has something like "c:", so this doesn't work.

I tried to use semi-colon, doesn't work. If I used one sourcepth, it works perfectly:

String sourcePath = "C:/projA/src/main/java/";
String[] myArgs = { "-doclet", MyDoclet.class.getName(), 
            "-sourcepath", sourcePath, "-subpackages", subpackages };
com.sun.tools.javadoc.Main.execute(myArgs);

How can I fix this issue?

Thanks!


Solution

  • Actually, semi-colon works: pathA;pathB