summaryrefslogtreecommitdiffstats
path: root/build.gradle
diff options
context:
space:
mode:
authorAizistral2022-06-17 14:46:34 +0200
committerAizistral2022-06-17 14:46:34 +0200
commit23a48f6909a66c2c3487bdef066d28048717d503 (patch)
treed6314af998fecf0befb7b66a6cfcffe9f31f003f /build.gradle
THE WAY IS LIT, THE PATH IS CLEAR
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle215
1 files changed, 215 insertions, 0 deletions
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..8210250
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,215 @@
+buildscript {
+ repositories {
+ mavenLocal()
+ maven { url = 'https://maven.minecraftforge.net' }
+ maven { url = 'https://dist.creeper.host/Sponge/maven' }
+ maven { url 'https://plugins.gradle.org/m2/' }
+ mavenCentral()
+ maven {
+ url = 'https://repo.spongepowered.org/repository/maven-public/'
+ content { includeGroup "org.spongepowered" }
+ }
+ }
+ dependencies {
+ classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
+ classpath 'gradle.plugin.com.matthewprenger:CurseGradle:1.4.0'
+ classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7-SNAPSHOT'
+ }
+}
+
+println("Applying plugins...")
+
+apply plugin: 'net.minecraftforge.gradle'
+apply plugin: 'eclipse'
+apply plugin: 'maven-publish'
+apply plugin: 'com.matthewprenger.cursegradle'
+apply plugin: 'org.spongepowered.mixin'
+
+println("Specifying project version/group/archivesBaseName...")
+version = "${mod_version}"
+group = "${mod_group}"
+archivesBaseName = "${mod_archives_name}"
+
+
+println("Specifying Java compatibility...")
+java.toolchain.languageVersion = JavaLanguageVersion.of(17)
+
+println("Java Installation Data:")
+println(" - Java Version: " + System.getProperty('java.version'))
+println(" - JVM Version: " + System.getProperty('java.vm.version'))
+println(" - Vendor: " + System.getProperty('java.vendor'))
+println(" - OS Archetype: " + System.getProperty('os.arch'))
+
+mixin {
+ println("Specifying refmaps for Mixin...")
+
+ add sourceSets.main, "nochatreports.refmap.json"
+}
+
+minecraft {
+ println("Specifying MCP mappings...")
+ mappings channel: 'official', version: '1.19'
+ println("Specifying Access Transformer configuration...")
+ // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
+
+ runs {
+ client {
+ properties 'org.gradle.jvmargs': '-Xms4G -Xmx4G'
+ properties 'fml.earlyprogresswindow': 'false'
+ properties 'mixin.env.disableRefMap': 'true'
+ workingDirectory project.file('run')
+
+ property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
+ property 'forge.logging.console.level', 'debug'
+
+ mods {
+ nochatreports {
+ source sourceSets.main
+ }
+ }
+ }
+
+ server {
+ properties 'mixin.env.disableRefMap': 'true'
+ workingDirectory project.file('run')
+
+ property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
+ property 'forge.logging.console.level', 'debug'
+
+ mods {
+ nochatreports {
+ source sourceSets.main
+ }
+ }
+ }
+ }
+}
+
+sourceSets.main.resources {
+ // NO-OP
+}
+
+repositories {
+ println("Specifying repositories...")
+ flatDir { dirs 'deps' }
+ maven { url = "https://maven.theillusivec4.top/" } // curios
+ maven { url = "https://maven.blamejared.com/" } // patchouli
+ maven { url = "https://repo.spongepowered.org/maven" } // mixin
+ maven { url "https://dvs1.progwml6.com/files/maven/" } // no idea
+}
+
+dependencies {
+ println("Processing dependencies...")
+
+ // Minecraft & Forge
+ minecraft "net.minecraftforge:forge:${version_forge}"
+
+ annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
+ annotationProcessor 'com.google.code.gson:gson:2.8.0'
+ annotationProcessor 'com.google.guava:guava:21.0'
+ annotationProcessor 'org.ow2.asm:asm-tree:7.2'
+ annotationProcessor 'org.ow2.asm:asm-commons:7.2'
+ annotationProcessor 'org.ow2.asm:asm-util:7.2'
+}
+
+
+jar {
+ println("Processing manifest...")
+
+ manifest {
+ attributes([
+ "Specification-Title": "${mod_name}",
+ "Specification-Vendor": "${mod_author}",
+ "Specification-Version": "${mod_version}",
+ "Implementation-Title": "${mod_name}",
+ "Implementation-Version": "${mod_version}",
+ "Implementation-Vendor" :"${mod_author}",
+ "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
+ "MixinConnector": "${project.group}.MixinConnector"
+ ])
+ }
+}
+
+processResources {
+ println("Processing resources...")
+
+ exclude 'META-INF/mods.toml'
+
+ from("${project.projectDir}/docs/META-INF") {
+ println("Inflating mods.toml...")
+
+ // Replace properties in mods.toml with ones derived from settings.gradle
+ include 'mods.toml'
+ expand 'mod_license': mod_license,
+ 'mod_version': project.version,
+ 'mod_id' : mod_id,
+ 'mod_name': mod_name,
+ 'mod_url': mod_url,
+ 'mod_author': mod_author,
+ 'mod_description': mod_description,
+ 'mod_icon': mod_icon,
+ 'issue_tracker_url': issue_tracker_url,
+ 'mod_credits': mod_credits,
+ 'dep_forge': dep_forge,
+ 'dep_minecraft': dep_minecraft
+ into 'META-INF'
+ }
+
+ from("${project.projectDir}/docs") {
+ include 'changelog.html'
+ }
+
+ from("${project.projectDir}") {
+ include 'LICENSE'
+ }
+}
+
+curseforge {
+
+ project {
+ println("Pushing CurseGradle specifications for project ID: ${curse_id}")
+
+ // Specified as cmd argument
+ apiKey = findProperty('curseKey') ?: 0
+
+ id = "${curse_id}"
+ releaseType = "${curse_release}"
+ changelogType = 'html'
+ changelog = file('docs/changelog.html')
+
+ addGameVersion '1.18'
+ addGameVersion '1.18.1'
+
+ //addArtifact(sourcesJar)
+ //addArtifact(apiJar)
+ }
+}
+
+
+
+task updateResources() {
+ // NO-OP
+}
+
+tasks.updateResources.dependsOn processResources
+
+tasks.withType(JavaCompile) {
+ options.failOnError(true)
+}
+
+jar.finalizedBy('reobfJar')
+//publish.dependsOn('reobfJar')
+
+publishing {
+
+ publications {
+ mavenJava(MavenPublication) {
+ artifact jar
+ }
+ }
+ repositories {
+ maven {
+ url "file:///${project.projectDir}/mcmodsrepo"
+ }
+ }
+} \ No newline at end of file