Remove module integration-tests, merge into compiler-tests
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[kotlin2js] Compiling [[TestData]/hello.kt] => [[Temp]/out.js]
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,9 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<kotlin2js src="${test.data}/hello.kt" noStdlib="true" output="${temp}/out.js">
|
||||
<compilerarg value="-Xno-inline"/>
|
||||
</kotlin2js>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,13 @@
|
||||
package foo
|
||||
|
||||
inline fun foo(f: () -> Unit) = f()
|
||||
|
||||
var ok = "Fail"
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
foo {
|
||||
ok = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String = ok
|
||||
@@ -0,0 +1,10 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,11 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<kotlin2js src="${test.data}/root1"
|
||||
noStdlib="true"
|
||||
output="${temp}/out.js"
|
||||
outputPrefix="${test.data}/prefix"
|
||||
outputPostfix="${test.data}/postfix" />
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,3 @@
|
||||
/*
|
||||
some postfix
|
||||
*/
|
||||
@@ -0,0 +1,3 @@
|
||||
/*
|
||||
some prefix
|
||||
*/
|
||||
@@ -0,0 +1,3 @@
|
||||
package foo
|
||||
|
||||
fun box(): String = "OK"
|
||||
@@ -0,0 +1,3 @@
|
||||
package bar
|
||||
|
||||
fun bar() {}
|
||||
@@ -0,0 +1,10 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[kotlin2js] Compiling [[TestData]/root1, [TestData]/bar.kt, [TestData]/root2/Foo.kt] => [[Temp]/out.js]
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,14 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<kotlin2js src="${test.data}/root1" noStdlib="true" output="${temp}/out.js" >
|
||||
<src>
|
||||
<pathelement path="${test.data}/bar.kt"/>
|
||||
<fileset dir="${test.data}/root2">
|
||||
<include name="**/*.kt"/>
|
||||
</fileset>
|
||||
</src>
|
||||
</kotlin2js>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,7 @@
|
||||
package foo
|
||||
|
||||
fun box(): String {
|
||||
Foo()
|
||||
bar.bar()
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
function Bar () {}
|
||||
@@ -0,0 +1,3 @@
|
||||
package foo
|
||||
|
||||
class Foo
|
||||
@@ -0,0 +1,13 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
|
||||
ERR:
|
||||
|
||||
BUILD FAILED
|
||||
[TestData]/build.xml:5: "output" should be specified
|
||||
|
||||
Total time: [time]
|
||||
|
||||
Return code: 1
|
||||
@@ -0,0 +1,7 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<kotlin2js src="${test.data}/root1"/>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,13 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
|
||||
ERR:
|
||||
|
||||
BUILD FAILED
|
||||
[TestData]/build.xml:5: "src" should be specified
|
||||
|
||||
Total time: [time]
|
||||
|
||||
Return code: 1
|
||||
@@ -0,0 +1,7 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<kotlin2js output="${temp}/out.js"/>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,10 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,7 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<kotlin2js src="${test.data}/root1" noStdlib="true" output="${temp}/out.js" outputPostfix="${test.data}/postfix" />
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,3 @@
|
||||
/*
|
||||
some postfix
|
||||
*/
|
||||
@@ -0,0 +1,3 @@
|
||||
package foo
|
||||
|
||||
fun box(): String = "OK"
|
||||
@@ -0,0 +1,10 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,7 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<kotlin2js src="${test.data}/root1" noStdlib="true" output="${temp}/out.js" outputPrefix="${test.data}/prefix" />
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,3 @@
|
||||
/*
|
||||
some prefix
|
||||
*/
|
||||
@@ -0,0 +1,3 @@
|
||||
package foo
|
||||
|
||||
fun box(): String = "OK"
|
||||
@@ -0,0 +1,9 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,14 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<target name="build">
|
||||
<java dir="${temp}" fork="true" classname="org.jetbrains.jet.cli.js.K2JSCompiler">
|
||||
<classpath>
|
||||
<pathelement location="${kotlin.lib}/kotlin-compiler.jar"/>
|
||||
<pathelement location="${kotlin.lib}/kotlin-runtime.jar"/>
|
||||
</classpath>
|
||||
<arg value="${test.data}/root1/foo.kt"/>
|
||||
<arg value="-output"/>
|
||||
<arg value="out.js"/>
|
||||
<jvmarg value="-noverify"/>
|
||||
</java>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,3 @@
|
||||
package foo
|
||||
|
||||
fun box(): String = "OK"
|
||||
@@ -0,0 +1,10 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,7 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<kotlin2js src="${test.data}/root1" noStdlib="true" output="${temp}/out.js"/>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,3 @@
|
||||
package foo
|
||||
|
||||
fun box(): String = "OK"
|
||||
@@ -0,0 +1,10 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,7 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" noStdlib="true" main="call"/>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,9 @@
|
||||
package foo
|
||||
|
||||
var ok = "FAIL"
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
ok = "OK"
|
||||
}
|
||||
|
||||
fun box(): String = ok
|
||||
@@ -0,0 +1,10 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,7 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<kotlin2js src="${test.data}/root1" noStdlib="true" output="${temp}/out.js" main="call"/>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,9 @@
|
||||
package foo
|
||||
|
||||
var ok = "FAIL"
|
||||
|
||||
fun main(args: kotlin.Array<kotlin.String>) {
|
||||
ok = "OK"
|
||||
}
|
||||
|
||||
fun box(): String = ok
|
||||
@@ -0,0 +1,10 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,7 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" main="call"/>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,12 @@
|
||||
package foo
|
||||
|
||||
var ok = "FAIL"
|
||||
|
||||
val hello = Pair("Hello", "World")
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
ok = "OK"
|
||||
println(hello.first + " " + hello.second)
|
||||
}
|
||||
|
||||
fun box(): String = ok
|
||||
@@ -0,0 +1,11 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
|
||||
[unzip] Expanding: [TestData]/jslib-example.jar into [Temp]
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,17 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
<property name="library.path" value="${test.data}/jslib-example.jar"/>
|
||||
<target name="build">
|
||||
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" main="call">
|
||||
<library>
|
||||
<pathelement path="${library.path}"/>
|
||||
</library>
|
||||
</kotlin2js>
|
||||
<unzip src="${library.path}" dest="${temp}">
|
||||
<patternset>
|
||||
<include name="*.js"/>
|
||||
<exclude name="META-INF/**"/>
|
||||
</patternset>
|
||||
</unzip>
|
||||
</target>
|
||||
</project>
|
||||
Binary file not shown.
@@ -0,0 +1,14 @@
|
||||
package foo
|
||||
|
||||
import library.sample.*
|
||||
|
||||
var ok = "FAIL"
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val p = Pair(10, 20)
|
||||
val x = pairAdd(p)
|
||||
ok = "OK"
|
||||
println("x=$x")
|
||||
}
|
||||
|
||||
fun box(): String = ok
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
|
||||
[copy] Copying 1 file to [Temp]
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,17 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
<property name="library.path" value="${test.data}/jslib-example"/>
|
||||
<target name="build">
|
||||
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" main="call">
|
||||
<library>
|
||||
<pathelement path="${library.path}"/>
|
||||
</library>
|
||||
</kotlin2js>
|
||||
<copy todir="${temp}">
|
||||
<fileset dir="${library.path}">
|
||||
<include name="**/*.js"/>
|
||||
<exclude name="META-INF/**"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
</project>
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package library.sample
|
||||
|
||||
public fun pairAdd(p: Pair<Int, Int>): Int = p.first + p.second
|
||||
|
||||
public fun pairMul(p: Pair<Int, Int>): Int = p.first * p.second
|
||||
|
||||
public data class IntHolder(val value: Int)
|
||||
|
||||
+9
@@ -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
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
# jslib-example
|
||||
|
||||
Path to sources: compiler/testData/integration/ant/js/simpleWithStdlibAndFolderAsAnotherLib/jslib-example
|
||||
|
||||
The archive compiler/testData/integration/ant/js/simpleWithStdlibAndAnotherLib/jslib-example.jar should be updated after
|
||||
changing some files in source folder.
|
||||
+37
@@ -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));
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package foo
|
||||
|
||||
import library.sample.*
|
||||
|
||||
var ok = "FAIL"
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val p = Pair(10, 20)
|
||||
val x = pairAdd(p)
|
||||
ok = "OK"
|
||||
println("x=$x")
|
||||
}
|
||||
|
||||
fun box(): String = ok
|
||||
@@ -0,0 +1,10 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,7 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<kotlin2js src="${test.data}/root1" noStdlib="true" output="${temp}/out.js" main="call"/>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,9 @@
|
||||
package foo
|
||||
|
||||
var ok = "FAIL"
|
||||
|
||||
fun main(vararg args: kotlin.String) {
|
||||
ok = "OK"
|
||||
}
|
||||
|
||||
fun box(): String = ok
|
||||
@@ -0,0 +1,10 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,7 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<kotlin2js src="${test.data}/root1" noStdlib="true" output="${temp}/out.js" sourcemap="true"/>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,3 @@
|
||||
package foo
|
||||
|
||||
fun box(): String = "OK"
|
||||
@@ -0,0 +1,10 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,7 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" nowarn="true"/>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,14 @@
|
||||
package foo
|
||||
|
||||
import kotlin.Any
|
||||
import kotlin.Any
|
||||
|
||||
fun foo(p: Int??) {
|
||||
|
||||
}
|
||||
|
||||
trait T {
|
||||
abstract fun foo()
|
||||
}
|
||||
|
||||
fun box(): String = "OK"
|
||||
@@ -0,0 +1,15 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
|
||||
[kotlin2js] LOGGING: Compiling source files: [TestData]/root1/foo.kt
|
||||
[kotlin2js] OUTPUT: Output:
|
||||
[kotlin2js] [Temp]/out.js
|
||||
[kotlin2js] Sources:
|
||||
[kotlin2js] [TestData]/root1/foo.kt
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,7 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" noStdlib="true" verbose="true"/>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,3 @@
|
||||
package foo
|
||||
|
||||
fun box(): String = "OK"
|
||||
@@ -0,0 +1,11 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
|
||||
[kotlin2js] INFO: Kotlin Compiler version [KotlinVersion]
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,7 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" noStdlib="true" printVersion="true"/>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,3 @@
|
||||
package foo
|
||||
|
||||
fun box(): String = "OK"
|
||||
@@ -0,0 +1,10 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[kotlinc] Compiling [[TestData]/hello.kt] => [[Temp]/hello.jar]
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,11 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<kotlinc src="${test.data}/hello.kt" output="${temp}/hello.jar">
|
||||
<compilerarg value="-Xno-inline"/>
|
||||
<compilerarg line="-Xno-call-assertions -Xno-param-assertions"/>
|
||||
<compilerarg value="-Xno-optimize"/>
|
||||
</kotlinc>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,7 @@
|
||||
package hello
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
for (s in listOf("a")) {
|
||||
println("Hello, $s!")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
OUT:
|
||||
Hello, a!
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,14 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[mkdir] Created dir: [Temp]/classes
|
||||
[javac] Compiling 1 source file to [Temp]/classes
|
||||
[javac] Compiling [[TestData]/root1] => [[Temp]/classes]
|
||||
[javac] Running javac...
|
||||
[jar] Building jar: [Temp]/hello.jar
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,23 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
|
||||
<path id="classpath">
|
||||
<fileset dir="${idea.sdk}/lib" includes="annotations.jar"/>
|
||||
<fileset dir="${kotlin.home}" includes="kotlin-runtime.jar"/>
|
||||
</path>
|
||||
|
||||
<typedef name = "withKotlin" classname = "org.jetbrains.jet.buildtools.ant.KotlinCompilerAdapter"/>
|
||||
|
||||
<target name="build">
|
||||
<delete dir="${temp}/classes" failonerror="false"/>
|
||||
<mkdir dir="${temp}/classes"/>
|
||||
<javac destdir="${temp}/classes" includeAntRuntime="false" srcdir="${test.data}/root1">
|
||||
<classpath refid="classpath"/>
|
||||
<withKotlin externalannotations="${test.data}/root1/b/">
|
||||
<externalannotations path="${test.data}/root1/a/" />
|
||||
</withKotlin>
|
||||
</javac>
|
||||
<jar destfile="${temp}/hello.jar">
|
||||
<fileset dir="${temp}/classes"/>
|
||||
</jar>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,5 @@
|
||||
OUT:
|
||||
Hello, a!
|
||||
Java Hello
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,5 @@
|
||||
<root>
|
||||
<item name='j.Java java.lang.String f()'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
</root>
|
||||
@@ -0,0 +1,5 @@
|
||||
<root>
|
||||
<item name='j.Java java.lang.String f2()'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
</root>
|
||||
@@ -0,0 +1,9 @@
|
||||
package hello
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
for (s in arrayList("a"))
|
||||
println("Hello, $s!")
|
||||
val java: String = j.Java().f()
|
||||
val hello: String = j.Java().f2()
|
||||
println("$java $hello")
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package j;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.lang.String;
|
||||
import java.lang.System;
|
||||
|
||||
public class Java {
|
||||
public String f() {
|
||||
return "Java";
|
||||
}
|
||||
|
||||
public String f2() {
|
||||
return "Hello";
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
hello.HelloPackage.main(new String[] {});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[kotlinc] Compiling [[TestData]/hello.kt] => [[Temp]/hello.jar]
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,7 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<kotlinc src="${test.data}/hello.kt" output="${temp}/hello.jar"/>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,7 @@
|
||||
package hello
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
for (s in arrayList("a"))
|
||||
println("Hello, $s!")
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
OUT:
|
||||
Hello, a!
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,14 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[mkdir] Created dir: [Temp]/classes
|
||||
[javac] Compiling 1 source file to [Temp]/classes
|
||||
[javac] Compiling [[TestData]/root1] => [[Temp]/classes]
|
||||
[javac] Running javac...
|
||||
[jar] Building jar: [Temp]/hello.jar
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,18 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
|
||||
<path id="classpath">
|
||||
<fileset dir="${kotlin.home}" includes="kotlin-runtime.jar"/>
|
||||
</path>
|
||||
|
||||
<target name="build">
|
||||
<delete dir="${temp}/classes" failonerror="false"/>
|
||||
<mkdir dir="${temp}/classes"/>
|
||||
<javac destdir="${temp}/classes" includeantruntime="false" compiler="org.jetbrains.jet.buildtools.ant.KotlinCompilerAdapter">
|
||||
<src path="${test.data}/root1"/>
|
||||
<classpath refid="classpath"/>
|
||||
</javac>
|
||||
<jar destfile="${temp}/hello.jar">
|
||||
<fileset dir="${temp}/classes"/>
|
||||
</jar>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,5 @@
|
||||
OUT:
|
||||
Hello, a!
|
||||
Java
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,7 @@
|
||||
package hello
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
for (s in arrayList("a"))
|
||||
println("Hello, $s!")
|
||||
j.Java().f();
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package j;
|
||||
|
||||
import java.lang.String;
|
||||
import java.lang.System;
|
||||
|
||||
public class Java {
|
||||
public void f() {
|
||||
System.out.println("Java");
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
hello.HelloPackage.main(new String[] {});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[kotlinc] Compiling [[TestData]/hello.kt] => [[Temp]/hello.jar]
|
||||
[kotlinc] WARNING: [TestData]/hello.kt: (15, 9) Variable 'result' is never used
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,7 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<kotlinc src="${test.data}/hello.kt" output="${temp}/hello.jar"/>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,18 @@
|
||||
package hello
|
||||
|
||||
import sun.nio.cs.ext.Big5
|
||||
import sun.net.spi.nameservice.dns.DNSNameService
|
||||
import javax.crypto.Cipher
|
||||
import com.sun.crypto.provider.SunJCE
|
||||
import sun.nio.ByteBuffered
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
val a = Big5() // charsets.jar
|
||||
val c = DNSNameService() // dnsns.ajr
|
||||
val e : Cipher? = null // jce.jar
|
||||
val f : SunJCE? = null // sunjce_provider.jar
|
||||
val j : ByteBuffered? = null // rt.jar
|
||||
val result = "$a$c$e$f$j"
|
||||
println("OK")
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
OUT:
|
||||
OK
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,13 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[mkdir] Created dir: [Temp]/classes
|
||||
[kotlinc] Compiling [[TestData]/root1] => [[Temp]/classes]
|
||||
[javac] Compiling 1 source file to [Temp]/classes
|
||||
[jar] Building jar: [Temp]/hello.jar
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,24 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
|
||||
<path id="classpath">
|
||||
<fileset dir="${idea.sdk}/lib" includes="annotations.jar"/>
|
||||
<fileset dir="${kotlin.home}" includes="kotlin-runtime.jar"/>
|
||||
</path>
|
||||
|
||||
<taskdef name = "kotlinc" classname = "org.jetbrains.jet.buildtools.ant.Kotlin2JvmTask"/>
|
||||
|
||||
<target name="build">
|
||||
<delete dir="${temp}/classes" failonerror="false"/>
|
||||
<mkdir dir="${temp}/classes"/>
|
||||
<kotlinc output="${temp}/classes" src="${test.data}/root1" externalannotations="${test.data}/root1/b/">
|
||||
<classpath refid="classpath"/>
|
||||
<externalannotations path="${test.data}/root1/a/" />
|
||||
</kotlinc>
|
||||
<javac destdir="${temp}/classes" includeAntRuntime="false" srcdir="${test.data}/root1">
|
||||
<classpath refid="classpath"/>
|
||||
</javac>
|
||||
<jar destfile="${temp}/hello.jar">
|
||||
<fileset dir="${temp}/classes"/>
|
||||
</jar>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,5 @@
|
||||
OUT:
|
||||
Hello, a!
|
||||
Java Hello
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,5 @@
|
||||
<root>
|
||||
<item name='j.Java java.lang.String f()'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
</root>
|
||||
@@ -0,0 +1,5 @@
|
||||
<root>
|
||||
<item name='j.Java java.lang.String f2()'>
|
||||
<annotation name='org.jetbrains.annotations.NotNull'/>
|
||||
</item>
|
||||
</root>
|
||||
@@ -0,0 +1,9 @@
|
||||
package hello
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
for (s in arrayList("a"))
|
||||
println("Hello, $s!")
|
||||
val java: String = j.Java().f()
|
||||
val hello: String = j.Java().f2()
|
||||
println("$java $hello")
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package j;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.lang.String;
|
||||
import java.lang.System;
|
||||
|
||||
public class Java {
|
||||
public String f() {
|
||||
return "Java";
|
||||
}
|
||||
|
||||
public String f2() {
|
||||
return "Hello";
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
hello.HelloPackage.main(new String[] {});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[kotlinc] Compiling [[TestData]/root1, [TestData]/root2] => [[Temp]/hello.jar]
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,10 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<kotlinc output="${temp}/hello.jar">
|
||||
<src path="${test.data}/root1"/>
|
||||
<src path="${test.data}/root2"/>
|
||||
</kotlinc>
|
||||
</target>
|
||||
</project>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user