Skip to content

Commit

Permalink
Merge pull request #17 from MODLanguage/quentin-travis-publish-fix
Browse files Browse the repository at this point in the history
Added default for sonatype credentials for Travis
  • Loading branch information
alexdalitz committed Mar 19, 2019
2 parents dfbab5f + a2cd645 commit 6ae9a70
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions build.gradle
Expand Up @@ -19,7 +19,7 @@ sourceCompatibility = 1.7
group = "uk.modl"
applicationName = "java-interpreter"
archivesBaseName = "java-interpreter"
version = "0.0.3-SNAPSHOT"
version = "0.0.3"

def isSnapshot = version.endsWith("SNAPSHOT")

Expand Down Expand Up @@ -101,9 +101,28 @@ publishing {
def snapshotsRepoUrl = "$buildDir/repos/snapshots"
url = isSnapshot ? snapshotsRepoUrl : releasesRepoUrl
if(!isSnapshot) {
def stUser
def stPwd

if (project.hasProperty('sonatypeUsername')) {
stUser = sonatypeUsername
}
else{
stUser = "notdefined"
logger.warn("sonatypeUsername not defined. Please update your gradle config file")
}

if (project.hasProperty('sonatypePassword')) {
stPwd = sonatypePassword
}
else{
stPwd = "notdefined"
logger.warn("sonatypePassword not defined. Please update your gradle config file")
}

credentials {
username sonatypeUsername
password sonatypePassword
username stUser
password stPwd
}
}
}
Expand Down

0 comments on commit 6ae9a70

Please sign in to comment.