Ant task: do not include runtime by default if destination is a jar

This commit is contained in:
scaventz
2021-01-14 00:04:48 +08:00
committed by Alexander Udalov
parent b0b7f39c75
commit a13eb4c8e6
6 changed files with 78 additions and 2 deletions
@@ -0,0 +1,14 @@
import java.io.File
import java.util.jar.JarFile
fun main(args: Array<String>) {
val jar = File(args[0])
// if "includeRuntime" is specified to be true
var specifiedBeTrue = args[1].toBoolean()
for (entry in JarFile(jar).entries()) {
if (!specifiedBeTrue && entry.name.startsWith("kotlin/")) {
println("Error: Kotlin runtime is expected to be excluded if the attribute \"includeRuntime\" is not specified to be true")
break;
}
}
}