mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 16:28:56 +00:00
32 lines
1.4 KiB
Groovy
32 lines
1.4 KiB
Groovy
/*
|
|
* The build uses either public snapshots or branch-specific repositories on the Jenkins
|
|
* build server as upstream repositories. Use the argument '-PuseJenkinsSnapshots=true'
|
|
* to enable the Jenkins repositories. In this case you can select an upstream branch
|
|
* with the argument '-PupstreamBranch=<branch name>'. Without that argument, the
|
|
* upstream branch is selected automatically based on the version string.
|
|
*/
|
|
|
|
if (!hasProperty('upstreamBranch')) {
|
|
def versionSplit = version.split('\\.')
|
|
if (versionSplit.length == 4)
|
|
ext.upstreamBranch = 'milestone_' + version
|
|
else if (versionSplit[2] == '0-SNAPSHOT')
|
|
ext.upstreamBranch = 'master'
|
|
else if (versionSplit[2].endsWith('-SNAPSHOT'))
|
|
ext.upstreamBranch = 'maintenance_' + version.substring(0, version.lastIndexOf('.'))
|
|
else
|
|
ext.upstreamBranch = 'release_' + version
|
|
}
|
|
|
|
def jenkinsPipelineRepo = { jobName -> "http://services.typefox.io/open-source/jenkins/job/$jobName/job/$upstreamBranch/lastStableBuild/artifact/build/maven-repository/" }
|
|
|
|
repositories {
|
|
jcenter()
|
|
if (findProperty('useJenkinsSnapshots') == 'true') {
|
|
maven { url "http://services.typefox.io/open-source/jenkins/job/lsp4j/job/master/lastStableBuild/artifact/build/maven-repository/" }
|
|
maven { url jenkinsPipelineRepo('xtext-lib') }
|
|
} else {
|
|
mavenLocal()
|
|
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
|
|
}
|
|
}
|