RFR (XS): 8199768 jdk/test/lib/compiler/CompilerUtils.java needs to provide more control over compilation
david.holmes at oracle.com
Mon Mar 19 21:44:06 UTC 2018
Thanks for looking at this Alan!
On 20/03/2018 3:23 AM, Alan Bateman wrote:
> On 19/03/2018 05:11, David Holmes wrote:
>> Unsure exactly who should review this ...
>> bug: https://bugs.openjdk.java.net/browse/JDK-8199768
>> webrev: http://cr.openjdk.java.net/~dholmes/8199768/webrev/
>> CompilerUtils.compile compiles all source files in a given directory
>> tree into a specific directory. This is done by passing
>> Integer.MAX_VALUE as the 'depth' argument to Files.find.
>> There are times when we** don't want to compile the entire tree into a
>> single directory so it would be useful to be able to specify whether
>> or not to recurse (depth = Integer.MAX_VALUE) or not (depth = 1).
>> ** I need this for some tests I'm developing for Nestmates (JEP 181)
>> and it will be simpler to fix this separately in mainline.
> Looks okay although an alternative is to just invoke the existing method
> with the specify source files that you want to compile (which I think
> what is what several tests do when they have only one or two source
> files to compile).
Based on the description I hadn't realized the Path could actually just
be a single file. But I think my change makes it easier to compile
things without needing to enumerate all the source files. You can now
compile 1 file, 1 directory, or 1 directory tree.
More information about the core-libs-dev