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()
|
||||
}
|
||||
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
|
||||
// need to spawn a Kotlin compiler in a separate process. Otherwise, we can just invoke
|
||||
|
@ -113,13 +102,22 @@ class KotlinCompiler @Inject constructor(
|
|||
.filterNotNull()
|
||||
.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 newArgs = listOf(
|
||||
"-classpath", compilerClasspath,
|
||||
K2JVMCompiler::class.java.name,
|
||||
*info.compilerArgs.toTypedArray(),
|
||||
"-classpath", classpath,
|
||||
"-d", info.outputDir.absolutePath,
|
||||
"-d", outputDir,
|
||||
*xFlagsArray,
|
||||
*info.sourceFiles.toTypedArray())
|
||||
.filter { ! it.isEmpty() }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue