Project layout re-organization and various cleanups/fixes #1
|
@ -14,6 +14,11 @@
|
|||
<artifactId>jsoup</artifactId>
|
||||
<version>1.7.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<name>BWMirror Generator</name>
|
||||
|
|
|
@ -14,7 +14,7 @@ import bwmirror.generator.ccalls.CallImplementer;
|
|||
import bwmirror.impl.CApiParser;
|
||||
import bwmirror.impl.Clazz;
|
||||
import bwmirror.inject.GetPolygonPointsInjector;
|
||||
import bwmirror.util.FileUtils;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.file.Files;
|
||||
|
@ -102,10 +102,12 @@ public class CJavaPipeline {
|
|||
Init
|
||||
*/
|
||||
System.out.println("\n\nInit");
|
||||
for (PackageProcessOptions pkg : packages) {
|
||||
System.out.println("Deleting " + pkg.packageName);
|
||||
FileUtils.deleteDirectory(new File(pkg.packageName));
|
||||
}
|
||||
System.out.println("Cleaning existing generated output");
|
||||
FileUtils.deleteDirectory(new File(processingOptions.getProperty(GENERATE_TO_DIR)));
|
||||
FileUtils.deleteDirectory(new File(processingOptions.getProperty(HEADERS_DIR_PROPERTY)));
|
||||
FileUtils.deleteDirectory(new File(processingOptions.getProperty(COMPILE_DIR_PROPERTY)));
|
||||
FileUtils.deleteDirectory(new File(processingOptions.getProperty(C_IMPLEMENTATION_FILE_PROPERTY)).getParentFile());
|
||||
FileUtils.deleteDirectory(new File(processingOptions.getProperty(HEADER_FILE_PROPERTY)).getParentFile());
|
||||
|
||||
MirrorContext context = new MirrorContext();
|
||||
Generator generator = new Generator(context);
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
package bwmirror.util;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* User: PC
|
||||
* Date: 14. 8. 2014
|
||||
* Time: 10:11
|
||||
*/
|
||||
public class FileUtils {
|
||||
|
||||
@SuppressWarnings("ResultOfMethodCallIgnored")
|
||||
public static void deleteDirectory(File directory) {
|
||||
if (directory.exists()) {
|
||||
File[] files = directory.listFiles();
|
||||
if (files != null) {
|
||||
for (File file : files) {
|
||||
if (file.isDirectory()) {
|
||||
deleteDirectory(file);
|
||||
} else {
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in a new issue