Skip to content

Commit 5310b3e

Browse files
committed
Allow sentry to be included in library projects
1 parent c5002e9 commit 5310b3e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package io.sentry.android.gradle
22

33
import com.android.build.gradle.AppPlugin
4+
import com.android.build.gradle.LibraryPlugin
45
import com.android.build.gradle.api.ApplicationVariant
56
import org.apache.commons.compress.utils.IOUtils
67
import org.gradle.api.Plugin
@@ -139,7 +140,7 @@ class SentryPlugin implements Plugin<Project> {
139140
project.extensions.create("sentry", SentryPluginExtension)
140141

141142
project.afterEvaluate {
142-
if(!project.plugins.hasPlugin(AppPlugin)) {
143+
if(!project.plugins.hasPlugin(AppPlugin) && !project.getPlugins().hasPlugin(LibraryPlugin)) {
143144
throw new IllegalStateException('Must apply \'com.android.application\' first!')
144145
}
145146

0 commit comments

Comments
 (0)