Skip to content

Commit dc437ac

Browse files
Merge pull request #15 from PSPDFKit/simone/issue/change-dependencies-on-demo-version
Use 'com.pspdfkit:pspdfkit-demo'
2 parents 7e6ee33 + 6a6330e commit dc437ac

File tree

1 file changed

+41
-3
lines changed

1 file changed

+41
-3
lines changed

android/build.gradle

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* Contains gradle configuration constants
3+
*/
4+
ext {
5+
PSPDFKIT_VERSION = '3.0.0'
6+
}
7+
18
buildscript {
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+
2862
dependencies {
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

Comments
 (0)