From fe47ca04960d32c653c1d2a8d0a36d5eb4df7911 Mon Sep 17 00:00:00 2001 From: Waterpicker <waterpickerenternity@gmail.com> Date: Fri, 11 Mar 2022 02:17:25 -0600 Subject: [PATCH] Updated stuff --- build.gradle | 75 +++++++++++++----------- gradle.properties | 16 +++++ gradle/wrapper/gradle-wrapper.properties | 4 +- settings.gradle | 3 +- 4 files changed, 61 insertions(+), 37 deletions(-) create mode 100644 gradle.properties diff --git a/build.gradle b/build.gradle index 271dd9b..88c2d4b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,54 +1,50 @@ plugins { - id "fabric-loom" version "0.6-SNAPSHOT" - id "org.cadixdev.licenser" version "0.5.0" + id 'fabric-loom' version '0.11-SNAPSHOT' + id 'maven-publish' } -apply plugin: "java" +sourceCompatibility = JavaVersion.VERSION_17 +targetCompatibility = JavaVersion.VERSION_17 -sourceCompatibility = 1.8 -targetCompatibility = 1.8 +archivesBaseName = project.archives_base_name +version = project.mod_version +group = project.maven_group -sourceSets { - testmod +repositories { + // Add repositories to retrieve artifacts from in here. + // You should only use this when depending on other mods because + // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. + // See https://docs.gradle.org/current/userguide/declaring_repositories.html + // for more information about repositories. } dependencies { - minecraft "com.mojang:minecraft:21w08b" - mappings "net.fabricmc:yarn:21w08b+build.8:v2" - modImplementation "net.fabricmc:fabric-loader:0.11.1" - testmodImplementation sourceSets.main.output - testmodCompileOnly sourceSets.main.compileClasspath - testmodRuntimeOnly sourceSets.main.runtimeClasspath - modRuntime("net.fabricmc.fabric-api:fabric-api:0.31.2+1.17") { - exclude module: "fabric-loader" - } -} - -version = "1.0.0" -archivesBaseName = "Matrix" -group = "org.dimdev" + // To change the versions see the gradle.properties file + minecraft "com.mojang:minecraft:${project.minecraft_version}" + mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" + modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" -license { - include '**/*.java' + // Fabric API. This is technically optional, but you probably want it anyway. + modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" } processResources { + inputs.property "version", project.version + filesMatching("fabric.mod.json") { expand "version": project.version } - - inputs.property "version", project.version } tasks.withType(JavaCompile).configureEach { - it.options.encoding = "UTF-8" - def targetVersion = 8 - if (JavaVersion.current().isJava9Compatible()) { - it.options.release.set(targetVersion) - } + // Minecraft 1.18 (1.18-pre2) upwards uses Java 17. + it.options.release = 17 } java { + // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task + // if it is present. + // If you remove this line, sources will not be generated. withSourcesJar() } @@ -58,6 +54,19 @@ jar { } } -artifacts { - archives jar -} +// configure the maven publication +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + } + } + + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. + repositories { + // Add repositories to publish to here. + // Notice: This block does NOT have the same function as the block in the top level. + // The repositories here will be used for publishing your artifact, not for + // retrieving dependencies. + } +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..e9f4ed5 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,16 @@ +# Done to increase the memory available to gradle. +org.gradle.jvmargs=-Xmx1G + +# Fabric Properties +# check these on https://fabricmc.net/develop +minecraft_version=1.18.1 +yarn_mappings=1.18.1+build.1 +loader_version=0.12.12 + +# Mod Properties +mod_version = 1.0.0 +maven_group = org.dimdev +archives_base_name = matrix + +# Dependencies +fabric_version=0.46.2+1.18 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4d9ca16..856da69 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists +zipStorePath=wrapper/dists \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index c0075e8..eb18313 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,12 +1,11 @@ pluginManagement { repositories { - jcenter() maven { name = 'Fabric' url = 'https://maven.fabricmc.net/' } - gradlePluginPortal() mavenCentral() + gradlePluginPortal() } }