1+ /**
2+ * Contains gradle configuration constants
3+ */
4+ ext {
5+ PSPDFKIT_VERSION = ' 3.0.0'
6+ }
7+
18buildscript {
29 repositories {
310 jcenter()
@@ -25,7 +32,38 @@ android {
2532 }
2633}
2734
35+ def demoVersion = false ;
36+ project. repositories. each {
37+ if (it instanceof MavenArtifactRepository ) {
38+ if (" $it . url " . contains(" customers.pspdfkit.com/maven" )) {
39+ // Bug: https://github.com/gradle/gradle/issues/1230
40+ def username = it. credentials. username
41+ def password = it. credentials. password
42+
43+ if (username == " pspdfkit" ) {
44+ if (password != null && password. startsWith(" TRIAL" )) {
45+ demoVersion = true ;
46+ } else if (password != null && password == " YOUR_MAVEN_PASSWORD_GOES_HERE" ) {
47+ println " #######################################################################################################"
48+ println " ### Credentials error: edit 'YourApp/android/build.gradle' file and modify PSPDFKit maven password. ###"
49+ println " #######################################################################################################"
50+ }
51+ }
52+ }
53+ }
54+ }
55+
56+ if (demoVersion) {
57+ println " ##############################"
58+ println " ### PSPDFKit Demo Version. ###"
59+ println " ##############################"
60+ }
61+
2862dependencies {
29- compile ' com.pspdfkit:pspdfkit:3.0.0'
30- compile ' com.facebook.react:react-native:+'
31- }
63+ if (demoVersion) {
64+ compile " com.pspdfkit:pspdfkit-demo:${ PSPDFKIT_VERSION} "
65+ } else {
66+ compile " com.pspdfkit:pspdfkit:${ PSPDFKIT_VERSION} "
67+ }
68+ compile " com.facebook.react:react-native:+"
69+ }
0 commit comments