Skip to content

Commit 6ae9a70

Browse files
authored
Merge pull request #17 from MODLanguage/quentin-travis-publish-fix
Added default for sonatype credentials for Travis
2 parents dfbab5f + a2cd645 commit 6ae9a70

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

build.gradle

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ sourceCompatibility = 1.7
1919
group = "uk.modl"
2020
applicationName = "java-interpreter"
2121
archivesBaseName = "java-interpreter"
22-
version = "0.0.3-SNAPSHOT"
22+
version = "0.0.3"
2323

2424
def isSnapshot = version.endsWith("SNAPSHOT")
2525

@@ -101,9 +101,28 @@ publishing {
101101
def snapshotsRepoUrl = "$buildDir/repos/snapshots"
102102
url = isSnapshot ? snapshotsRepoUrl : releasesRepoUrl
103103
if(!isSnapshot) {
104+
def stUser
105+
def stPwd
106+
107+
if (project.hasProperty('sonatypeUsername')) {
108+
stUser = sonatypeUsername
109+
}
110+
else{
111+
stUser = "notdefined"
112+
logger.warn("sonatypeUsername not defined. Please update your gradle config file")
113+
}
114+
115+
if (project.hasProperty('sonatypePassword')) {
116+
stPwd = sonatypePassword
117+
}
118+
else{
119+
stPwd = "notdefined"
120+
logger.warn("sonatypePassword not defined. Please update your gradle config file")
121+
}
122+
104123
credentials {
105-
username sonatypeUsername
106-
password sonatypePassword
124+
username stUser
125+
password stPwd
107126
}
108127
}
109128
}

0 commit comments

Comments
 (0)