Skip to content

Commit

Permalink
Add composeStabilityConfigurationPath option
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacSweers committed Sep 12, 2024
1 parent c25616d commit 8f6b6dd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 9 additions & 1 deletion slack-plugin/src/main/kotlin/slack/gradle/SlackExtension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,12 @@ constructor(
composeBundleAlias?.let { project.dependencies.add("implementation", it) }
}

if (slackProperties.composeStabilityConfigurationPath.isPresent) {
extension.stabilityConfigurationFile.setDisallowChanges(
slackProperties.composeStabilityConfigurationPath
)
}

// Because the Compose Compiler plugin auto applies common options for us, we need to know
// about those options and _avoid_ setting them a second time
val freeOptions = mutableListOf<String>()
Expand Down Expand Up @@ -978,7 +984,9 @@ constructor(
}

"stabilityConfigurationPath" -> {
extension.stabilityConfigurationFile.set(project.file(v))
error(
"Use the 'sgp.compose.stabilityConfigurationPath' Gradle property to specify a stability configuration path"
)
}

"traceMarkersEnabled" -> {
Expand Down
8 changes: 8 additions & 0 deletions slack-plugin/src/main/kotlin/slack/gradle/SlackProperties.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package slack.gradle
import java.io.File
import java.util.Locale
import org.gradle.api.Project
import org.gradle.api.file.RegularFile
import org.gradle.api.provider.Provider
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import slack.gradle.anvil.AnvilMode
Expand Down Expand Up @@ -167,6 +168,13 @@ internal constructor(
.map { value -> value.split(",").map { it.trim() } }
.orElse(emptyList())

/** Relative path to a Compose stability configuration file from the _root_ project. */
public val composeStabilityConfigurationPath: Provider<RegularFile>
get() =
resolver.providerFor("sgp.compose.stabilityConfigurationPath").map {
project.rootProject.layout.projectDirectory.file(it)
}

/**
* When this property is present, the "internalRelease" build variant will have an application id
* of "com.Slack.prototype", instead of "com.Slack.internal".
Expand Down

0 comments on commit 8f6b6dd

Please sign in to comment.