[K/N][build] Use Map for cached libraries
This commit is contained in:
@@ -77,7 +77,9 @@ targetList.each { target ->
|
||||
cacheRoot = library.project.file("build/cache/$target").path
|
||||
compilerDistributionPath.set(distDir)
|
||||
// TODO: should depend on stdlib producer task and its properties
|
||||
cachedLibrary = "${dist}/klib/common/stdlib,${dist}/klib/cache/${target}-gSTATIC/stdlib-cache"
|
||||
def clibs = [:]
|
||||
clibs.put(project.file("$dist/klib/common/stdlib"), project.file("$dist/klib/cache/${target}-gSTATIC/stdlib-cache"))
|
||||
cachedLibraries = clibs
|
||||
|
||||
dependsOn "$library.projectName:${target}${library.taskName}"
|
||||
dependsOn ":kotlin-native:${target}CrossDistRuntime"
|
||||
|
||||
+2
-3
@@ -49,8 +49,7 @@ open class KonanCacheTask: DefaultTask() {
|
||||
}
|
||||
|
||||
@get:Input
|
||||
@get:Optional
|
||||
var cachedLibrary: String? = null
|
||||
var cachedLibraries: Map<File, File> = emptyMap()
|
||||
|
||||
@TaskAction
|
||||
fun compile() {
|
||||
@@ -70,7 +69,7 @@ open class KonanCacheTask: DefaultTask() {
|
||||
"-produce", cacheKind.outputKind.name.toLowerCase(),
|
||||
"-Xadd-cache=${originalKlib.absolutePath}",
|
||||
"-Xcache-directory=${cacheDirectory.absolutePath}"
|
||||
) + additionalCacheFlags + (cachedLibrary?.let { "-Xcached-library=$it" } ?: "")
|
||||
) + additionalCacheFlags + cachedLibraries.map { "-Xcached-library=${it.key},${it.value}" }
|
||||
KonanCompilerRunner(project, konanHome = konanHome).run(args)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user