diff --git a/jps-plugin/test/org/jetbrains/jet/jps/build/AbstractKotlinJpsBuildTestCase.java b/jps-plugin/test/org/jetbrains/jet/jps/build/AbstractKotlinJpsBuildTestCase.java index 33709bc39dc..2cbd42c48ed 100644 --- a/jps-plugin/test/org/jetbrains/jet/jps/build/AbstractKotlinJpsBuildTestCase.java +++ b/jps-plugin/test/org/jetbrains/jet/jps/build/AbstractKotlinJpsBuildTestCase.java @@ -81,14 +81,33 @@ public abstract class AbstractKotlinJpsBuildTestCase extends JpsBuildTestCase { return addKotlinRuntimeDependency(myProject); } + protected JpsLibrary addKotlinJavaScriptStdlibDependency() { + return addKotlinJavaScriptStdlibDependency(myProject); + } + + protected JpsLibrary addKotlinJavaScriptDependency(String libraryName, File libraryFile) { + return addDependency(JpsJavaDependencyScope.COMPILE, myProject.getModules(), false, libraryName, libraryFile); + } + static JpsLibrary addKotlinRuntimeDependency(@NotNull JpsProject project) { return addKotlinRuntimeDependency(JpsJavaDependencyScope.COMPILE, project.getModules(), false); } + static JpsLibrary addKotlinJavaScriptStdlibDependency(@NotNull JpsProject project) { + return addKotlinJavaScriptStdlibDependency(JpsJavaDependencyScope.COMPILE, project.getModules(), false); + } + protected static JpsLibrary addKotlinRuntimeDependency(JpsJavaDependencyScope type, Collection modules, boolean exported) { - JpsLibrary library = modules.iterator().next().getProject().addLibrary("kotlin-runtime", JpsJavaLibraryType.INSTANCE); - File runtime = PathUtil.getKotlinPathsForDistDirectory().getRuntimePath(); - library.addRoot(runtime, JpsOrderRootType.COMPILED); + return addDependency(type, modules, exported, "kotlin-runtime", PathUtil.getKotlinPathsForDistDirectory().getRuntimePath()); + } + + protected static JpsLibrary addKotlinJavaScriptStdlibDependency(JpsJavaDependencyScope type, Collection modules, boolean exported) { + return addDependency(type, modules, exported, "KotlinJavaScript", PathUtil.getKotlinPathsForDistDirectory().getJsStdLibJarPath()); + } + + protected static JpsLibrary addDependency(JpsJavaDependencyScope type, Collection modules, boolean exported, String libraryName, File file) { + JpsLibrary library = modules.iterator().next().getProject().addLibrary(libraryName, JpsJavaLibraryType.INSTANCE); + library.addRoot(file, JpsOrderRootType.COMPILED); for (JpsModule module : modules) { JpsModuleRootModificationUtil.addDependency(module, library, type, exported); } diff --git a/jps-plugin/test/org/jetbrains/jet/jps/build/KotlinJpsBuildTest.java b/jps-plugin/test/org/jetbrains/jet/jps/build/KotlinJpsBuildTest.java index 9a96e7ca41e..70197816a83 100644 --- a/jps-plugin/test/org/jetbrains/jet/jps/build/KotlinJpsBuildTest.java +++ b/jps-plugin/test/org/jetbrains/jet/jps/build/KotlinJpsBuildTest.java @@ -20,13 +20,14 @@ import com.intellij.openapi.util.Condition; import com.intellij.openapi.util.io.FileUtil; import com.intellij.testFramework.LightVirtualFile; import com.intellij.util.containers.ContainerUtil; +import com.intellij.util.io.ZipUtil; +import kotlin.KotlinPackage; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.codegen.AsmUtil; -import org.jetbrains.jet.compiler.CompilerSettings; -import org.jetbrains.jet.jps.JpsKotlinCompilerSettings; import org.jetbrains.jet.lang.resolve.kotlin.PackagePartClassUtils; import org.jetbrains.jet.lang.resolve.name.FqName; +import org.jetbrains.jet.utils.PathUtil; import org.jetbrains.jps.builders.BuildResult; import org.jetbrains.jps.model.java.JpsJavaDependencyScope; import org.jetbrains.jps.model.java.JpsJavaExtensionService; @@ -38,9 +39,12 @@ import org.jetbrains.org.objectweb.asm.MethodVisitor; import org.jetbrains.org.objectweb.asm.Opcodes; import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; import java.io.IOException; -import java.util.Set; -import java.util.TreeSet; +import java.util.*; +import java.util.regex.Pattern; +import java.util.zip.ZipOutputStream; public class KotlinJpsBuildTest extends AbstractKotlinJpsBuildTestCase { private static final String PROJECT_NAME = "kotlinProject"; @@ -48,7 +52,31 @@ public class KotlinJpsBuildTest extends AbstractKotlinJpsBuildTestCase { private static final String[] EXCLUDE_FILES = { "Excluded.class", "YetAnotherExcluded.class" }; private static final String[] NOTHING = {}; - + private static final String KOTLIN_JS_LIBRARY = "jslib-example"; + private static final String PATH_TO_KOTLIN_JS_LIBRARY = TEST_DATA_PATH + "general/KotlinJavaScriptProjectWithDirectoryAsLibrary/" + KOTLIN_JS_LIBRARY; + private static final String KOTLIN_JS_LIBRARY_JAR = KOTLIN_JS_LIBRARY + ".jar"; + private static final Set EXPECTED_JS_FILES_IN_OUTPUT_FOR_STDLIB_ONLY = KotlinPackage.hashSetOf(PROJECT_NAME + ".js", "lib/kotlin.js"); + private static final Set EXPECTED_JS_FILES_IN_OUTPUT_NO_COPY = KotlinPackage.hashSetOf(PROJECT_NAME + ".js"); + private static final Set EXPECTED_JS_FILES_IN_OUTPUT_WITH_ADDITIONAL_LIB_AND_DEFAULT_DIR = + KotlinPackage.hashSetOf( + PROJECT_NAME + ".js", + "lib/kotlin.js", + "lib/jslib-example.js", + "lib/file0.js", + "lib/dir/file1.js", + "lib/META-INF-ex/file2.js", + "lib/res0.js", + "lib/resdir/res1.js"); + private static final Set EXPECTED_JS_FILES_IN_OUTPUT_WITH_ADDITIONAL_LIB_AND_CUSTOM_DIR = + KotlinPackage.hashSetOf( + PROJECT_NAME + ".js", + "custom/kotlin.js", + "custom/jslib-example.js", + "custom/file0.js", + "custom/dir/file1.js", + "custom/META-INF-ex/file2.js", + "custom/res0.js", + "custom/resdir/res1.js"); @Override public void setUp() throws Exception { super.setUp(); @@ -84,12 +112,77 @@ public class KotlinJpsBuildTest extends AbstractKotlinJpsBuildTestCase { makeAll().assertSuccessful(); } + public void doTestWithKotlinJavaScriptLibrary() { + initProject(); + addKotlinJavaScriptStdlibDependency(); + createKotlinJavaScriptLibraryArchive(); + addKotlinJavaScriptDependency(KOTLIN_JS_LIBRARY, new File(workDir, KOTLIN_JS_LIBRARY_JAR)); + makeAll().assertSuccessful(); + } + public void testKotlinProject() { doTest(); checkWhen(touch("src/test1.kt"), null, packageClasses("kotlinProject", "src/test1.kt", "_DefaultPackage")); } + public void testKotlinJavaScriptProject() { + initProject(); + addKotlinJavaScriptStdlibDependency(); + makeAll().assertSuccessful(); + + assertEquals(EXPECTED_JS_FILES_IN_OUTPUT_FOR_STDLIB_ONLY, contentOfOutputDir(PROJECT_NAME)); + checkWhen(touch("src/test1.kt"), null, k2jsOutput(PROJECT_NAME)); + } + + public void testKotlinJavaScriptProjectWithDirectoryAsStdlib() { + initProject(); + File jslibJar = PathUtil.getKotlinPathsForDistDirectory().getJsStdLibJarPath(); + File jslibDir = new File(workDir, "KotlinJavaScript"); + try { + ZipUtil.extract(jslibJar, jslibDir, null); + } + catch (IOException ex) { + throw new IllegalStateException(ex.getMessage()); + } + addKotlinJavaScriptDependency("KotlinJavaScript", jslibDir); + makeAll().assertSuccessful(); + + assertEquals(EXPECTED_JS_FILES_IN_OUTPUT_FOR_STDLIB_ONLY, contentOfOutputDir(PROJECT_NAME)); + checkWhen(touch("src/test1.kt"), null, k2jsOutput(PROJECT_NAME)); + } + + public void testKotlinJavaScriptProjectWithDirectoryAsLibrary() { + initProject(); + addKotlinJavaScriptStdlibDependency(); + addKotlinJavaScriptDependency(KOTLIN_JS_LIBRARY, new File(workDir, KOTLIN_JS_LIBRARY)); + makeAll().assertSuccessful(); + + assertEquals(EXPECTED_JS_FILES_IN_OUTPUT_WITH_ADDITIONAL_LIB_AND_DEFAULT_DIR, contentOfOutputDir(PROJECT_NAME)); + checkWhen(touch("src/test1.kt"), null, k2jsOutput(PROJECT_NAME)); + } + + public void testKotlinJavaScriptProjectWithLibrary() { + doTestWithKotlinJavaScriptLibrary(); + + assertEquals(EXPECTED_JS_FILES_IN_OUTPUT_WITH_ADDITIONAL_LIB_AND_DEFAULT_DIR, contentOfOutputDir(PROJECT_NAME)); + checkWhen(touch("src/test1.kt"), null, k2jsOutput(PROJECT_NAME)); + } + + public void testKotlinJavaScriptProjectWithLibraryCustomOutputDir() { + doTestWithKotlinJavaScriptLibrary(); + + assertEquals(EXPECTED_JS_FILES_IN_OUTPUT_WITH_ADDITIONAL_LIB_AND_CUSTOM_DIR, contentOfOutputDir(PROJECT_NAME)); + checkWhen(touch("src/test1.kt"), null, k2jsOutput(PROJECT_NAME)); + } + + public void testKotlinJavaScriptProjectWithLibraryNoCopy() { + doTestWithKotlinJavaScriptLibrary(); + + assertEquals(EXPECTED_JS_FILES_IN_OUTPUT_NO_COPY, contentOfOutputDir(PROJECT_NAME)); + checkWhen(touch("src/test1.kt"), null, k2jsOutput(PROJECT_NAME)); + } + public void testExcludeFolderInSourceRoot() { doTest(); @@ -276,6 +369,43 @@ public class KotlinJpsBuildTest extends AbstractKotlinJpsBuildTestCase { checkWhen(touch("module2/src/b.kt"), null, packageClasses("module2", "module2/src/b.kt", "test.TestPackage")); } + private void createKotlinJavaScriptLibraryArchive() { + File jarFile = new File(workDir, KOTLIN_JS_LIBRARY_JAR); + try { + ZipOutputStream zip = new ZipOutputStream(new FileOutputStream(jarFile)); + ZipUtil.addDirToZipRecursively(zip, jarFile, new File(PATH_TO_KOTLIN_JS_LIBRARY), "", null, null); + zip.close(); + } + catch (FileNotFoundException ex) { + throw new IllegalStateException(ex.getMessage()); + } + catch (IOException ex) { + throw new IllegalStateException(ex.getMessage()); + } + } + + @NotNull + private static String[] k2jsOutput(String moduleName) { + String outputDir = "out/production/" + moduleName; + String[] result = new String[1]; + result[0] = outputDir + "/" + moduleName + ".js"; + return result; + } + + @NotNull + private Set contentOfOutputDir(String moduleName) { + String outputDir = "out/production/" + moduleName; + File baseDir = new File(workDir, outputDir); + List files = FileUtil.findFilesByMask(Pattern.compile(".*"), baseDir); + Set result = new HashSet(); + for(File file : files) { + String relativePath = FileUtil.getRelativePath(baseDir, file); + assert relativePath != null : "relativePath should not be null"; + result.add(FileUtil.toSystemIndependentName(relativePath)); + } + return result; + } + @NotNull private static Set getMethodsOfClass(@NotNull File classFile) throws IOException { final Set result = new TreeSet(); diff --git a/jps-plugin/testData/general/KotlinJavaScriptProject/kotlinProject.iml b/jps-plugin/testData/general/KotlinJavaScriptProject/kotlinProject.iml new file mode 100644 index 00000000000..a0cbe548242 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProject/kotlinProject.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/jps-plugin/testData/general/KotlinJavaScriptProject/kotlinProject.ipr b/jps-plugin/testData/general/KotlinJavaScriptProject/kotlinProject.ipr new file mode 100644 index 00000000000..90747786771 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProject/kotlinProject.ipr @@ -0,0 +1,14 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/jps-plugin/testData/general/KotlinJavaScriptProject/src/test1.kt b/jps-plugin/testData/general/KotlinJavaScriptProject/src/test1.kt new file mode 100644 index 00000000000..a2c4e958bb5 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProject/src/test1.kt @@ -0,0 +1,3 @@ +fun foo() { + +} \ No newline at end of file diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/LibraryExample.kt b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/LibraryExample.kt new file mode 100644 index 00000000000..28569346084 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/LibraryExample.kt @@ -0,0 +1,8 @@ +package library.sample + +public fun pairAdd(p: Pair): Int = p.first + p.second + +public fun pairMul(p: Pair): Int = p.first * p.second + +public data class IntHolder(val value: Int) + diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/META-INF-ex/file2.js b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/META-INF-ex/file2.js new file mode 100644 index 00000000000..fa48e44e0bd --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/META-INF-ex/file2.js @@ -0,0 +1 @@ +// file2.js \ No newline at end of file diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/META-INF/MANIFEST.MF b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..00281ee90c5 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/META-INF/MANIFEST.MF @@ -0,0 +1,9 @@ +Manifest-Version: 1.0 +Ant-Version: Apache Ant 1.9.1 +Created-By: 1.7.0_72-b14 (Oracle Corporation) +Built-By: JetBrains +Implementation-Vendor: JetBrains +Implementation-Version: snapshot +Specification-Title: Kotlin JavaScript Lib +Kotlin-JS-Module-Name: jslib-example + diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/META-INF/ignored0.js b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/META-INF/ignored0.js new file mode 100644 index 00000000000..909c0013f88 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/META-INF/ignored0.js @@ -0,0 +1 @@ +// ignored0.js \ No newline at end of file diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/META-INF/ignoredDir/ignored1.js b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/META-INF/ignoredDir/ignored1.js new file mode 100644 index 00000000000..3bccb9f3229 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/META-INF/ignoredDir/ignored1.js @@ -0,0 +1 @@ +// ignored1.js \ No newline at end of file diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/META-INF/resources-ex/file4.js b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/META-INF/resources-ex/file4.js new file mode 100644 index 00000000000..198bed92695 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/META-INF/resources-ex/file4.js @@ -0,0 +1 @@ +// file4.js \ No newline at end of file diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/META-INF/resources/res0.js b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/META-INF/resources/res0.js new file mode 100644 index 00000000000..e69df221fdd --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/META-INF/resources/res0.js @@ -0,0 +1 @@ +// res0.js \ No newline at end of file diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/META-INF/resources/resdir/res1.js b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/META-INF/resources/resdir/res1.js new file mode 100644 index 00000000000..feb4eaecdb3 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/META-INF/resources/resdir/res1.js @@ -0,0 +1 @@ +// res1.js \ No newline at end of file diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/ReadMe.md b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/ReadMe.md new file mode 100644 index 00000000000..6c269930b08 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/ReadMe.md @@ -0,0 +1,6 @@ +# jslib-example + +Path to sources: compiler/integration-tests/testData/ant/js/simpleWithStdlibAndFolderAsAnotherLib/jslib-example + +The archive compiler/integration-tests/testData/ant/js/simpleWithStdlibAndAnotherLib/jslib-example.jar should be updated after +changing some files in source folder. \ No newline at end of file diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/dir/file1.js b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/dir/file1.js new file mode 100644 index 00000000000..4b868025b44 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/dir/file1.js @@ -0,0 +1 @@ +// file1.js \ No newline at end of file diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/file0.js b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/file0.js new file mode 100644 index 00000000000..a269fd47e90 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/file0.js @@ -0,0 +1 @@ +// file0.js \ No newline at end of file diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/jslib-example.js b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/jslib-example.js new file mode 100644 index 00000000000..8fb2ce81d48 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/jslib-example/jslib-example.js @@ -0,0 +1,37 @@ +(function (Kotlin) { + 'use strict'; + var _ = Kotlin.defineRootPackage(null, /** @lends _ */ { + library: Kotlin.definePackage(null, /** @lends _.library */ { + sample: Kotlin.definePackage(null, /** @lends _.library.sample */ { + pairAdd_bunuun$: function (p) { + return p.first + p.second; + }, + pairMul_bunuun$: function (p) { + return p.first * p.second; + }, + IntHolder: Kotlin.createClass(null, function (value) { + this.value = value; + }, /** @lends _.library.sample.IntHolder.prototype */ { + component1: function () { + return this.value; + }, + copy_za3lpa$: function (value) { + return new _.library.sample.IntHolder(value === void 0 ? this.value : value); + }, + toString: function () { + return 'IntHolder(value=' + Kotlin.toString(this.value) + ')'; + }, + hashCode: function () { + var result = 0; + result = result * 31 + Kotlin.hashCode(this.value) | 0; + return result; + }, + equals_za3rmp$: function (other) { + return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && Kotlin.equals(this.value, other.value))); + } + }) + }) + }) + }); + Kotlin.defineModule('jslib-example', _); +}(Kotlin)); diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/kotlinProject.iml b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/kotlinProject.iml new file mode 100644 index 00000000000..a0cbe548242 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/kotlinProject.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/kotlinProject.ipr b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/kotlinProject.ipr new file mode 100644 index 00000000000..90747786771 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/kotlinProject.ipr @@ -0,0 +1,14 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/src/test1.kt b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/src/test1.kt new file mode 100644 index 00000000000..ee0be644f22 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsLibrary/src/test1.kt @@ -0,0 +1,7 @@ +import library.sample.pairAdd + +fun foo() { + val p = Pair(10, 20) + val x = pairAdd(p) + println("x=$x") +} \ No newline at end of file diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsStdlib/kotlinProject.iml b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsStdlib/kotlinProject.iml new file mode 100644 index 00000000000..a0cbe548242 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsStdlib/kotlinProject.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsStdlib/kotlinProject.ipr b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsStdlib/kotlinProject.ipr new file mode 100644 index 00000000000..90747786771 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsStdlib/kotlinProject.ipr @@ -0,0 +1,14 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsStdlib/src/test1.kt b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsStdlib/src/test1.kt new file mode 100644 index 00000000000..a2c4e958bb5 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithDirectoryAsStdlib/src/test1.kt @@ -0,0 +1,3 @@ +fun foo() { + +} \ No newline at end of file diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibrary/kotlinProject.iml b/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibrary/kotlinProject.iml new file mode 100644 index 00000000000..a0cbe548242 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibrary/kotlinProject.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibrary/kotlinProject.ipr b/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibrary/kotlinProject.ipr new file mode 100644 index 00000000000..90747786771 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibrary/kotlinProject.ipr @@ -0,0 +1,14 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibrary/src/test1.kt b/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibrary/src/test1.kt new file mode 100644 index 00000000000..ee0be644f22 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibrary/src/test1.kt @@ -0,0 +1,7 @@ +import library.sample.pairAdd + +fun foo() { + val p = Pair(10, 20) + val x = pairAdd(p) + println("x=$x") +} \ No newline at end of file diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibraryCustomOutputDir/kotlinProject.iml b/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibraryCustomOutputDir/kotlinProject.iml new file mode 100644 index 00000000000..a0cbe548242 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibraryCustomOutputDir/kotlinProject.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibraryCustomOutputDir/kotlinProject.ipr b/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibraryCustomOutputDir/kotlinProject.ipr new file mode 100644 index 00000000000..8fed56d0828 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibraryCustomOutputDir/kotlinProject.ipr @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibraryCustomOutputDir/src/test1.kt b/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibraryCustomOutputDir/src/test1.kt new file mode 100644 index 00000000000..ee0be644f22 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibraryCustomOutputDir/src/test1.kt @@ -0,0 +1,7 @@ +import library.sample.pairAdd + +fun foo() { + val p = Pair(10, 20) + val x = pairAdd(p) + println("x=$x") +} \ No newline at end of file diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibraryNoCopy/kotlinProject.iml b/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibraryNoCopy/kotlinProject.iml new file mode 100644 index 00000000000..a0cbe548242 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibraryNoCopy/kotlinProject.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibraryNoCopy/kotlinProject.ipr b/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibraryNoCopy/kotlinProject.ipr new file mode 100644 index 00000000000..12af7dde89a --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibraryNoCopy/kotlinProject.ipr @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibraryNoCopy/src/test1.kt b/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibraryNoCopy/src/test1.kt new file mode 100644 index 00000000000..ee0be644f22 --- /dev/null +++ b/jps-plugin/testData/general/KotlinJavaScriptProjectWithLibraryNoCopy/src/test1.kt @@ -0,0 +1,7 @@ +import library.sample.pairAdd + +fun foo() { + val p = Pair(10, 20) + val x = pairAdd(p) + println("x=$x") +} \ No newline at end of file