Skip to content

Commit 76d00e1

Browse files
committed
Address PR review comments
- Rename enabledFor to enabledVariants for clarity - Add documentation clarifying that global ignore settings have no relation to distribution settings - Keep @experimental annotation for new APIs
1 parent 569a2a2 commit 76d00e1

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

plugin-build/src/main/kotlin/io/sentry/android/gradle/extensions/DistributionExtension.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ import org.jetbrains.annotations.ApiStatus.Experimental
88
@Experimental
99
open class DistributionExtension @Inject constructor(objects: ObjectFactory) {
1010

11-
/** Set of Android build variants that should have build distribution enabled. */
12-
val enabledFor: SetProperty<String> =
11+
/**
12+
* Set of Android build variants that should have distribution enabled.
13+
*
14+
* Note: The global ignore settings (ignoredVariants, ignoredBuildTypes, ignoredFlavors)
15+
* have no relation to distribution and do not affect which variants are enabled here.
16+
*/
17+
val enabledVariants: SetProperty<String> =
1318
objects.setProperty(String::class.java).convention(emptySet())
1419
}

plugin-build/src/test/kotlin/io/sentry/android/gradle/extensions/DistributionExtensionTest.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ import org.junit.Test
88
class DistributionExtensionTest {
99

1010
@Test
11-
fun `enabledFor is empty by default`() {
11+
fun `enabledVariants is empty by default`() {
1212
val project = ProjectBuilder.builder().build()
1313
val extension = project.objects.newInstance(DistributionExtension::class.java)
1414

15-
assertTrue(extension.enabledFor.get().isEmpty())
15+
assertTrue(extension.enabledVariants.get().isEmpty())
1616
}
1717

1818
@Test
19-
fun `enabledFor can be configured with variant names`() {
19+
fun `enabledVariants can be configured with variant names`() {
2020
val project = ProjectBuilder.builder().build()
2121
val extension = project.objects.newInstance(DistributionExtension::class.java)
2222

23-
extension.enabledFor.set(setOf("freeDebug", "paidRelease"))
23+
extension.enabledVariants.set(setOf("freeDebug", "paidRelease"))
2424

25-
assertEquals(setOf("freeDebug", "paidRelease"), extension.enabledFor.get())
25+
assertEquals(setOf("freeDebug", "paidRelease"), extension.enabledVariants.get())
2626
}
2727
}

0 commit comments

Comments
 (0)