Skip to content

Commit

Permalink
SandboxAware: inherit sandbox directory from producer
Browse files Browse the repository at this point in the history
  • Loading branch information
hsz committed May 22, 2024
1 parent 37c6b92 commit aeb0303
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- Fixed custom tasks suffixing
- Fixed: Task `:test` uses this output of task `:prepareSandbox` without declaring an explicit or implicit dependency [#1609](../../issues/1609)
- ExtractorTransformer: Exclude only `Applications` symlink
- SandboxAware: inherit sandbox directory from producer

## [2.0.0-beta3] - 2024-05-18

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import org.jetbrains.intellij.platform.gradle.tasks.aware.SplitModeAware.SplitMo
import org.jetbrains.intellij.platform.gradle.toIntelliJPlatformType
import org.jetbrains.intellij.platform.gradle.utils.*
import kotlin.io.path.absolute
import kotlin.io.path.createDirectories

/**
* Registers a task of type [T] with the given names
Expand Down Expand Up @@ -259,9 +258,7 @@ internal fun <T : Task> Project.preconfigureTask(task: T) {
*/
sandboxSuffix.convention(suffix)
sandboxDirectory.convention(extension.sandboxContainer.map { container ->
container
.dir("${productInfo.productCode}-${productInfo.version}")
.apply { asPath.createDirectories() }
container.dir("${productInfo.productCode}-${productInfo.version}")
})
sandboxConfigDirectory.configureSandbox(sandboxDirectory, sandboxSuffix, Sandbox.CONFIG)
sandboxPluginsDirectory.configureSandbox(sandboxDirectory, sandboxSuffix, Sandbox.PLUGINS)
Expand Down Expand Up @@ -290,6 +287,7 @@ internal fun <T : Task> Project.preconfigureTask(task: T) {
val taskSubjectSuffix = "-$taskSubject".lowercase().trimEnd('-') + suffix
task.sandboxSuffix.convention(taskSubjectSuffix)
sandboxSuffix.convention(taskSubjectSuffix)
sandboxDirectory.convention(task.sandboxDirectory)

if (this is CustomIntelliJPlatformVersionAware) {
task.disabledPlugins = the<IntelliJPlatformPluginsExtension>().disabled
Expand Down Expand Up @@ -319,7 +317,6 @@ internal fun <T : Task> Project.preconfigureTask(task: T) {
* However, tasks like [RunnableIdeAware] or [TestableAware] should not share the same sandboxes.
* The same applies to the customized tasks – a custom suffix is added to the task name.
*/

when {
this is SplitModeAware -> {
val backendTask = createTask(SplitModeTarget.BACKEND)
Expand Down Expand Up @@ -493,7 +490,7 @@ internal fun DirectoryProperty.configureSandbox(
name: String,
) {
convention(sandboxContainer.zip(suffixProvider) { container, suffix ->
container.dir(name + suffix.orEmpty()).apply { asPath.createDirectories() }
container.dir(name + suffix)
})
}

Expand Down

0 comments on commit aeb0303

Please sign in to comment.