@@ -18,10 +18,20 @@ import java.net.URL
18
18
* You can call this in [RepositoryHandler] closure
19
19
*/
20
20
fun RepositoryHandler.mindustryRepo (
21
- ): MavenArtifactRepository = maven { repo ->
22
- repo.name = " mindustry-center"
23
- repo.url = URI (" https://www.jitpack.io" )
21
+ ): MavenArtifactRepository = run {
22
+ val mindustryRepo = maven { repo ->
23
+ repo.name = " mindustry-maven"
24
+ // Jitpack was broken for Mindustry and Arc
25
+ repo.url = URI (" https://raw.githubusercontent.com/Zelaux/MindustryRepo/master/repository" )
26
+ }
27
+ // jitpack after Mindustry repo
28
+ maven { repo ->
29
+ repo.name = " jitpack"
30
+ repo.url = URI (" https://www.jitpack.io" )
31
+ }
32
+ mindustryRepo
24
33
}
34
+
25
35
/* *
26
36
* Import the dependencies of Mindustry.
27
37
* It will take those into account:
@@ -43,6 +53,7 @@ fun Project.importMindustry() = afterEvaluateThis {
43
53
// Arc
44
54
arc.whenAvailable(" arc-core" , ::addMindustry)
45
55
}
56
+
46
57
/* *
47
58
* Import the dependencies of Mindustry.
48
59
* It will take those into account:
@@ -67,6 +78,7 @@ fun Project.importMindustry(configurationName: String) = afterEvaluateThis {
67
78
// Arc
68
79
arc.whenAvailable(" arc-core" , ::addSpecificDependency)
69
80
}
81
+
70
82
internal
71
83
fun Dependency.tryJitpackResolve (module : String ): String? {
72
84
// e.g.:com,github,anuken,arc
@@ -79,19 +91,23 @@ fun Dependency.tryJitpackResolve(module: String): String? {
79
91
val code: Int = huc.responseCode
80
92
return if (code == 404 ) null else resolve(module)
81
93
}
94
+
82
95
internal
83
96
fun Project.addMindustry (dependencyNotation : String ) {
84
97
compileOnly(dependencyNotation)
85
98
testImplementation(dependencyNotation)
86
99
}
100
+
87
101
internal
88
102
fun Project.testImplementation (dependencyNotation : String ) {
89
103
addDependency(" testImplementation" , dependencyNotation)
90
104
}
105
+
91
106
internal
92
107
fun Project.compileOnly (dependencyNotation : String ) {
93
108
addDependency(" compileOnly" , dependencyNotation)
94
109
}
110
+
95
111
internal
96
112
fun Project.addDependency (configurationName : String , dependencyNotation : String ) {
97
113
configurations.getByName(configurationName).dependencies.add(
0 commit comments