From 4633113b553733c46656efb6f69ece7ed8093441 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Tue, 24 Sep 2024 20:26:40 +0200 Subject: [PATCH] Fixed Configuration Cache issues related to the `intellijPlatform.buildSearchableOptions` flag --- CHANGELOG.md | 2 ++ .../platform/gradle/tasks/BuildSearchableOptionsTask.kt | 7 +++---- .../platform/gradle/tasks/JarSearchableOptionsTask.kt | 9 ++------- .../gradle/tasks/PrepareJarSearchableOptionsTask.kt | 8 ++------ 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69b868f87d..42869528bc 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Introduce caching when creating dependencies ### Changed + - Add IntelliJ Platform v2 product modules to the test classpath - Invalidate local dependency artifacts XML files running @@ -25,6 +26,7 @@ - Duplicate bundled template error in tests [#1755](../../issues/1755) - Fixed IDE problem when submodule jars appear as External Libraries - Fixed `java.util.ConcurrentModificationException` on Gradle sync caused by the `pluginVerification` configuration [#1714](../../issues/1714) +- Fixed Configuration Cache issues related to the `intellijPlatform.buildSearchableOptions` flag ## [2.0.1] - 2024-08-08 diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildSearchableOptionsTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildSearchableOptionsTask.kt index 0ca820ea87..0340e73362 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildSearchableOptionsTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/BuildSearchableOptionsTask.kt @@ -83,11 +83,10 @@ abstract class BuildSearchableOptionsTask : JavaExec(), RunnableIdeAware { companion object : Registrable { override fun register(project: Project) = project.registerTask(Tasks.BUILD_SEARCHABLE_OPTIONS) { + val buildSearchableOptionsEnabledProvider = project.extensionProvider.flatMap { it.buildSearchableOptions } val prepareSandboxTaskProvider = project.tasks.named(Tasks.PREPARE_SANDBOX) applySandboxFrom(prepareSandboxTaskProvider) - val buildSearchableOptionsEnabled = project.extensionProvider.flatMap { it.buildSearchableOptions } - outputDirectory.convention( project.layout.dir(project.provider { temporaryDir @@ -101,10 +100,10 @@ abstract class BuildSearchableOptionsTask : JavaExec(), RunnableIdeAware { systemPropertyDefault("idea.l10n.keys", "only") - inputs.property("intellijPlatform.buildSearchableOptions", buildSearchableOptionsEnabled) + inputs.property("intellijPlatform.buildSearchableOptions", buildSearchableOptionsEnabledProvider) onlyIf { - buildSearchableOptionsEnabled.get() + buildSearchableOptionsEnabledProvider.get() } } } diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/JarSearchableOptionsTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/JarSearchableOptionsTask.kt index f4f9251ad5..c8bb47d0ef 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/JarSearchableOptionsTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/JarSearchableOptionsTask.kt @@ -66,12 +66,7 @@ abstract class JarSearchableOptionsTask : Jar() { override fun register(project: Project) = project.registerTask(Tasks.JAR_SEARCHABLE_OPTIONS) { val prepareJarSearchableOptionsTask = project.tasks.named(Tasks.PREPARE_JAR_SEARCHABLE_OPTIONS) - val buildSearchableOptionsTaskProvider = project.tasks.named(Tasks.BUILD_SEARCHABLE_OPTIONS) - val buildSearchableOptionsEnabled = project.extensionProvider - .flatMap { it.buildSearchableOptions } - .zip(buildSearchableOptionsTaskProvider) { enabled, task -> - enabled && task.enabled - } + val buildSearchableOptionsEnabledProvider = project.extensionProvider.flatMap { it.buildSearchableOptions } val runtimeElementsConfiguration = project.configurations[Configurations.External.RUNTIME_ELEMENTS] archiveClassifier.convention("searchableOptions") @@ -81,7 +76,7 @@ abstract class JarSearchableOptionsTask : Jar() { from(prepareJarSearchableOptionsTask) onlyIf { - buildSearchableOptionsEnabled.get() + buildSearchableOptionsEnabledProvider.get() } project.artifacts.add(runtimeElementsConfiguration.name, archiveFile) diff --git a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareJarSearchableOptionsTask.kt b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareJarSearchableOptionsTask.kt index 1f5d0eb0b6..538a8032b1 100644 --- a/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareJarSearchableOptionsTask.kt +++ b/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareJarSearchableOptionsTask.kt @@ -106,11 +106,7 @@ abstract class PrepareJarSearchableOptionsTask @Inject constructor( override fun register(project: Project) = project.registerTask(Tasks.PREPARE_JAR_SEARCHABLE_OPTIONS) { val buildSearchableOptionsTaskProvider = project.tasks.named(Tasks.BUILD_SEARCHABLE_OPTIONS) - val buildSearchableOptionsEnabled = project.extensionProvider - .flatMap { it.buildSearchableOptions } - .zip(buildSearchableOptionsTaskProvider) { enabled, task -> - enabled && task.enabled - } + val buildSearchableOptionsEnabledProvider = project.extensionProvider.flatMap { it.buildSearchableOptions } val composedJarTaskProvider = project.tasks.named(Tasks.COMPOSED_JAR) val prepareSandboxTaskProvider = project.tasks.named(Tasks.PREPARE_SANDBOX) @@ -124,7 +120,7 @@ abstract class PrepareJarSearchableOptionsTask @Inject constructor( ) onlyIf { - buildSearchableOptionsEnabled.get() + buildSearchableOptionsEnabledProvider.get() } } }