forked from apollo-rsps/apollo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.gradle
39 lines (30 loc) · 1009 Bytes
/
settings.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
import java.nio.file.Paths
import java.nio.file.Path
rootProject.name = 'org.apollo'
include ':cache'
include ':game'
include ':game:plugin'
include ':game:plugin-detekt-rules'
include ':game:plugin-testing'
include ':net'
include ':util'
def pluginDirs = [
rootProject.projectDir.toPath().resolve("game/plugin"),
]
def processPluginDir(Path pluginDir) {
if (pluginDir.toFile().exists()) {
def pluginFileFinder = new FileNameFinder();
def pluginFiles = pluginFileFinder.getFileNames(pluginDir.toString(), "**/*.gradle");
pluginFiles.each { filename ->
def path = Paths.get(filename)
def parentPath = path.parent
if (parentPath == pluginDir) {
return
}
def relativePath = pluginDir.relativize(parentPath)
def pluginName = relativePath.toString().replace(File.separator, ":")
include ":game:plugin:$pluginName"
}
}
}
pluginDirs.each { processPluginDir(it) }