Commit fe80dbd6 authored by David Trott's avatar David Trott

Updated to utilize the new -out parameter added to thrift compiler patch (THRIFT-1069)

parent 3a94ad07
......@@ -79,8 +79,6 @@ final class Thrift {
}
// result will always be 0 here.
moveGeneratedFiles();
return 0;
}
......@@ -99,7 +97,7 @@ final class Thrift {
command.add("-I");
command.add(thriftPathElement.toString());
}
command.add("-o");
command.add("-out");
command.add(javaOutputDirectory.toString());
command.add("--gen");
command.add(generator);
......@@ -107,27 +105,6 @@ final class Thrift {
return ImmutableList.copyOf(command);
}
private void moveGeneratedFiles() {
File genDir = new File(javaOutputDirectory, GENERATED_JAVA);
final File[] generatedFiles = genDir.listFiles();
for (File generatedFile : generatedFiles) {
final String filename = generatedFile.getName();
final File targetLocation = new File(javaOutputDirectory, filename);
if (targetLocation.exists()) {
if (!targetLocation.delete()) {
throw new RuntimeException("File Overwrite Failed: " + targetLocation.getPath());
}
}
if (!generatedFile.renameTo(targetLocation)) {
throw new RuntimeException("Rename Failed: " + targetLocation.getPath());
}
}
if (!genDir.delete()) {
throw new RuntimeException("Failed to delete directory: " + genDir.getPath());
}
}
/**
* @return the output
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment