]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/blobdiff - build.gradle
Update to 1.17.1 (#124)
[BoundingBoxOutlineReloaded.git] / build.gradle
index 80a121a5c539ffcb9bd568e61cc17e54a348dcec..eba553db66e82b7b23057de1d94e761a0d8a2e23 100644 (file)
@@ -1,90 +1,80 @@
 buildscript {
     repositories {
         jcenter()
-        maven { url 'https://repo.spongepowered.org/maven' }
-        maven { url 'https://jitpack.io' }
-        maven { url 'https://files.minecraftforge.net/maven' }
+        maven {
+            name = 'Fabric'
+            url = 'https://maven.fabricmc.net/'
+        }
     }
     dependencies {
-        classpath 'com.github.Irtimaled:ForgeGradle:' + project.mcVersion + '-SNAPSHOT'
-        classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
+        classpath "net.fabricmc:fabric-loom:0.8-SNAPSHOT"
     }
 }
 
-apply plugin: 'net.minecraftforge.gradle.tweaker-client'
+apply plugin: 'fabric-loom'
 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_16
+targetCompatibility = JavaVersion.VERSION_16
 
-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"
+
+    // Minecraft 1.17 (21w19a) upwards uses Java 16.
+    it.options.release = 16
 }
 
 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.29'
+    modImplementation 'net.fabricmc:fabric-loader:0.11.6'
 }
 
-minecraft {
-    version = project.mcVersion
-    mappings = 'snapshot_20190624'
-    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 {
+    accessWidener "src/main/resources/bbor.accesswidener"
 }
 
-mixin {
-    defaultObfuscationEnv notch
-    add sourceSets.main, 'mixins.bbor.refmap.json'
+minecraft {
+    refmapName = 'mixins.bbor.refmap.json'
 }
 
-sourceSets {
-    main
-    debug {
-        compileClasspath += main.compileClasspath
+processResources {
+    filesMatching('fabric.mod.json') {
+        expand version: project.version
     }
 }
 
-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'")
-        ])
+java {
+    toolchain {
+        languageVersion = JavaLanguageVersion.of(16)
     }
-
-    inputs.property "version", project.version
-    inputs.property "mcVersion", project.mcVersion
+    withSourcesJar()
 }
 
 jar {
-    finalizedBy reobfJar
-    manifest.attributes(
-            'Main-Class': 'com.irtimaled.bbor.Main'
-    )
-
-    classifier = 'vanilla'
+    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")
+        ])
+    }
 }
 
-artifacts {
-    archives jar
+afterEvaluate {
+    remapJar.classifier = 'fabric'
 }