Skip to content

Commit 4e4f7a9

Browse files
committed
ToxicBakery#30 Gave up trying to properly set the signing keys, gradle can go fuck itself and its terrible documentation.
- Four hours wasted today fighting gradle, I should start logging it so I know how many hours of my life has been wasted almost entirely because tasks can skip for any reason without telling you why. Excellent job guys.
1 parent f54df9a commit 4e4f7a9

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ script:
2121
- echo "Travis branch is $TRAVIS_BRANCH"
2222
- echo "Travis branch is in pull request? $TRAVIS_PULL_REQUEST"
2323
- echo "Travis tag $TRAVIS_TAG"
24+
- echo -e "signing.keyId=${signing_keyId}" >> "gradle.properties"
25+
- echo -e "signing.password=${signing_password}" >> "gradle.properties"
26+
- echo -e "signing.secretKeyRingFile=../maven.keystore.gpg" >> "gradle.properties"
2427
- gradle clean assemble test uploadArchives --continue
2528

2629
install:

library/build.gradle

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,6 @@ android {
5252
release {
5353
minifyEnabled false
5454
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
55-
56-
// Update the signing information with the secure keys stored in Travis
57-
if (System.getenv('signing_keyId') && System.getenv('signing_password')) {
58-
ext."signing.keyId" = System.getenv('signing_keyId')
59-
ext."signing.password" = System.getenv('signing_password')
60-
ext."signing.secretKeyRingFile" = "./maven.keystore.gpg"
61-
}
6255
}
6356
}
6457
}

maven_push.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,20 @@ def getRepositoryPassword() {
3131
return System.getenv('sonatype_pass') ?: hasProperty('sonatype_pass') ? sonatype_pass : ""
3232
}
3333

34+
String getBranchName() {
35+
return System.getenv('TRAVIS_BRANCH')
36+
}
37+
3438
afterEvaluate { project ->
39+
40+
println "Is Tag ${isTag()}"
41+
println "Branch ${getBranchName()}"
42+
println "Is Release ${isReleaseBuild()}"
43+
println "Is Travis ${isTravis()}"
44+
println "Has Username ${!getRepositoryUsername().empty}"
45+
println "Has Password ${!getRepositoryPassword().empty}"
46+
println "Determined Version ${version}"
47+
3548
uploadArchives {
3649
repositories {
3750
mavenDeployer {

0 commit comments

Comments
 (0)