mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-25 07:57:12 -07:00
Fix project directory.
This commit is contained in:
parent
a6097dc136
commit
7827aeeb43
1 changed files with 10 additions and 12 deletions
|
@ -74,17 +74,6 @@ class KotlinCompiler @Inject constructor(
|
||||||
File(outputDir).parentFile.mkdirs()
|
File(outputDir).parentFile.mkdirs()
|
||||||
}
|
}
|
||||||
val classpath = cp.joinToString(File.pathSeparator)
|
val classpath = cp.joinToString(File.pathSeparator)
|
||||||
val allArgs = arrayListOf(
|
|
||||||
"-d", outputDir,
|
|
||||||
"-classpath", classpath,
|
|
||||||
*(info.compilerArgs.toTypedArray()),
|
|
||||||
*(info.sourceFiles.toTypedArray())
|
|
||||||
)
|
|
||||||
|
|
||||||
// Get rid of annoying and useless warning
|
|
||||||
if (! info.compilerArgs.contains("-no-stdlib")) {
|
|
||||||
allArgs.add("-no-stdlib")
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the Kotlin compiler version in settings.xml is different from the default, we
|
// If the Kotlin compiler version in settings.xml is different from the default, we
|
||||||
// need to spawn a Kotlin compiler in a separate process. Otherwise, we can just invoke
|
// need to spawn a Kotlin compiler in a separate process. Otherwise, we can just invoke
|
||||||
|
@ -113,13 +102,22 @@ class KotlinCompiler @Inject constructor(
|
||||||
.filterNotNull()
|
.filterNotNull()
|
||||||
.joinToString(" ")
|
.joinToString(" ")
|
||||||
|
|
||||||
|
val infoDir = info.directory
|
||||||
|
|
||||||
|
val outputDir =
|
||||||
|
if (infoDir != null) {
|
||||||
|
KFiles.joinDir(infoDir, info.outputDir.path)
|
||||||
|
} else {
|
||||||
|
info.outputDir.path
|
||||||
|
}
|
||||||
|
|
||||||
val xFlagsArray = xFlagsString.split(" ").toTypedArray()
|
val xFlagsArray = xFlagsString.split(" ").toTypedArray()
|
||||||
val newArgs = listOf(
|
val newArgs = listOf(
|
||||||
"-classpath", compilerClasspath,
|
"-classpath", compilerClasspath,
|
||||||
K2JVMCompiler::class.java.name,
|
K2JVMCompiler::class.java.name,
|
||||||
*info.compilerArgs.toTypedArray(),
|
*info.compilerArgs.toTypedArray(),
|
||||||
"-classpath", classpath,
|
"-classpath", classpath,
|
||||||
"-d", info.outputDir.absolutePath,
|
"-d", outputDir,
|
||||||
*xFlagsArray,
|
*xFlagsArray,
|
||||||
*info.sourceFiles.toTypedArray())
|
*info.sourceFiles.toTypedArray())
|
||||||
.filter { ! it.isEmpty() }
|
.filter { ! it.isEmpty() }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue