Allow to compile with Jack.
Even those tests and generated code compiled by the java build tool.
Change-Id: Ib38b2f5d6d8518cb4fa7bd78abf93f9beef73514
diff --git a/tools/vm-tests-tf/src/util/build/JavacBuildStep.java b/tools/vm-tests-tf/src/util/build/JavacBuildStep.java
index 7d7033f..d08a2c6 100644
--- a/tools/vm-tests-tf/src/util/build/JavacBuildStep.java
+++ b/tools/vm-tests-tf/src/util/build/JavacBuildStep.java
@@ -23,7 +23,7 @@
import java.util.HashSet;
import java.util.Set;
-public class JavacBuildStep extends BuildStep {
+public class JavacBuildStep extends SourceBuildStep {
private final String destPath;
private final String classPath;
@@ -32,12 +32,13 @@
this.destPath = destPath;
this.classPath = classPath;
}
-
+
+ @Override
public void addSourceFile(String sourceFile)
{
sourceFiles.add(sourceFile);
}
-
+
@Override
boolean build() {
if (super.build())
@@ -46,7 +47,7 @@
{
return true;
}
-
+
File destFile = new File(destPath);
if (!destFile.exists() && !destFile.mkdirs())
{
@@ -59,13 +60,12 @@
commandLine[1] = classPath;
commandLine[2] = "-d";
commandLine[3] = destPath;
-
+
String[] files = new String[sourceFiles.size()];
sourceFiles.toArray(files);
-
+
System.arraycopy(files, 0, commandLine, args, files.length);
-
-
+
return Main.compile(commandLine, new PrintWriter(System.err)) == 0;
}
return false;
@@ -73,17 +73,16 @@
@Override
public boolean equals(Object obj) {
- // TODO Auto-generated method stub
if (super.equals(obj))
{
JavacBuildStep other = (JavacBuildStep) obj;
- return destPath.equals(other.destPath)
+ return destPath.equals(other.destPath)
&& classPath.equals(other.classPath)
&& sourceFiles.equals(other.sourceFiles);
}
return false;
}
-
+
@Override
public int hashCode() {
return destPath.hashCode() ^ classPath.hashCode() ^ sourceFiles.hashCode();