|
| 1 | +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar |
| 2 | + |
| 3 | +plugins { |
| 4 | + id 'java' |
| 5 | + id 'idea' |
| 6 | + id 'eclipse' |
| 7 | + id 'maven-publish' |
| 8 | + alias libs.plugins.licenser |
| 9 | + alias libs.plugins.gradleutils |
| 10 | + alias libs.plugins.shadow |
| 11 | +} |
| 12 | + |
| 13 | +final projectDisplayName = 'Slime Launcher' |
| 14 | +final projectArtifactId = base.archivesName = 'slime-launcher' |
| 15 | +final projectVendor = 'Forge Development LLC' |
| 16 | +description = 'A slim launcher for Minecraft in the development environment.' |
| 17 | +group = 'net.minecraftforge' |
| 18 | +version = gitversion.tagOffset |
| 19 | + |
| 20 | +println "Version: $version" |
| 21 | + |
| 22 | +java { |
| 23 | + // Even though older Minecraft supports as far back as 1.5, 8 is compatible with it, and SL is not compiling anything. |
| 24 | + toolchain.languageVersion = JavaLanguageVersion.of 8 |
| 25 | + |
| 26 | + withSourcesJar() |
| 27 | +} |
| 28 | + |
| 29 | +dependencies { |
| 30 | + implementation libs.gson |
| 31 | + implementation libs.jopt |
| 32 | + |
| 33 | + implementation libs.bundles.utils |
| 34 | + |
| 35 | + compileOnly libs.nulls |
| 36 | +} |
| 37 | + |
| 38 | +license { |
| 39 | + header rootProject.file('LICENSE-header.txt') |
| 40 | + newLine false |
| 41 | + exclude '**/*.properties' |
| 42 | +} |
| 43 | + |
| 44 | +tasks.withType(JavaCompile).configureEach { |
| 45 | + options.encoding = 'UTF-8' |
| 46 | +} |
| 47 | + |
| 48 | +tasks.named('jar', Jar) { |
| 49 | + manifest { |
| 50 | + attributes([ |
| 51 | + 'Main-Class': 'net.minecraftforge.launcher.Main' |
| 52 | + ]) |
| 53 | + attributes([ |
| 54 | + 'Specification-Title' : projectDisplayName, |
| 55 | + 'Specification-Vendor' : projectVendor, |
| 56 | + 'Specification-Version' : gitversion.info.tag, |
| 57 | + 'Implementation-Title' : projectDisplayName, |
| 58 | + 'Implementation-Vendor' : projectVendor, |
| 59 | + 'Implementation-Version': project.version |
| 60 | + ], 'net/minecraftforge/launcher/') |
| 61 | + } |
| 62 | + |
| 63 | + archiveClassifier = 'thin' |
| 64 | +} |
| 65 | + |
| 66 | +tasks.named('shadowJar', ShadowJar) { |
| 67 | + enableRelocation = true |
| 68 | + relocationPrefix = 'net.minecraftforge.launcher.shadow' |
| 69 | + |
| 70 | + archiveClassifier = null |
| 71 | +} |
| 72 | + |
| 73 | +changelog { |
| 74 | + fromBase() |
| 75 | +} |
| 76 | + |
| 77 | +publishing { |
| 78 | + publications.register('mavenJava', MavenPublication) { |
| 79 | + from components.shadow |
| 80 | + |
| 81 | + artifactId = projectArtifactId |
| 82 | + changelog.publish it |
| 83 | + |
| 84 | + pom { pom -> |
| 85 | + name = projectDisplayName |
| 86 | + description = project.description |
| 87 | + |
| 88 | + gradleutils.pom.setGitHubDetails pom |
| 89 | + |
| 90 | + licenses { |
| 91 | + license gradleutils.pom.licenses.LGPLv2_1 |
| 92 | + } |
| 93 | + |
| 94 | + developers { |
| 95 | + developer gradleutils.pom.developers.Jonathing |
| 96 | + } |
| 97 | + } |
| 98 | + } |
| 99 | + |
| 100 | + repositories { |
| 101 | + maven gradleutils.publishingForgeMaven |
| 102 | + } |
| 103 | +} |
| 104 | + |
| 105 | +idea.module { downloadJavadoc = downloadSources = true } |
0 commit comments