Update javac version
MOE_MIGRATED_REVID=141337639
diff --git a/javatests/com/google/turbine/bytecode/ClassWriterTest.java b/javatests/com/google/turbine/bytecode/ClassWriterTest.java
index 92bd5ba..2fe2d5f 100644
--- a/javatests/com/google/turbine/bytecode/ClassWriterTest.java
+++ b/javatests/com/google/turbine/bytecode/ClassWriterTest.java
@@ -24,7 +24,7 @@
import com.google.common.jimfs.Jimfs;
import com.sun.source.util.JavacTask;
import com.sun.tools.javac.api.JavacTool;
-import com.sun.tools.javac.nio.JavacPathFileManager;
+import com.sun.tools.javac.file.JavacFileManager;
import com.sun.tools.javac.util.Context;
import java.io.PrintWriter;
import java.nio.file.FileSystem;
@@ -61,8 +61,8 @@
Path out = fs.getPath("out");
Files.createDirectories(out);
- JavacPathFileManager fileManager = new JavacPathFileManager(new Context(), false, UTF_8);
- fileManager.setLocation(StandardLocation.CLASS_OUTPUT, ImmutableList.of(out));
+ JavacFileManager fileManager = new JavacFileManager(new Context(), false, UTF_8);
+ fileManager.setLocationFromPaths(StandardLocation.CLASS_OUTPUT, ImmutableList.of(out));
DiagnosticCollector<JavaFileObject> collector = new DiagnosticCollector<>();
JavacTask task =
JavacTool.create()
diff --git a/javatests/com/google/turbine/bytecode/JavapUtils.java b/javatests/com/google/turbine/bytecode/JavapUtils.java
index f78c65b..ccaed47 100644
--- a/javatests/com/google/turbine/bytecode/JavapUtils.java
+++ b/javatests/com/google/turbine/bytecode/JavapUtils.java
@@ -22,7 +22,7 @@
import com.google.common.collect.ImmutableList;
import com.google.common.jimfs.Configuration;
import com.google.common.jimfs.Jimfs;
-import com.sun.tools.javac.nio.JavacPathFileManager;
+import com.sun.tools.javac.file.JavacFileManager;
import com.sun.tools.javac.util.Context;
import com.sun.tools.javap.JavapTask;
import java.io.IOException;
@@ -50,9 +50,9 @@
Files.createDirectories(path.getParent());
}
Files.write(path, bytes);
- JavacPathFileManager fileManager = new JavacPathFileManager(new Context(), false, UTF_8);
- fileManager.setLocation(StandardLocation.CLASS_PATH, ImmutableList.of(root));
- fileManager.setLocation(StandardLocation.PLATFORM_CLASS_PATH, BOOTCLASSPATH);
+ JavacFileManager fileManager = new JavacFileManager(new Context(), false, UTF_8);
+ fileManager.setLocationFromPaths(StandardLocation.CLASS_PATH, ImmutableList.of(root));
+ fileManager.setLocationFromPaths(StandardLocation.PLATFORM_CLASS_PATH, BOOTCLASSPATH);
DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>();
List<String> options = ImmutableList.of("-s", "-private");
Writer writer = new StringWriter();
diff --git a/javatests/com/google/turbine/deps/DependenciesTest.java b/javatests/com/google/turbine/deps/DependenciesTest.java
index 91a8440..6a882f9 100644
--- a/javatests/com/google/turbine/deps/DependenciesTest.java
+++ b/javatests/com/google/turbine/deps/DependenciesTest.java
@@ -63,7 +63,7 @@
class LibraryBuilder {
final Map<String, String> sources = new LinkedHashMap<>();
- private ImmutableList<Path> classpath;
+ private ImmutableList<Path> classpath = ImmutableList.of();
LibraryBuilder addSourceLines(String path, String... lines) {
sources.put(path, Joiner.on('\n').join(lines));
diff --git a/javatests/com/google/turbine/lower/IntegrationTestSupport.java b/javatests/com/google/turbine/lower/IntegrationTestSupport.java
index e8a90f1..81ca70a 100644
--- a/javatests/com/google/turbine/lower/IntegrationTestSupport.java
+++ b/javatests/com/google/turbine/lower/IntegrationTestSupport.java
@@ -33,7 +33,7 @@
import com.google.turbine.tree.Tree;
import com.sun.source.util.JavacTask;
import com.sun.tools.javac.api.JavacTool;
-import com.sun.tools.javac.nio.JavacPathFileManager;
+import com.sun.tools.javac.file.JavacFileManager;
import com.sun.tools.javac.util.Context;
import java.io.BufferedWriter;
import java.io.IOException;
@@ -461,10 +461,10 @@
JavacTool compiler = JavacTool.create();
DiagnosticCollector<JavaFileObject> collector = new DiagnosticCollector<>();
- JavacPathFileManager fileManager = new JavacPathFileManager(new Context(), true, UTF_8);
- fileManager.setLocation(StandardLocation.PLATFORM_CLASS_PATH, bootclasspath);
- fileManager.setLocation(StandardLocation.CLASS_OUTPUT, ImmutableList.of(out));
- fileManager.setLocation(StandardLocation.CLASS_PATH, classpath);
+ JavacFileManager fileManager = new JavacFileManager(new Context(), true, UTF_8);
+ fileManager.setLocationFromPaths(StandardLocation.PLATFORM_CLASS_PATH, bootclasspath);
+ fileManager.setLocationFromPaths(StandardLocation.CLASS_OUTPUT, ImmutableList.of(out));
+ fileManager.setLocationFromPaths(StandardLocation.CLASS_PATH, classpath);
JavacTask task =
compiler.getTask(
diff --git a/javatests/com/google/turbine/lower/LowerIntegrationTest.java b/javatests/com/google/turbine/lower/LowerIntegrationTest.java
index f54f624..38ddcb9 100644
--- a/javatests/com/google/turbine/lower/LowerIntegrationTest.java
+++ b/javatests/com/google/turbine/lower/LowerIntegrationTest.java
@@ -330,7 +330,7 @@
ImmutableList<Path> classpathJar = ImmutableList.of();
if (!input.classes.isEmpty()) {
Map<String, byte[]> classpath =
- IntegrationTestSupport.runJavac(input.classes, null, BOOTCLASSPATH);
+ IntegrationTestSupport.runJavac(input.classes, ImmutableList.of(), BOOTCLASSPATH);
Path lib = temporaryFolder.newFile("lib.jar").toPath();
try (JarOutputStream jos = new JarOutputStream(Files.newOutputStream(lib))) {
for (Map.Entry<String, byte[]> entry : classpath.entrySet()) {
diff --git a/pom.xml b/pom.xml
index 913b4a3..44450c9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,6 +14,10 @@
turbine is a header compiler for Java
</description>
+ <properties>
+ <javac.version>9-dev-r3297-1</javac.version>
+ </properties>
+
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
@@ -44,9 +48,10 @@
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>javac</artifactId>
- <version>1.9.0-dev-r2973-2</version>
+ <version>${javac.version}</version>
<scope>test</scope>
</dependency>
+ <!-- required for javap task -->
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
@@ -123,6 +128,15 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.19.1</version>
+ <configuration>
+ <!-- put javac.jar on bootclasspath when executing tests -->
+ <argLine>-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${javac.version}/javac-${javac.version}.jar</argLine>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>