Support default module name in ant task
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[kotlinc] Compiling [[TestData]/hello.kt] => [[Temp]/hello.jar]
|
||||
[java] Module info 'META-INF/build.kotlin_module' exists
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
@@ -0,0 +1,14 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
|
||||
<target name="build">
|
||||
<kotlinc src="${test.data}/hello.kt" output="${temp}/hello.jar"/>
|
||||
|
||||
<java classname="hello.HelloPackage" fork="true">
|
||||
<classpath>
|
||||
<pathelement location="${temp}/hello.jar"/>
|
||||
<pathelement location="${kotlin.runtime.jar}"/>
|
||||
</classpath>
|
||||
</java>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,11 @@
|
||||
package hello
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
val systemClassLoader = ClassLoader.getSystemClassLoader()
|
||||
val moduleName = "META-INF/build.kotlin_module"
|
||||
val resourceAsStream = systemClassLoader.getResourceAsStream(moduleName)
|
||||
|
||||
if (resourceAsStream != null) {
|
||||
println("Module info '$moduleName' exists")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user