mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 16:28:12 -07:00
Added buildFileClasspat().
This commit is contained in:
parent
c06e92b679
commit
25b97dd21f
4 changed files with 22 additions and 0 deletions
|
@ -121,9 +121,11 @@ public class BuildFileCompiler @Inject constructor(@Assisted("buildFiles") val b
|
|||
log(2, " Need to recompile ${buildFile.name}")
|
||||
|
||||
buildScriptJarFile.delete()
|
||||
val buildFileClasspath = Kobalt.buildFileClasspath.map { it.jarFile.get() }.map { it.absolutePath }
|
||||
val result = kotlinCompilePrivate {
|
||||
classpath(files.kobaltJar)
|
||||
classpath(pluginUrls.map { it.file })
|
||||
classpath(buildFileClasspath)
|
||||
sourceFiles(listOf(buildFile.realPath.toFile().absolutePath))
|
||||
output = buildScriptJarFile
|
||||
}.compile(context = context)
|
||||
|
|
|
@ -22,6 +22,7 @@ class ParsedBuildFile(val buildFile: BuildFile, val context: KobaltContext, val
|
|||
val dependencyManager: DependencyManager, val files: KFiles) {
|
||||
val pluginList = arrayListOf<String>()
|
||||
val repos = arrayListOf<String>()
|
||||
val buildFileClasspath = arrayListOf<String>()
|
||||
val profileLines = arrayListOf<String>()
|
||||
val pluginUrls = arrayListOf<URL>()
|
||||
val projects = arrayListOf<Project>()
|
||||
|
@ -51,6 +52,11 @@ class ParsedBuildFile(val buildFile: BuildFile, val context: KobaltContext, val
|
|||
index = line.indexOf("repos(")
|
||||
if (index >= 0) {
|
||||
current = repos
|
||||
} else {
|
||||
index = line.indexOf("buildFileClasspath(")
|
||||
if (index >= 0) {
|
||||
current = buildFileClasspath
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -91,6 +97,7 @@ class ParsedBuildFile(val buildFile: BuildFile, val context: KobaltContext, val
|
|||
|
||||
repos.forEach { preBuildScript.add(it) }
|
||||
pluginList.forEach { preBuildScript.add(it) }
|
||||
buildFileClasspath.forEach { preBuildScript.add(it) }
|
||||
}
|
||||
|
||||
private fun initPluginUrls() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue