Skip to content

Commit b30dab4

Browse files
authored
Allow users to provide a custom in the Sentry Gradle Plugin. (#638)
1 parent c58cbde commit b30dab4

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

CHANGES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Version 1.7.15
22
--------------
33

4-
-
4+
- Allow users to provide a custom `manifestPath` in the Sentry Gradle Plugin.
55

66
Version 1.7.14
77
--------------

sentry-android-gradle-plugin/src/main/groovy/io/sentry/android/gradle/SentryPlugin.groovy

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -146,21 +146,23 @@ class SentryPlugin implements Plugin<Project> {
146146

147147
project.android.applicationVariants.all { ApplicationVariant variant ->
148148
variant.outputs.each { variantOutput ->
149-
def manifestPath
150-
try {
151-
// Android Gradle Plugin < 3.0.0
152-
manifestPath = variantOutput.processManifest.manifestOutputFile
153-
} catch (Exception ignored) {
154-
// Android Gradle Plugin >= 3.0.0
155-
manifestPath = new File(
156-
variantOutput.processManifest.manifestOutputDirectory.toString(),
157-
"AndroidManifest.xml")
158-
if (!manifestPath.isFile()) {
149+
def manifestPath = extension.manifestPath
150+
if (manifestPath == null) {
151+
try {
152+
// Android Gradle Plugin < 3.0.0
153+
manifestPath = variantOutput.processManifest.manifestOutputFile
154+
} catch (Exception ignored) {
155+
// Android Gradle Plugin >= 3.0.0
159156
manifestPath = new File(
160-
new File(
161-
variantOutput.processManifest.manifestOutputDirectory.toString(),
162-
variantOutput.dirName),
157+
variantOutput.processManifest.manifestOutputDirectory.toString(),
163158
"AndroidManifest.xml")
159+
if (!manifestPath.isFile()) {
160+
manifestPath = new File(
161+
new File(
162+
variantOutput.processManifest.manifestOutputDirectory.toString(),
163+
variantOutput.dirName),
164+
"AndroidManifest.xml")
165+
}
164166
}
165167
}
166168

sentry-android-gradle-plugin/src/main/groovy/io/sentry/android/gradle/SentryPluginExtension.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ package io.sentry.android.gradle
33
class SentryPluginExtension {
44
def boolean autoProguardConfig = true;
55
def boolean autoUpload = true;
6+
def String manifestPath = null;
67
}

0 commit comments

Comments
 (0)