[MPP] Don't check commonizer classpath for UP-TO-DATE mechanism
Using a different commonizer classpath is a very uncommon practice. Checking the classpath for Gradle's UP-TO-DATE mechanism is already misleading, because we are relying on a custom UP-TO-DATE implementation that will not include this classpath anyway. Removing this input is intended to improve commonizer startup time.
This commit is contained in:
committed by
Space
parent
6fc56477bf
commit
146099e92e
+8
-2
@@ -20,8 +20,14 @@ private const val KOTLIN_KLIB_COMMONIZER_EMBEDDABLE = "kotlin-klib-commonizer-em
|
|||||||
* when executing the commonizer (like jvm arguments, running in separate process, etc)
|
* when executing the commonizer (like jvm arguments, running in separate process, etc)
|
||||||
*/
|
*/
|
||||||
internal fun GradleCliCommonizer(project: Project): CliCommonizer {
|
internal fun GradleCliCommonizer(project: Project): CliCommonizer {
|
||||||
|
return GradleCliCommonizer(
|
||||||
|
KotlinNativeCommonizerToolRunner(project)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun GradleCliCommonizer(commonizerToolRunner: KotlinNativeCommonizerToolRunner): CliCommonizer {
|
||||||
return CliCommonizer(CliCommonizer.Executor { arguments ->
|
return CliCommonizer(CliCommonizer.Executor { arguments ->
|
||||||
KotlinNativeCommonizerToolRunner(project).run(arguments)
|
commonizerToolRunner.run(arguments)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,4 +37,4 @@ internal fun Project.registerCommonizerClasspathConfigurationIfNecessary() {
|
|||||||
it.add(project.dependencies.create("$KOTLIN_MODULE_GROUP:$KOTLIN_KLIB_COMMONIZER_EMBEDDABLE:${getKotlinPluginVersion()}"))
|
it.add(project.dependencies.create("$KOTLIN_MODULE_GROUP:$KOTLIN_KLIB_COMMONIZER_EMBEDDABLE:${getKotlinPluginVersion()}"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-13
@@ -33,21 +33,9 @@ internal open class NativeDistributionCommonizerTask : DefaultTask() {
|
|||||||
internal val commonizerTargets: Set<SharedCommonizerTarget>
|
internal val commonizerTargets: Set<SharedCommonizerTarget>
|
||||||
get() = project.getAllCommonizerTargets()
|
get() = project.getAllCommonizerTargets()
|
||||||
|
|
||||||
@get:Internal
|
|
||||||
val outputDirectories: Set<File>
|
|
||||||
get() {
|
|
||||||
val rootOutputDirectory = getRootOutputDirectory()
|
|
||||||
return commonizerTargets.map { target -> resolveCommonizedDirectory(rootOutputDirectory, target) }.toSet()
|
|
||||||
}
|
|
||||||
|
|
||||||
@get:Internal
|
@get:Internal
|
||||||
internal val commonizerRunner = KotlinNativeCommonizerToolRunner(project)
|
internal val commonizerRunner = KotlinNativeCommonizerToolRunner(project)
|
||||||
|
|
||||||
@get:Classpath
|
|
||||||
@Suppress("unused") // Only for up-to-date checker.
|
|
||||||
internal val commonizerClasspath: Set<File>
|
|
||||||
get() = commonizerRunner.classpath
|
|
||||||
|
|
||||||
@get:Input
|
@get:Input
|
||||||
@Suppress("unused") // Only for up-to-date checker.
|
@Suppress("unused") // Only for up-to-date checker.
|
||||||
internal val commonizerJvmArgs: List<String>
|
internal val commonizerJvmArgs: List<String>
|
||||||
@@ -65,7 +53,7 @@ internal open class NativeDistributionCommonizerTask : DefaultTask() {
|
|||||||
|
|
||||||
@TaskAction
|
@TaskAction
|
||||||
protected fun run() {
|
protected fun run() {
|
||||||
NativeDistributionCommonizationCache(project, GradleCliCommonizer(project)).commonizeNativeDistribution(
|
NativeDistributionCommonizationCache(project, GradleCliCommonizer(commonizerRunner)).commonizeNativeDistribution(
|
||||||
konanHome = konanHome,
|
konanHome = konanHome,
|
||||||
outputDirectory = getRootOutputDirectory(),
|
outputDirectory = getRootOutputDirectory(),
|
||||||
outputTargets = project.getAllCommonizerTargets(),
|
outputTargets = project.getAllCommonizerTargets(),
|
||||||
|
|||||||
Reference in New Issue
Block a user