RFR - 8027634: Support @argfiles for java command-line tool
henry.jen at oracle.com
Fri Jul 10 03:50:24 UTC 2015
Sigh, forgot the link to the webrev again.
> On Jul 9, 2015, at 8:48 PM, Henry Jen <henry.jen at oracle.com> wrote:
> Please review proposed patch for JDK-8027634. This patch is to enable java support command line argument file like javac does. The implementation use the same syntax rule, which is implemented in CommandLine.java with java.io.StreamTokenizer.
> Some early comment is that we probably don’t need such complexity to support same syntax, also require to quote whole token is a little inconvenient. For example, must be -cp “c:\\foo bar\\lib;c:\\lib” instead of -cp c:\”foo bar”\lib;c:\lib.
> I am debating if such compatibility is necessary useful, after all, easy and intuitive is more important, and with simpler rule, the implementation will be cleaner as well.
> Anyhow, with the patch out, at least developer can build idk and have something to test with to see if this can fulfill their use cases.
> Also, for tools other than java that use launcher, it’s possible to use -J at argfile to pass arguments. For example, if want to pass -J options to javac, it’s now possible to do so with javac -J at argfile, and put -J options in the argfile.
> If the consensus is that such syntax compatibility is not important, we will go ahead remove the escaping support(except probably enable escape for quote itself) in quote, and maybe add support of quote within a token.
> CCing build-dev for build changes, jdk9-dev for wider audience for tools.
>  https://bugs.openjdk.java.net/browse/JDK-8027634
>  http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javac.html#commandlineargfile
>  http://hg.openjdk.java.net/jdk9/jdk9/langtools/file/03e083639ee9/src/jdk.compiler/share/classes/com/sun/tools/javac/main/CommandLine.java
More information about the build-dev