-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
55 lines (50 loc) · 1.28 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
plugins {
// Apply the java plugin to add support for Java
id 'java'
// Facilitates building archives that serve as project distributions
id 'distribution'
}
repositories {
mavenCentral()
}
java {
// ZomboidDoc can only be executed with Java 8
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}
apply from: 'setup.gradle'
if (project.ext.has('gameDir'))
{
Set<String> sourcesList = new HashSet<>(['media/lua'])
Set<String> resourcesList = new HashSet<>()
Set<String> excludeResources = new HashSet<>([
'media/lua', 'media/luaexamples',
'media/newuitests', 'media/launcher',
])
def gameDirPath = gameDir as java.nio.file.Path
//@formatter:off
gameDirPath.resolve('media').toFile().listFiles().each
{
if (it.directory)
{
String filepath = "media/${it.name}"
if (!excludeResources.contains(filepath)) {
resourcesList.add(filepath)
}
}
}//@formatter:on
sourceSets {
media {
java.srcDirs = sourcesList
resources.srcDirs = resourcesList
}
}
apply from: 'mod.gradle'
apply from: 'zomboid.gradle'
apply from: 'zdoc.gradle'
jar.from sourceSets.media.output
version modInfoProperties.getProperty('modversion')
apply from: 'distribution.gradle'
defaultTasks 'showModInfo'
}