[Gradle] commonizeCInterop task: Require hierarchical commonization to be enabled
^KT-47133 Verification Pending
This commit is contained in:
committed by
Space
parent
d781902626
commit
1bcafd3cd0
-7
@@ -143,7 +143,6 @@ internal open class CInteropCommonizerTask : AbstractCInteropCommonizerTask() {
|
||||
return sharedNativeCompilations.mapNotNull(::getCommonizationParameters).toSet()
|
||||
.run(::removeNotRegisteredInterops)
|
||||
.run(::removeEmptyInterops)
|
||||
.run(if (project.isHierarchicalCommonizationEnabled) ::identity else ::removeHierarchicalParameters)
|
||||
.run(::removeRedundantParameters)
|
||||
}
|
||||
|
||||
@@ -207,12 +206,6 @@ private fun removeEmptyInterops(parameters: Set<CInteropCommonizationParameters>
|
||||
return parameters.filterTo(mutableSetOf()) { it.interops.isNotEmpty() }
|
||||
}
|
||||
|
||||
private fun identity(parameters: Set<CInteropCommonizationParameters>) = parameters
|
||||
|
||||
private fun removeHierarchicalParameters(parameters: Set<CInteropCommonizationParameters>): Set<CInteropCommonizationParameters> {
|
||||
return parameters.filterTo(mutableSetOf()) { it.commonizerTarget.level <= 1 }
|
||||
}
|
||||
|
||||
private fun removeRedundantParameters(parameters: Set<CInteropCommonizationParameters>): Set<CInteropCommonizationParameters> {
|
||||
return parameters.filterNotTo(mutableSetOf()) { current ->
|
||||
parameters.any { other ->
|
||||
|
||||
+4
-4
@@ -47,13 +47,12 @@ internal val Project.runCommonizerTask: TaskProvider<Task>
|
||||
|
||||
internal val Project.commonizeCInteropTask: TaskProvider<CInteropCommonizerTask>?
|
||||
get() {
|
||||
if (isCInteropCommonizationEnabled) {
|
||||
if (isHierarchicalCommonizationEnabled && isCInteropCommonizationEnabled) {
|
||||
return locateOrRegisterTask(
|
||||
"commonizeCInterop",
|
||||
invokeWhenRegistered = {
|
||||
commonizeTask.dependsOn(this)
|
||||
commonizeNativeDistributionHierarchicallyTask?.let(this::dependsOn)
|
||||
commonizeNativeDistributionTask?.let(this::dependsOn)
|
||||
},
|
||||
configureTask = {
|
||||
group = "interop"
|
||||
@@ -66,13 +65,14 @@ internal val Project.commonizeCInteropTask: TaskProvider<CInteropCommonizerTask>
|
||||
|
||||
internal val Project.copyCommonizeCInteropForIdeTask: TaskProvider<CopyCommonizeCInteropForIdeTask>?
|
||||
get() {
|
||||
if (isCInteropCommonizationEnabled) {
|
||||
val commonizeCInteropTask = commonizeCInteropTask
|
||||
if (commonizeCInteropTask != null) {
|
||||
return locateOrRegisterTask(
|
||||
"copyCommonizeCInteropForIde",
|
||||
invokeWhenRegistered = { if (isInIdeaSync) commonizeTask.dependsOn(this) },
|
||||
configureTask = {
|
||||
group = "interop"
|
||||
description = "Copies the output of ${commonizeCInteropTask?.get()?.name} into " +
|
||||
description = "Copies the output of ${commonizeCInteropTask.get().name} into " +
|
||||
"the root projects .gradle folder for the IDE"
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user