From 50fa08d73aa1f14287dc746975725cf2bb550c8e Mon Sep 17 00:00:00 2001 From: Sollace Date: Sat, 13 Feb 2021 21:53:11 +0200 Subject: [PATCH] Gradle pls --- build.gradle | 104 ++++++++++++++++++---------------- canvas-compat/build.gradle | 14 ----- canvas-compat/settings.gradle | 11 ---- 3 files changed, 54 insertions(+), 75 deletions(-) delete mode 100644 canvas-compat/settings.gradle diff --git a/build.gradle b/build.gradle index a389ca5d..b3edbb62 100644 --- a/build.gradle +++ b/build.gradle @@ -1,54 +1,62 @@ plugins { id 'java-library' - id 'fabric-loom' version '0.4-SNAPSHOT' - id 'maven-publish' + id 'fabric-loom' version '0.4-SNAPSHOT' apply false } allprojects { - targetCompatibility = JavaVersion.VERSION_1_8 - sourceCompatibility = JavaVersion.VERSION_1_8 + apply plugin: 'fabric-loom' - version = "${project.minecraft_version}-${project.version}" + targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_1_8 - if (project.release != 'RELEASE') { - version += "-${project.release}" - } + version = "${project.minecraft_version}-${project.version}" - group = project.group - description = project.displayname - archivesBaseName = project.name + if (project.release != 'RELEASE') { + version += "-${project.release}" + } - // check for updates every build when on CI - if (System.env.CI) { - configurations.all { - resolutionStrategy.cacheChangingModulesFor 0, 'seconds' - } - } + group = project.group + description = project.displayname + archivesBaseName = project.name - processResources { - inputs.property "version", project.version - - from(sourceSets.main.resources.srcDirs) { - include "fabric.mod.json" - expand "version": project.version - } - - from(sourceSets.main.resources.srcDirs) { - exclude "fabric.mod.json" - } - } - - tasks.withType(JavaCompile) { - options.encoding = "UTF-8" - } - - task sourcesJar(type: Jar, dependsOn: classes) { - classifier = "sources" - from sourceSets.main.allSource - } -} -subprojects { - remapJar.enabled = false + // check for updates every build when on CI + if (System.env.CI) { + configurations.all { + resolutionStrategy.cacheChangingModulesFor 0, 'seconds' + } + } + + dependencies { + minecraft "com.mojang:minecraft:${project.minecraft_version}" + mappings "net.fabricmc:yarn:${project.yarn_mappings}" + modApi "net.fabricmc:fabric-loader:${project.loader_version}" + + compileOnly "com.google.code.findbugs:jsr305:3.0.2" + + modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" + } + + processResources { + inputs.property "version", project.version + + from(sourceSets.main.resources.srcDirs) { + include "fabric.mod.json" + expand "version": project.version + } + + from(sourceSets.main.resources.srcDirs) { + exclude "fabric.mod.json" + } + } + + tasks.withType(JavaCompile) { + options.encoding = "UTF-8" + } + + task sourcesJar(type: Jar, dependsOn: classes) { + classifier = "sources" + from sourceSets.main.allSource + } } minecraft { @@ -67,14 +75,6 @@ repositories { } dependencies { - minecraft "com.mojang:minecraft:${project.minecraft_version}" - mappings "net.fabricmc:yarn:${project.yarn_mappings}" - modApi "net.fabricmc:fabric-loader:${project.loader_version}" - - compileOnly "com.google.code.findbugs:jsr305:3.0.2" - - modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - modApi "com.minelittlepony:MineLittlePony:${project.minelp_version}" modApi "com.minelittlepony:Kirin:${project.kirin_version}" @@ -85,5 +85,9 @@ dependencies { } modCompileOnly project(":canvas-compat") - include project(":canvas-compat") + afterEvaluate { + subprojects.each { + include project(":canvas-compat") + } + } } diff --git a/canvas-compat/build.gradle b/canvas-compat/build.gradle index 48f5408f..f64796de 100644 --- a/canvas-compat/build.gradle +++ b/canvas-compat/build.gradle @@ -1,11 +1,5 @@ plugins { id 'java-library' - id 'fabric-loom' - id 'maven-publish' -} - -minecraft { - } repositories { @@ -20,14 +14,6 @@ repositories { } dependencies { - minecraft "com.mojang:minecraft:${project.minecraft_version}" - mappings "net.fabricmc:yarn:${project.yarn_mappings}" - modApi "net.fabricmc:fabric-loader:${project.loader_version}" - - compileOnly "com.google.code.findbugs:jsr305:3.0.2" - - modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - modCompileOnly("grondag:canvas-mc116:${project.canvas_version}") { exclude(group: "net.fabricmc.fabric-api") exclude(module: "fabric-loader") diff --git a/canvas-compat/settings.gradle b/canvas-compat/settings.gradle deleted file mode 100644 index a5a8746d..00000000 --- a/canvas-compat/settings.gradle +++ /dev/null @@ -1,11 +0,0 @@ -pluginManagement { - repositories { - jcenter() - maven { - name = 'Fabric' - url = 'https://maven.fabricmc.net/' - } - gradlePluginPortal() - } -} -rootProject.name = 'Unicopia'