@@ -11,7 +11,32 @@ if(JavaVersion.current().ordinal() < JavaVersion.VERSION_17.ordinal()){
11
11
12
12
rootProject. name = modName
13
13
14
- if (new File (rootDir. parent, ' MindustryBlackHoleRenderer' ). exists()){
14
+ def name = ' MindustryBlackHoleRenderer'
15
+ if (new File (rootDir. parent, name). exists()){
15
16
println (" Compiling with local Black Hole Library" )
16
- includeBuild(" ../MindustryBlackHoleRenderer" )
17
+ includeBuild(" ../${ name} " ){
18
+ dependencySubstitution{sub ->
19
+ sub. all{
20
+ if (it. requested instanceof ModuleComponentSelector ){
21
+ def req = it. requested as ModuleComponentSelector
22
+ if (Boolean . valueOf(mindustryBE) && req. group == ' com.github.Anuken.Mindustry' ){
23
+ useTarget " com.github.Anuken.MindustryJitpack:$req . module :$mindustryBEVersion "
24
+ }else if (req. group == ' com.github.Anuken.Arc' ){
25
+ useTarget " com.github.Anuken.Arc:$req . module :$arcVersion "
26
+ }else if (req. group. startsWith(' com.github.MEEPofFaith' )){
27
+ def group = req. group. substring(' com.github.MEEPofFaith' . length())
28
+ if (group. isEmpty() && req. module == name){
29
+ useTarget sub. project(' :' )
30
+ }else if (! group. isEmpty() && group. substring(1 ) == name){
31
+ if (req. module. endsWith(' .gradle.plugin' )){
32
+ useTarget sub. project(' :' )
33
+ }else {
34
+ useTarget sub. project(" :$req . module " )
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }
17
42
}
0 commit comments