plugins { id 'java' id 'java-library' id 'gsl-starplane' version '0.2.4-a20251220' id 'maven-publish' } group 'de.geolykt' version '0.4.2' // Remember to adjust this in the extension.json, too! // The following statement defines that Java 8 should be used (which is galimulator's runtime version), // however if you dare, you can bump the version - just beware that users may lack the knowledge in how to install and run // your mod in that case. targetCompatibility = compileJava.targetCompatibility = sourceCompatibility = compileJava.sourceCompatibility = '1.8' repositories { mavenLocal() // stianloader's maven repository, which is the repo where SLAPI and SLL are contianed in (among other stianloader toolchain stuff) maven { name 'stianloader-maven' url 'https://stianloader.org/maven' } mavenCentral() } starplane { mappingsFile("tinyv2", "newStarmap.tinyv2") } configurations { dependencyMods compileOnlyApi.extendsFrom(dependencyMods) compileOnlyApi.extendsFrom(devRuntime) compileOnlyApi.extendsFrom(galimulatorDependencies) } deployMods { from configurations["dependencyMods"] remapMods = true } dependencies { // The versions of SLAPI are listed here: https://stianloader.org/maven/de/geolykt/starloader-api/ dependencyMods("de.geolykt:starloader-api:2.0.0-a20251226:remapped") // The versions of launcher-micromixin are listed here: https://stianloader.org/maven/org/stianloader/launcher-micromixin/ devRuntime "org.stianloader:launcher-micromixin:4.0.0-a20251115" compileOnly "org.stianloader:micromixin-annotations:0.7.1-a20241021" compileOnly "de.geolykt.starloader:starplane-annotations:1.0.0" compileOnlyApi "org.jetbrains:annotations:26.0.1-1" // https://mvnrepository.com/artifact/org.danilopianini/java-quadtree // Remember to adjust the version here to the version used in the extension.json, too! implementation ("org.danilopianini:java-quadtree:0.2.0") { exclude group: 'com.google.guava', module: 'guava' } } remapJar { archiveClassifier = 'remapped' fromJar jar dependsOn jar } runMods { from components["java"] systemProperties.put("classloader.dump", true) } build { dependsOn remapJar } publish { dependsOn publishToMavenLocal // Gradle doesn't quite like this line but otherwise I get issues when publishing so what gives? } publishing { publications { plugin(MavenPublication) { publication -> groupId project.group artifactId project.base.archivesName.get() from components['java'] artifact remapJar } } repositories { if (System.getProperty('publishRepo') != null) { maven { url System.getProperty('publishRepo') allowInsecureProtocol = true } } else { mavenLocal() } } } genEclipseRuns { additionalRuntimeDependency("main", configurations["runtimeClasspath"]) }