]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/blobdiff - build.gradle
Port to 1.19
[BoundingBoxOutlineReloaded.git] / build.gradle
index 55fa7ef4dae4c6901320c5ce39650761fa5e7a57..cfe05e8dc523f83f6b653904741ee28b572a9b0b 100644 (file)
@@ -1,90 +1,87 @@
 buildscript {
     repositories {
-        jcenter()
-        maven { url 'https://repo.spongepowered.org/maven' }
-        maven { url 'https://jitpack.io' }
-        maven { url 'https://files.minecraftforge.net/maven' }
+        mavenCentral()
+        maven {
+            name = 'Fabric'
+            url = 'https://maven.fabricmc.net/'
+        }
+        maven {
+            name = 'Cotton'
+            url = 'https://server.bbkr.space/artifactory/libs-release/'
+        }
     }
     dependencies {
-        classpath 'com.github.Irtimaled:ForgeGradle:' + project.mcVersion + '-SNAPSHOT'
-        classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
+        classpath "net.fabricmc:fabric-loom:0.11-SNAPSHOT"
+        classpath "io.github.juuxel:loom-quiltflower:1.6.0"
     }
 }
 
-apply plugin: 'net.minecraftforge.gradle.tweaker-client'
+apply plugin: 'fabric-loom'
+apply plugin: 'io.github.juuxel.loom-quiltflower'
 apply plugin: 'java'
-apply plugin: 'org.spongepowered.mixin'
+apply plugin: 'idea'
 
 group 'com.irtimaled'
 version project.buildVersion + '-' + project.mcVersion
 archivesBaseName = 'BBOutlineReloaded'
 
-sourceCompatibility = 1.8
-targetCompatibility = 1.8
+sourceCompatibility = JavaVersion.VERSION_17
+targetCompatibility = JavaVersion.VERSION_17
 
-repositories {
-    mavenCentral()
-    maven { url 'https://libraries.minecraft.net/' }
-    maven { url 'https://repo.spongepowered.org/maven/' }
-    maven { url 'https://jitpack.io' }
+tasks.withType(JavaCompile).configureEach {
+    // ensure that the encoding is set to UTF-8, no matter what the system default is
+    // this fixes some edge cases with special characters not displaying correctly
+    // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
+    // If Javadoc is generated, this must be specified in that task too.
+    it.options.encoding = "UTF-8"
+
+    it.options.release = 17
 }
 
 dependencies {
-    implementation('org.spongepowered:mixin:0.7.11-SNAPSHOT') { transitive = false }
-    implementation('net.minecraft:launchwrapper:1.12') { transitive = false }
-    implementation 'org.ow2.asm:asm:6.2'
-    implementation 'org.ow2.asm:asm-commons:6.2'
+    minecraft 'com.mojang:minecraft:' + project.mcVersion
+    mappings 'net.fabricmc:yarn:' + project.mcVersion + '+build.1:v2'
+    modImplementation 'net.fabricmc:fabric-loader:0.13.3'
 }
 
-minecraft {
-    version = project.mcVersion
-    mappings = 'snapshot_20190227'
-    runDir = 'run'
-    tweakClass = 'com.irtimaled.bbor.launch.ClientTweaker'
-    makeObfSourceJar = false
-
-    replace "@VERSION@", project.version
-    replaceIn "com/irtimaled/bbor/Main.java"
-
-    replace "@MC_VERSION@", project.mcVersion
-    replaceIn "com/irtimaled/bbor/Main.java"
+loom {
+    accessWidenerPath = file("src/main/resources/bbor.accesswidener")
 }
 
-mixin {
-    defaultObfuscationEnv notch
-    add sourceSets.main, 'mixins.bbor.refmap.json'
+processResources {
+    filesMatching('fabric.mod.json') {
+        expand version: project.version
+    }
 }
 
-sourceSets {
-    main
-    debug {
-        compileClasspath += main.compileClasspath
+java {
+    toolchain {
+        languageVersion = JavaLanguageVersion.of(17)
     }
+    withSourcesJar()
 }
 
-processResources {
-    filesMatching('profile.json') {
-        expand([
-                'version'      : project.version,
-                'mcVersion'    : project.mcVersion,
-                'tweakClass'   : project.minecraft.tweakClass,
-                'formattedTime': new Date().format("yyyy-MM-dd'T'HH:mm:ss'-08:00'")
+jar {
+    manifest {
+        attributes([
+                "Main-Class": "com.irtimaled.bbor.Main",
+                "Specification-Title": "bbor",
+                "Specification-Vendor": "Irtimaled",
+                "Specification-Version": "1", // We are version 1 of ourselves
+                "Implementation-Title": project.name,
+                "Implementation-Version": "${version}",
+                "Implementation-Vendor": "Irtimaled",
+                "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
         ])
     }
-
-    inputs.property "version", project.version
-    inputs.property "mcVersion", project.mcVersion
 }
 
-jar {
-    finalizedBy reobfJar
-    manifest.attributes(
-            'Main-Class': 'com.irtimaled.bbor.Main'
-    )
-
-    classifier = 'vanilla'
+afterEvaluate {
+    remapJar.classifier = 'fabric'
 }
 
-artifacts {
-    archives jar
+afterEvaluate {
+    migrateMappings.configure {
+        outputDir = project.file("src/main/java")
+    }
 }