8152897: refactor ToolBox to allow reduced documented dependencies

Reviewed-by: vromero
This commit is contained in:
Jonathan Gibbons 2016-03-31 15:20:50 -07:00
parent 208d93e110
commit 7812306bc0
212 changed files with 3955 additions and 3485 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -27,15 +27,17 @@
* @summary Test that '.jar' files in -extdirs are found.
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JarTask toolbox.JavacTask
* @run main ExtDirTest
*/
import java.io.File;
import toolbox.JarTask;
import toolbox.JavacTask;
import toolbox.ToolBox;
// Original test: test/tools/javac/ExtDirs/ExtDirs.sh
public class ExtDirTest {
@ -112,22 +114,22 @@ public class ExtDirTest {
}
void createJars() throws Exception {
tb.new JavacTask()
new JavacTask(tb)
.outdir(".")
.sources(ExtDirTestClass1Src)
.run();
tb.new JarTask("pkg1.jar")
new JarTask(tb, "pkg1.jar")
.manifest(jar1Manifest)
.files("pkg1/ExtDirTestClass1.class")
.run();
tb.new JavacTask()
new JavacTask(tb)
.outdir(".")
.sources(ExtDirTestClass2Src)
.run();
tb.new JarTask("pkg2.jar")
new JarTask(tb, "pkg2.jar")
.manifest(jar2Manifest)
.files("pkg2/ExtDirTestClass2.class")
.run();
@ -149,7 +151,7 @@ public class ExtDirTest {
}
void compileWithExtDirs() throws Exception {
tb.new JavacTask()
new JavacTask(tb)
.outdir(".")
.options("-source", "8",
"-extdirs", "ext1")
@ -157,7 +159,7 @@ public class ExtDirTest {
.run()
.writeAll();
tb.new JavacTask()
new JavacTask(tb)
.outdir(".")
.options("-source", "8",
"-extdirs", "ext1" + File.pathSeparator + "ext2")
@ -165,7 +167,7 @@ public class ExtDirTest {
.run()
.writeAll();
tb.new JavacTask()
new JavacTask(tb)
.outdir(".")
.options("-source", "8",
"-extdirs", "ext3")