Skip to content

Commit

Permalink
Remove unnecessary Compose flag for instrumentation projects
Browse files Browse the repository at this point in the history
  • Loading branch information
mannodermaus committed Apr 28, 2023
1 parent 1a284c7 commit 0e12e54
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions instrumentation/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,28 +1,7 @@
rootProject.name = "android-junit5-instrumentation"
includeBuild("../build-logic")
include(":core")
include(":compose")
include(":runner")
include(":sample")
include(":testutil")

// Include the Compose library module only if a special flag is available.
// The 'junit5.includeCompose' flag must be present in either of the following places:
// 1) Project properties (i.e. "-Pxyz")
// 2) local.properties
val flagName = "junit5.includeCompose"

val includeCompose = run {
if (gradle.startParameter.projectProperties[flagName]?.toBoolean() == true) {
// 1)
true
} else {
// 2)
java.util.Properties().apply {
File(rootProject.projectDir, "local.properties").also { load(it.inputStream() )}
}.getProperty(flagName, null)?.toBoolean() == true
}
}

if (includeCompose) {
include(":compose")
}

0 comments on commit 0e12e54

Please sign in to comment.