-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
38 lines (32 loc) · 860 Bytes
/
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
plugins{
}
import groovy.json.*
group 'twitter-stone'
version '0.0.2'
task clean(){
doLast{
new File('build').delete()
}
}
task prepareRelease(type:Copy){
from 'ext'
into 'build/extension'
}
task updateManifest(dependsOn:prepareRelease){
doLast{
def jsonSlurper = new JsonSlurper()
def manifest = jsonSlurper.parse(file("build/extension/manifest-template.json"))
manifest.version = "$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/${project.name}-v${version}.zip"
}
}