maven plugin: cleanup
This commit is contained in:
+1
@@ -24,6 +24,7 @@ import org.jetbrains.jet.cli.CompilerArguments;
|
||||
*
|
||||
* @goal js
|
||||
* @phase compile
|
||||
* @noinspection UnusedDeclaration
|
||||
*/
|
||||
public class K2JSCompilerMojo extends KotlinCompileMojo {
|
||||
/**
|
||||
|
||||
+3
-9
@@ -36,7 +36,6 @@ import java.util.List;
|
||||
* Compiles Kotlin code to JavaScript
|
||||
*/
|
||||
public class K2JSCompilerPlugin implements CompilerPlugin {
|
||||
|
||||
private String outFile = "target/js/program.js";
|
||||
|
||||
public void processFiles(CompilerPluginContext context) {
|
||||
@@ -56,12 +55,11 @@ public class K2JSCompilerPlugin implements CompilerPlugin {
|
||||
|
||||
K2JSTranslator translator = new K2JSTranslator(config);
|
||||
final String code = translator.generateProgramCode(sources);
|
||||
|
||||
File file = new File(outFile);
|
||||
File outDir = file.getParentFile();
|
||||
if (outDir != null && !outDir.exists()) {
|
||||
outDir.mkdirs();
|
||||
}
|
||||
|
||||
try {
|
||||
Files.createParentDirs(file);
|
||||
Files.write(code, file, Charset.forName("UTF-8"));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
@@ -70,10 +68,6 @@ public class K2JSCompilerPlugin implements CompilerPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
public String getOutFile() {
|
||||
return outFile;
|
||||
}
|
||||
|
||||
public void setOutFile(String outFile) {
|
||||
this.outFile = outFile;
|
||||
}
|
||||
|
||||
+1
@@ -25,6 +25,7 @@ import org.jetbrains.jet.cli.CompilerArguments;
|
||||
* @goal compile
|
||||
* @phase compile
|
||||
* @requiresDependencyResolution compile
|
||||
* @noinspection UnusedDeclaration
|
||||
*/
|
||||
public class KotlinCompileMojo extends KotlinCompileMojoBase {
|
||||
@Override
|
||||
|
||||
+1
@@ -26,6 +26,7 @@ import org.jetbrains.jet.cli.CompilerArguments;
|
||||
* @goal test-compile
|
||||
* @phase test-compile
|
||||
* @requiresDependencyResolution test
|
||||
* @noinspection UnusedDeclaration
|
||||
*/
|
||||
public class KotlinTestCompileMojo extends KotlinCompileMojoBase {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user