-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
46 lines (37 loc) · 1.05 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
plugins{
id 'org.ajoberstar.reckon' version '0.9.0'
}
import groovy.json.*
group 'uoc-notifier'
task clean(){
doLast{
new File('build').delete()
}
}
task prepareRelease(type:Copy){
from 'extension'
into 'build/extension'
}
task updateManifest(dependsOn:prepareRelease){
doLast{
def jsonSlurper = new JsonSlurper()
def manifest = jsonSlurper.parse(file("build/extension/manifest-template.json"))
manifest.version = project.findProperty("dev") ?: "$version"
file("build/extension/manifest.json").text = JsonOutput.prettyPrint(JsonOutput.toJson(manifest))
}
}
task zipExtension(type:Zip,dependsOn:updateManifest){
from('build/extension')
archiveName = 'last.zip'
destinationDir = file('build')
}
task build(dependsOn:zipExtension){
doLast{
file('build/last.zip').renameTo "build/uocnotifier-addon-v"+(project.findProperty("dev") ?: "$version")+".zip"
}
}
reckon {
scopeFromProp()
stageFromProp('milestone', 'rc', 'final')
}
reckonTagCreate.dependsOn build