forked from MohistMC/Banner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.gradle
39 lines (36 loc) · 928 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
39
pluginManagement {
repositories {
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
maven { url = 'https://maven.minecraftforge.net/' }
mavenCentral()
gradlePluginPortal()
}
}
for (File file in getFile("modules").listFiles()) {
if (isModuleDir(file)) {
String name = file.name
include(name)
ProjectDescriptor project = project(":" + name)
project.projectDir = getFile("modules/" + name)
}
}
// jank! why is this needed??
def getFile(String name) {
return file(name)
}
static def isModuleDir(File file) {
if (file.isDirectory()) {
File[] files = file.listFiles()
if (files != null) {
for (File subFile in files) {
if (subFile.name == "build.gradle") {
return true
}
}
}
}
return false
}