[JS Gradle] Pass incremental cache root dir to K2JS compiler
This commit is contained in:
committed by
Space Team
parent
693258ae91
commit
9dab8637a8
+3
-3
@@ -252,11 +252,11 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
|
||||
var includes: String? by NullableStringFreezableVar(null)
|
||||
|
||||
@Argument(
|
||||
value = "-Xcache-directories",
|
||||
value = "-Xcache-directory",
|
||||
valueDescription = "<path>",
|
||||
description = "A path to cache directories"
|
||||
description = "A path to cache directory"
|
||||
)
|
||||
var cacheDirectories: String? by NullableStringFreezableVar(null)
|
||||
var cacheDirectory: String? by NullableStringFreezableVar(null)
|
||||
|
||||
@Argument(value = "-Xir-build-cache", description = "Use compiler to build cache")
|
||||
var irBuildCache: Boolean by FreezableVar(false)
|
||||
|
||||
@@ -295,7 +295,7 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
|
||||
|
||||
if (arguments.irProduceJs) {
|
||||
messageCollector.report(INFO, "Produce executable: $outputDirPath")
|
||||
messageCollector.report(INFO, arguments.cacheDirectories ?: "")
|
||||
messageCollector.report(INFO, "Cache directory: ${arguments.cacheDirectory}")
|
||||
|
||||
if (icCaches.isNotEmpty()) {
|
||||
val beforeIc2Js = System.currentTimeMillis()
|
||||
@@ -635,14 +635,14 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
|
||||
configurationJs: CompilerConfiguration,
|
||||
mainCallArguments: List<String>?
|
||||
): List<ModuleArtifact> {
|
||||
val cacheDirectories = configureLibraries(arguments.cacheDirectories)
|
||||
val cacheDirectory = arguments.cacheDirectory
|
||||
|
||||
// TODO: Use JS IR IC infrastructure for WASM?
|
||||
val icCaches = if (!arguments.wasm && cacheDirectories.isNotEmpty()) {
|
||||
val icCaches = if (!arguments.wasm && cacheDirectory != null) {
|
||||
messageCollector.report(INFO, "")
|
||||
messageCollector.report(INFO, "Building cache:")
|
||||
messageCollector.report(INFO, "to: ${outputDir}")
|
||||
messageCollector.report(INFO, arguments.cacheDirectories ?: "")
|
||||
messageCollector.report(INFO, "to: $outputDir")
|
||||
messageCollector.report(INFO, "cache directory: $cacheDirectory")
|
||||
messageCollector.report(INFO, libraries.toString())
|
||||
|
||||
val start = System.currentTimeMillis()
|
||||
@@ -650,7 +650,7 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
|
||||
val cacheUpdater = CacheUpdater(
|
||||
mainModule = arguments.includes!!,
|
||||
allModules = libraries,
|
||||
cacheDir = cacheDirectories.last(),
|
||||
cacheDir = cacheDirectory,
|
||||
compilerConfiguration = configurationJs,
|
||||
irFactory = { IrFactoryImplForJsIC(WholeWorldStageController()) },
|
||||
mainArguments = mainCallArguments,
|
||||
|
||||
Reference in New Issue
Block a user