di: @PreDestroy

I need in my private experiments
This commit is contained in:
Stepan Koltsov
2012-04-20 21:33:18 +04:00
parent 994e6fe009
commit 3b0c9244c9
12 changed files with 97 additions and 15 deletions
@@ -165,21 +165,26 @@ public class KotlinToJVMBytecodeCompiler {
return false;
}
ClassFileFactory factory = generationState.getFactory();
if (jar != null) {
try {
CompileEnvironmentUtil.writeToJar(factory, new FileOutputStream(jar), mainClass, includeRuntime);
} catch (FileNotFoundException e) {
throw new CompileEnvironmentException("Invalid jar path " + jar, e);
try {
ClassFileFactory factory = generationState.getFactory();
if (jar != null) {
try {
CompileEnvironmentUtil.writeToJar(factory, new FileOutputStream(jar), mainClass, includeRuntime);
} catch (FileNotFoundException e) {
throw new CompileEnvironmentException("Invalid jar path " + jar, e);
}
}
else if (outputDir != null) {
CompileEnvironmentUtil.writeToOutputDirectory(factory, outputDir);
}
else {
throw new CompileEnvironmentException("Output directory or jar file is not specified - no files will be saved to the disk");
}
return true;
}
else if (outputDir != null) {
CompileEnvironmentUtil.writeToOutputDirectory(factory, outputDir);
finally {
generationState.destroy();
}
else {
throw new CompileEnvironmentException("Output directory or jar file is not specified - no files will be saved to the disk");
}
return true;
}
public static boolean compileBunchOfSources(