Skip to content

Commit 3000903

Browse files
committed
fix Mindustry maven issue
1 parent 94e65b9 commit 3000903

File tree

4 files changed

+25
-8
lines changed

4 files changed

+25
-8
lines changed

TestProjectKt/build.gradle.kts

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
44

55
plugins {
66
kotlin("jvm") version "1.9.20"
7-
id("io.github.liplum.mgpp") version "1.3.2"
7+
id("io.github.liplum.mgpp") version "1.4.0"
88
}
99

1010
sourceSets {
@@ -36,6 +36,7 @@ dependencies {
3636
open class TestOutputTask : DefaultTask() {
3737
val outputFile = project.objects.property<File>()
3838
@OutputFile get
39+
3940
@TaskAction
4041
fun test() {
4142
}
@@ -146,7 +147,7 @@ tasks.withType<Jar> {
146147
tasks.test {
147148
useJUnitPlatform()
148149
}
149-
tasks.withType<JavaCompile>{
150+
tasks.withType<JavaCompile> {
150151
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
151152
targetCompatibility = JavaVersion.VERSION_1_8.toString()
152153
}

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
kotlin.code.style=official
22
pluginName=PlumyMindustryGradlePlugin
33
arcVersion=v146
4-
mgppVersion=1.3.3
4+
mgppVersion=1.4.0

main/src/io/github/liplum/mindustry/BuildScript.kt

+19-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,20 @@ import java.net.URL
1818
* You can call this in [RepositoryHandler] closure
1919
*/
2020
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
2433
}
34+
2535
/**
2636
* Import the dependencies of Mindustry.
2737
* It will take those into account:
@@ -43,6 +53,7 @@ fun Project.importMindustry() = afterEvaluateThis {
4353
// Arc
4454
arc.whenAvailable("arc-core", ::addMindustry)
4555
}
56+
4657
/**
4758
* Import the dependencies of Mindustry.
4859
* It will take those into account:
@@ -67,6 +78,7 @@ fun Project.importMindustry(configurationName: String) = afterEvaluateThis {
6778
// Arc
6879
arc.whenAvailable("arc-core", ::addSpecificDependency)
6980
}
81+
7082
internal
7183
fun Dependency.tryJitpackResolve(module: String): String? {
7284
// e.g.:com,github,anuken,arc
@@ -79,19 +91,23 @@ fun Dependency.tryJitpackResolve(module: String): String? {
7991
val code: Int = huc.responseCode
8092
return if (code == 404) null else resolve(module)
8193
}
94+
8295
internal
8396
fun Project.addMindustry(dependencyNotation: String) {
8497
compileOnly(dependencyNotation)
8598
testImplementation(dependencyNotation)
8699
}
100+
87101
internal
88102
fun Project.testImplementation(dependencyNotation: String) {
89103
addDependency("testImplementation", dependencyNotation)
90104
}
105+
91106
internal
92107
fun Project.compileOnly(dependencyNotation: String) {
93108
addDependency("compileOnly", dependencyNotation)
94109
}
110+
95111
internal
96112
fun Project.addDependency(configurationName: String, dependencyNotation: String) {
97113
configurations.getByName(configurationName).dependencies.add(

main/src/io/github/liplum/mindustry/Plugins.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class MindustryPlugin : Plugin<Project> {
172172
/**
173173
* [The Mindustry repo on Jitpack](https://github.com/anuken/mindustry)
174174
*/
175-
const val MindustryJitpackRepo = "com.github.anuken.mindustry"
175+
const val MindustryJitpackRepo = "com.github.Anuken.Mindustry"
176176
/**
177177
* [The mirror repo of Mindustry on Jitpack](https://github.com/anuken/mindustryjitpack)
178178
*/
@@ -188,7 +188,7 @@ class MindustryPlugin : Plugin<Project> {
188188
/**
189189
* [The Arc repo on Jitpack](https://github.com/anuken/arc)
190190
*/
191-
const val ArcJitpackRepo = "com.github.anuken.arc"
191+
const val ArcJitpackRepo = "com.github.Anuken.Arc"
192192
/**
193193
* The main class of desktop launcher.
194194
*/

0 commit comments

Comments
 (0)