-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
83 lines (72 loc) · 2.1 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
println """
******************************************
Building Thaumic Skies!
Output files will be in basePath/build/
******************************************
"""
import org.apache.tools.ant.filters.ReplaceTokens
version = packVersion
description = packDescription
def forgeCompatibility = packForgeCompatibility
ext {
buildSources = "$buildDir/sources"
}
task buildAll(dependsOn: ['buildServer', 'buildClient'])
task compileServer(type: Copy) {
doFirst {
delete("$buildSources/server")
}
from('src') {
exclude '**/_CLIENT/**'
}
from('src') {
include '**/*.properties'
include '**/*.txt'
include '**/*.json'
include '**/*.cfg'
include '**/*.conf'
include '**/*.config'
include '**/*.xml'
include '**/*.recipes'
exclude '**/_CLIENT/**'
filter(ReplaceTokens, tokens: project.properties.collectEntries { k, v -> [k, v ?: ''] })
}
into "$buildSources/server"
eachFile { details ->
details.path = details.path.replaceAll('_SERVER', '');
}
includeEmptyDirs = false
}
task compileClient(type: Copy) {
doFirst {
delete("$buildSources/client")
}
from('src') {
exclude '**/_SERVER/**'
}
from('src') {
include '**/*.properties'
include '**/*.txt'
include '**/*.json'
include '**/*.cfg'
include '**/*.conf'
include '**/*.config'
include '**/*.xml'
include '**/*.recipes'
exclude '**/_SERVER/**'
filter(ReplaceTokens, tokens: project.properties.collectEntries { k, v -> [k, v ?: ''] })
}
into "$buildSources/client"
eachFile { details ->
details.path = details.path.replaceAll('_CLIENT', '');
}
includeEmptyDirs = false
}
task buildServer(type: Zip, dependsOn: ['compileServer']) {
from "$buildSources/server"
baseName = "$buildDir/${project.name}_${project.version}_Server"
}
task buildClient(type: Zip, dependsOn: ['compileClient']) {
from "$buildSources/client"
baseName = "$buildDir/${project.name}_${project.version}_Client"
}