Build: Make JavaExec relative path system independent

This commit is contained in:
Vyacheslav Gerasimov
2020-02-05 20:58:36 +03:00
parent 08ac7da7a6
commit a4030d3abf
3 changed files with 9 additions and 10 deletions
+4 -7
View File
@@ -174,9 +174,6 @@ fun JavaExec.buildKLib(
outDir: File,
commonSources: List<File>
) {
fun File.pathRelativeToWorkingDir(): String = absoluteFile.relativeTo(workingDir).path
inputs.files(sources)
.withPathSensitivity(PathSensitivity.RELATIVE)
@@ -186,10 +183,10 @@ fun JavaExec.buildKLib(
classpath = jsIrKlibCli
main = "org.jetbrains.kotlin.ir.backend.js.GenerateJsIrKlibKt"
workingDir = rootDir
args = sources.map { it.pathRelativeToWorkingDir() } +
listOf("-n", moduleName, "-o", outDir.pathRelativeToWorkingDir()) +
dependencies.flatMap { listOf("-d", it.pathRelativeToWorkingDir()) } +
commonSources.flatMap { listOf("-c", it.pathRelativeToWorkingDir()) }
args = sources.map(::pathRelativeToWorkingDir) +
listOf("-n", moduleName, "-o", pathRelativeToWorkingDir(outDir)) +
dependencies.flatMap { listOf("-d", pathRelativeToWorkingDir(it)) } +
commonSources.flatMap { listOf("-c", pathRelativeToWorkingDir(it)) }
dependsOn(":compiler:cli-js-klib:jar")
passClasspathInJar()