-
Notifications
You must be signed in to change notification settings - Fork 99
/
Copy pathrelease.gradle
56 lines (48 loc) · 1.69 KB
/
release.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
49
50
51
52
53
54
55
56
apply plugin: 'groovy'
apply from: 'https://launchpad.net/gradle-release/trunk/latest/+download/apply.groovy'
configurations {
installers {}
}
repositories {
mavenCentral()
}
dependencies {
compile gradleApi()
groovy localGroovy()
}
// This updates the apply script with the new version.
updateVersion << {
def applyFile = new File("installation", "apply.groovy")
def oldVersion = project.getProperty("release.oldVersion")
def newVersion = project.getProperty("release.newVersion")
ant.replace(file: applyFile, token: "${group}:${name}:${oldVersion}", value: "${group}:${name}:${newVersion}")
ant.replaceregexp(file: readmeFile, match: "Current Version: .*?\$", replace: "Current Version: ${oldVersion}", byline: true)
ant.replaceregexp(file: readmeFile, match: "gradle-templates/\\d+\\.\\d+/apply.groovy", replace: "gradle-templates/${oldVersion}/apply.groovy", byline: true)
}
artifacts {
archives jar
installers file('installation/apply.groovy')
}
uploadArchives {
repositories {
add(new org.apache.ivy.plugins.resolver.SFTPResolver()) {
host = releaseRepoHost
addIvyPattern "${releaseRepoBase}/[module]/[revision]/[artifact]-[revision].[ext]"
addArtifactPattern "${releaseRepoBase}/[module]/[revision]/[artifact]-[revision].[ext]"
}
}
}
uploadInstallers {
repositories {
add(new org.apache.ivy.plugins.resolver.SFTPResolver()) {
host = releaseRepoHost
addArtifactPattern "${releaseRepoBase}/[module]/[revision]/[artifact].[ext]"
}
add(new org.apache.ivy.plugins.resolver.SFTPResolver()) {
host = releaseRepoHost
addArtifactPattern "${releaseRepoBase}/[module]/[artifact].[ext]"
}
}
}
createReleaseTag.dependsOn uploadArchives
createReleaseTag.dependsOn uploadInstallers