Skip to content

Commit 68ddf9f

Browse files
committed
Use isPresent with useSagp property and drop the boolean
1 parent 864bda3 commit 68ddf9f

3 files changed

Lines changed: 7 additions & 10 deletions

File tree

sentry-samples/sentry-samples-android/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ or simply open the project in Android Studio and run the `sentry-samples-android
1616
You can also apply the [Sentry Android Gradle Plugin](https://github.com/getsentry/sentry-android-gradle-plugin) (SAGP) when building (not applied by default):
1717

1818
```
19-
./gradlew :sentry-samples:sentry-samples-android:installDebug -PuseSagp=true
19+
./gradlew :sentry-samples:sentry-samples-android:installDebug -PuseSagp
2020
```
2121

22-
In Android Studio, add `useSagp=true` to `gradle.properties` or pass it as a Gradle project property.
22+
In Android Studio, add `useSagp=` (empty value) to `gradle.properties`, or pass `-PuseSagp` as a Gradle project property.
2323

2424
## Build modes
2525

@@ -29,14 +29,14 @@ The sample app can be built with or without the SAGP.
2929

3030
| Gradle Property | Required | Purpose |
3131
|-----------------|--------------------------|----------------------------------------------------------------------------------------------------------------|
32-
| `useSagp` | No (defaults to `false`) | When `true`, apply SAGP when building the sample app. When false or absent, build the sample app without SAGP. |
32+
| `useSagp` | No | When present, apply SAGP when building the sample app. Omit the property to build without SAGP. |
3333

3434
You can configure SAGP properties via the lambda passed to `extensions.configure<SentryPluginExtension>("sentry")` in the sample app's
3535
`build.gradle.kts` file.
3636

3737
### Testing an unpublished SAGP build
3838

39-
`-PuseSagp=true` builds check `mavenLocal()` first when resolving SAGP. To test a local SAGP branch:
39+
`-PuseSagp` builds check `mavenLocal()` first when resolving SAGP. To test a local SAGP branch:
4040

4141
1. In your `sentry-android-gradle-plugin` checkout, temporarily set a unique local version in `plugin-build/gradle.properties` (e.g.
4242
`6.10.0-LOCAL`) and publish to Maven Local:
@@ -52,7 +52,7 @@ Re-run `publishToMavenLocal` after each SAGP change.
5252
Then build from sentry-java:
5353

5454
```
55-
./gradlew :sentry-samples:sentry-samples-android:installDebug -PuseSagp=true
55+
./gradlew :sentry-samples:sentry-samples-android:installDebug -PuseSagp
5656
```
5757

5858
## Viewing SDK output

sentry-samples/sentry-samples-android/build.gradle.kts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ plugins {
1212
alias(libs.plugins.sentry) apply false
1313
}
1414

15-
val useSagp =
16-
providers.gradleProperty("useSagp").map { it.equals("true", ignoreCase = true) }.orElse(false)
17-
18-
if (useSagp.get()) {
15+
if (providers.gradleProperty("useSagp").isPresent) {
1916
apply(plugin = "io.sentry.android.gradle")
2017
}
2118

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
33
pluginManagement {
44
repositories {
55
// Prefer local SAGP artifact if one exists; otherwise fall back to libs.versions.toml.
6-
if (providers.gradleProperty("useSagp").orNull?.equals("true", ignoreCase = true) == true) {
6+
if (providers.gradleProperty("useSagp").isPresent) {
77
mavenLocal {
88
content {
99
includeGroup("io.sentry")

0 commit comments

Comments
 (0)