-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinfo.gradle
31 lines (27 loc) · 845 Bytes
/
info.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
import java.text.SimpleDateFormat
task copyInfo(type: Copy) {
from('src/main/resources') {
include 'product-info.properties'
include 'plugin.yml'
}
into 'build/resources/main'
// 禁用up-to-date检查
outputs.upToDateWhen { false }
}
tasks.processResources.dependsOn(copyInfo)
processResources {
doFirst {
filesMatching('**/product-info.properties') {
expand([
'version' : project.property("version"),
'build_time': new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())
])
}
filesMatching("**/plugin.yml") {
expand([
'version' : project.property("version"),
'core_version': project(":quark").property("version")
])
}
}
}