-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
43 lines (38 loc) · 1.23 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
List<File> subprojectDirs = new ArrayList<>(subprojects.size())
subprojects.forEach({
subprojectDirs.add(it.projectDir)
})
List<String> outputDescriptors = new ArrayList<>()
task copyDescriptors {
description 'Copy mod descriptors to Stellaris mod directory.'
group 'mod'
def modRootDir = rootDir.parentFile
subprojectDirs.forEach({
outputDescriptors.add(new File(modRootDir, (it.name + '.mod') as String).path)
})
outputs.files files(outputDescriptors)
onlyIf {
rootDir.parentFile.name == 'mod'
}
doLast {
copy {
from subprojectDirs
include 'descriptor.mod'
rename 'descriptor\\.mod', ''
into rootDir.parentFile.absolutePath
eachFile({ it.name = it.file.parentFile.name + '.mod' })
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
}
}
task installDescriptors {
description 'Install mod descriptors to make mods work in-game.'
group 'mod'
dependsOn(copyDescriptors)
doLast {
outputDescriptors.forEach({
def propertyName = file(it).name - '.mod' + '-rfid' as String
file(it).append("\nremote_file_id=\"${project.property(propertyName)}\"")
})
}
}