generated from GlennFolker/MindustryModTemplate
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsettings.gradle.kts
58 lines (52 loc) · 2.41 KB
/
settings.gradle.kts
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
pluginManagement{
repositories{
gradlePluginPortal()
maven("https://raw.githubusercontent.com/GlennFolker/EntityAnnoMaven/main")
}
plugins{
val entVersion: String by settings
id("com.github.GlennFolker.EntityAnno") version(entVersion)
}
}
if(JavaVersion.current().ordinal < JavaVersion.VERSION_17.ordinal){
throw IllegalStateException("JDK 17 is a required minimum version. Yours: ${System.getProperty("java.version")}")
}
val modArtifact: String by settings
rootProject.name = modArtifact
include(":proc")
for(local in arrayOf("glTFrenzy", "EntityAnno")){
val prop = "local.${local.lowercase()}"
if(!extra.has(prop) || extra[prop].toString().toBoolean()){
val dir = File(rootDir.parent, local)
if(dir.exists()){
logger.lifecycle("Compiling with local $local.")
includeBuild(dir){
dependencySubstitution{
all{
val mindustryBE: String by settings
val mindustryBEVersion: String by settings
val arcVersion: String by settings
(requested as? ModuleComponentSelector)?.let{
if(mindustryBE.toBooleanStrict() && it.group == "com.github.Anuken.Mindustry"){
useTarget("com.github.Anuken.MindustryJitpack:${it.module}:$mindustryBEVersion")
}else if(it.group == "com.github.Anuken.Arc"){
useTarget("com.github.Anuken.Arc:${it.module}:$arcVersion")
}else if(it.group.startsWith("com.github.GlennFolker")){
val group = it.group.substring("com.github.GlennFolker".length)
if(group.isEmpty() && it.module == local){
useTarget(project(":"))
}else if(group.isNotEmpty() && group.substring(1) == local){
if(it.module.endsWith(".gradle.plugin")){
useTarget(project(":"))
}else{
useTarget(project(":${it.module}"))
}
}
}
}
}
}
}
}
}
}