Skip to content

Commit

Permalink
Fixed Configuration Cache issues related to the `intellijPlatform.bui…
Browse files Browse the repository at this point in the history
…ldSearchableOptions` flag
  • Loading branch information
hsz committed Sep 24, 2024
1 parent bb6e34b commit 4633113
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,10 @@ abstract class BuildSearchableOptionsTask : JavaExec(), RunnableIdeAware {
companion object : Registrable {
override fun register(project: Project) =
project.registerTask<BuildSearchableOptionsTask>(Tasks.BUILD_SEARCHABLE_OPTIONS) {
val buildSearchableOptionsEnabledProvider = project.extensionProvider.flatMap { it.buildSearchableOptions }
val prepareSandboxTaskProvider = project.tasks.named<PrepareSandboxTask>(Tasks.PREPARE_SANDBOX)
applySandboxFrom(prepareSandboxTaskProvider)

val buildSearchableOptionsEnabled = project.extensionProvider.flatMap { it.buildSearchableOptions }

outputDirectory.convention(
project.layout.dir(project.provider {
temporaryDir
Expand All @@ -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()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,7 @@ abstract class JarSearchableOptionsTask : Jar() {
override fun register(project: Project) =
project.registerTask<JarSearchableOptionsTask>(Tasks.JAR_SEARCHABLE_OPTIONS) {
val prepareJarSearchableOptionsTask = project.tasks.named<PrepareJarSearchableOptionsTask>(Tasks.PREPARE_JAR_SEARCHABLE_OPTIONS)
val buildSearchableOptionsTaskProvider = project.tasks.named<BuildSearchableOptionsTask>(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")
Expand All @@ -81,7 +76,7 @@ abstract class JarSearchableOptionsTask : Jar() {
from(prepareJarSearchableOptionsTask)

onlyIf {
buildSearchableOptionsEnabled.get()
buildSearchableOptionsEnabledProvider.get()
}

project.artifacts.add(runtimeElementsConfiguration.name, archiveFile)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,7 @@ abstract class PrepareJarSearchableOptionsTask @Inject constructor(
override fun register(project: Project) =
project.registerTask<PrepareJarSearchableOptionsTask>(Tasks.PREPARE_JAR_SEARCHABLE_OPTIONS) {
val buildSearchableOptionsTaskProvider = project.tasks.named<BuildSearchableOptionsTask>(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<ComposedJarTask>(Tasks.COMPOSED_JAR)
val prepareSandboxTaskProvider = project.tasks.named<PrepareSandboxTask>(Tasks.PREPARE_SANDBOX)

Expand All @@ -124,7 +120,7 @@ abstract class PrepareJarSearchableOptionsTask @Inject constructor(
)

onlyIf {
buildSearchableOptionsEnabled.get()
buildSearchableOptionsEnabledProvider.get()
}
}
}
Expand Down

0 comments on commit 4633113

Please sign in to comment.