mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 00:17:11 -07:00
Validate classpath.
This commit is contained in:
parent
c93caf5989
commit
281ae2071b
3 changed files with 13 additions and 1 deletions
|
@ -110,6 +110,14 @@ abstract public class JvmCompilerPlugin @Inject constructor(
|
||||||
lp(project, "No resources to copy for ${sourceSet}")
|
lp(project, "No resources to copy for ${sourceSet}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected fun validateClasspath(cp: List<String>) {
|
||||||
|
cp.forEach {
|
||||||
|
if (! File(it).exists()) {
|
||||||
|
throw KobaltException("Couldn't find $it")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -51,8 +51,10 @@ public class JavaPlugin @Inject constructor(
|
||||||
javac!!.absolutePath,
|
javac!!.absolutePath,
|
||||||
"-d", outputDirectory.absolutePath)
|
"-d", outputDirectory.absolutePath)
|
||||||
if (cpList.size() > 0) {
|
if (cpList.size() > 0) {
|
||||||
|
val stringClasspath = cpList.map { it.jarFile.get().absolutePath }
|
||||||
|
validateClasspath(stringClasspath)
|
||||||
args.add("-classpath")
|
args.add("-classpath")
|
||||||
args.add(cpList.map { it.jarFile.get().absolutePath }.join(File.pathSeparator))
|
args.add(stringClasspath.join(File.pathSeparator))
|
||||||
}
|
}
|
||||||
args.addAll(sourceFiles)
|
args.addAll(sourceFiles)
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,8 @@ class KotlinCompiler @Inject constructor(override val localRepo : LocalRepo,
|
||||||
classpathList.addAll(otherClasspath)
|
classpathList.addAll(otherClasspath)
|
||||||
classpathList.addAll(calculateClasspath(compileDependencies).map { it.id })
|
classpathList.addAll(calculateClasspath(compileDependencies).map { it.id })
|
||||||
|
|
||||||
|
validateClasspath(classpathList)
|
||||||
|
|
||||||
log(2, "Compiling ${source.size()} files with classpath:\n " + classpathList.join("\n "))
|
log(2, "Compiling ${source.size()} files with classpath:\n " + classpathList.join("\n "))
|
||||||
K2JVMCompiler.main(arrayOf(
|
K2JVMCompiler.main(arrayOf(
|
||||||
"-d", output,
|
"-d", output,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue