diff --git a/build.xml b/build.xml index 7cff6776109..c5a74ee9208 100644 --- a/build.xml +++ b/build.xml @@ -1,6 +1,7 @@ + @@ -43,21 +44,17 @@ + - - - - - - - - - - - + + + + + + diff --git a/compiler/cli/bin/kotlinc.bat b/compiler/cli/bin/kotlinc.bat index 20d2e1795d8..4fb6990f3b9 100644 --- a/compiler/cli/bin/kotlinc.bat +++ b/compiler/cli/bin/kotlinc.bat @@ -27,7 +27,7 @@ if "%_TOOL_CLASSPATH%"=="" ( for /d %%f in ("%_KOTLIN_HOME%\lib\*") do call :add_cpath "%%f" ) -"%_JAVACMD%" %_JAVA_OPTS% cp "%_TOOL_CLASSPATH%" org.jetbrains.jet.cli.KotlinCompiler %* +"%_JAVACMD%" %_JAVA_OPTS% -cp "%_TOOL_CLASSPATH%" org.jetbrains.jet.cli.KotlinCompiler %* goto end rem ########################################################################## diff --git a/compiler/cli/src/org/jetbrains/jet/cli/KotlinCompiler.java b/compiler/cli/src/org/jetbrains/jet/cli/KotlinCompiler.java index 576f436dd8d..e41fcdddb7c 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/KotlinCompiler.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/KotlinCompiler.java @@ -56,6 +56,10 @@ public class KotlinCompiler { environment.registerFileType(JetFileType.INSTANCE, "kt"); environment.registerParserDefinition(new JetParserDefinition()); VirtualFile vFile = environment.getLocalFileSystem().findFileByPath(args [0]); + if (vFile == null) { + System.out.print("File not found: " + args[0]); + return; + } Project project = environment.getProject(); GenerationState generationState = new GenerationState(project, false); @@ -64,6 +68,10 @@ public class KotlinCompiler { if (psiFile instanceof JetFile) { namespaces.add(((JetFile) psiFile).getRootNamespace()); } + else { + System.out.print("Not a Kotlin file: " + vFile.getPath()); + return; + } BindingContext bindingContext = AnalyzingUtils.getInstance(JavaDefaultImports.JAVA_DEFAULT_IMPORTS).analyzeNamespaces(project, namespaces, JetControlFlowDataTraceFactory.EMPTY); @@ -92,6 +100,7 @@ public class KotlinCompiler { File target = new File(vFile.getParent().getPath(), file); try { FileUtil.writeToFile(target, factory.asBytes(file)); + System.out.println("Generated classfile: " + target); } catch (IOException e) { System.out.println(e.getMessage()); } diff --git a/examples/src/Bottles.jetl b/examples/src/Bottles.kt similarity index 100% rename from examples/src/Bottles.jetl rename to examples/src/Bottles.kt