Gradle pls

This commit is contained in:
Sollace 2021-02-13 21:53:11 +02:00
parent 841b9ba964
commit 50fa08d73a
3 changed files with 54 additions and 75 deletions

View file

@ -1,54 +1,62 @@
plugins { plugins {
id 'java-library' id 'java-library'
id 'fabric-loom' version '0.4-SNAPSHOT' id 'fabric-loom' version '0.4-SNAPSHOT' apply false
id 'maven-publish'
} }
allprojects { allprojects {
targetCompatibility = JavaVersion.VERSION_1_8 apply plugin: 'fabric-loom'
sourceCompatibility = JavaVersion.VERSION_1_8
version = "${project.minecraft_version}-${project.version}" targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8
if (project.release != 'RELEASE') { version = "${project.minecraft_version}-${project.version}"
version += "-${project.release}"
}
group = project.group if (project.release != 'RELEASE') {
description = project.displayname version += "-${project.release}"
archivesBaseName = project.name }
// check for updates every build when on CI group = project.group
if (System.env.CI) { description = project.displayname
configurations.all { archivesBaseName = project.name
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
}
processResources { // check for updates every build when on CI
inputs.property "version", project.version if (System.env.CI) {
configurations.all {
from(sourceSets.main.resources.srcDirs) { resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
include "fabric.mod.json" }
expand "version": project.version }
}
dependencies {
from(sourceSets.main.resources.srcDirs) { minecraft "com.mojang:minecraft:${project.minecraft_version}"
exclude "fabric.mod.json" mappings "net.fabricmc:yarn:${project.yarn_mappings}"
} modApi "net.fabricmc:fabric-loader:${project.loader_version}"
}
compileOnly "com.google.code.findbugs:jsr305:3.0.2"
tasks.withType(JavaCompile) {
options.encoding = "UTF-8" modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
} }
task sourcesJar(type: Jar, dependsOn: classes) { processResources {
classifier = "sources" inputs.property "version", project.version
from sourceSets.main.allSource
} from(sourceSets.main.resources.srcDirs) {
} include "fabric.mod.json"
subprojects { expand "version": project.version
remapJar.enabled = false }
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 { minecraft {
@ -67,14 +75,6 @@ repositories {
} }
dependencies { 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:MineLittlePony:${project.minelp_version}"
modApi "com.minelittlepony:Kirin:${project.kirin_version}" modApi "com.minelittlepony:Kirin:${project.kirin_version}"
@ -85,5 +85,9 @@ dependencies {
} }
modCompileOnly project(":canvas-compat") modCompileOnly project(":canvas-compat")
include project(":canvas-compat") afterEvaluate {
subprojects.each {
include project(":canvas-compat")
}
}
} }

View file

@ -1,11 +1,5 @@
plugins { plugins {
id 'java-library' id 'java-library'
id 'fabric-loom'
id 'maven-publish'
}
minecraft {
} }
repositories { repositories {
@ -20,14 +14,6 @@ repositories {
} }
dependencies { 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}") { modCompileOnly("grondag:canvas-mc116:${project.canvas_version}") {
exclude(group: "net.fabricmc.fabric-api") exclude(group: "net.fabricmc.fabric-api")
exclude(module: "fabric-loader") exclude(module: "fabric-loader")

View file

@ -1,11 +0,0 @@
pluginManagement {
repositories {
jcenter()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
gradlePluginPortal()
}
}
rootProject.name = 'Unicopia'