forked from sinthetix/jenkins-hub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
48 lines (42 loc) · 1.08 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
buildscript{
repositories{
maven{url 'http://artifactory.blackducksoftware.com/artifactory/blackduck-builder-repos'}
}
dependencies{
classpath 'com.blackducksoftware.gradle.plugins:gradle-management-plugins:1.2.1'
classpath 'com.blackducksoftware.gradle.plugins:gradle-plugins:1.63'
}
}
if (!version || version == 'unspecified'){
version = getVersionFromPom()
}
group = getGroupFromPom()
description = getNameFromPom()
apply plugin: 'release'
persistVersion{
versionPropertiesFile = 'pom.xml' as File
}
bumpVersionNumber{
versionMap = ['int-hub-jenkins': ['pom.xml': ['version': 3]]]
}
commitPropertiesFiles{
propertyFilesList = ['int-hub-jenkins': ['pom.xml']]
}
def getVersionFromPom(){
File pom = new File('pom.xml')
def project = new XmlSlurper().parse(pom)
project.version
}
def getGroupFromPom(){
File pom = new File('pom.xml')
def project = new XmlSlurper().parse(pom)
project.groupId
}
def getNameFromPom(){
File pom = new File('pom.xml')
def project = new XmlSlurper().parse(pom)
project.name
}
task('wrapper', type: Wrapper){
gradleVersion='2.4'
}