mirror of
https://github.com/PuzzleMC/Puzzle.git
synced 2025-12-15 19:35:10 +01:00
Modulized into: puzzle-base (update checker + config) puzzle-gui (unified config gui) puzzle-models (remove limitations) puzzle-blocks (custom render layers) puzzle-splashscreen (resourcepack-provided spash screen) Updated to 1.17
138 lines
3.9 KiB
Groovy
Executable File
138 lines
3.9 KiB
Groovy
Executable File
// Based on https://github.com/OnyxStudios/Cardinal-Components-API/blob/1.17/build.gradle
|
|
plugins {
|
|
id "fabric-loom" version "0.8-SNAPSHOT" apply false
|
|
id "com.matthewprenger.cursegradle" version "1.4.0"
|
|
id "maven-publish"
|
|
id "java-library"
|
|
}
|
|
|
|
group = "net.puzzlemc"
|
|
archivesBaseName = "puzzle"
|
|
|
|
subprojects {
|
|
apply plugin: 'fabric-loom'
|
|
apply plugin: 'com.matthewprenger.cursegradle'
|
|
apply plugin: 'maven-publish'
|
|
apply plugin: 'java-library'
|
|
|
|
archivesBaseName = project.name
|
|
group = "${rootProject.group}.${rootProject.archivesBaseName}"
|
|
|
|
//apply from: "https://raw.githubusercontent.com/OnyxStudios/Gradle-Scripts/master/scripts/fabric/basic_project.gradle"
|
|
}
|
|
|
|
allprojects {
|
|
apply plugin: "fabric-loom"
|
|
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_16
|
|
version = System.getenv("TRAVIS_TAG") ?: rootProject.mod_version
|
|
|
|
configurations {
|
|
dev
|
|
}
|
|
|
|
repositories {
|
|
maven { url 'https://jitpack.io' }
|
|
|
|
}
|
|
|
|
dependencies {
|
|
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
|
|
mappings "net.fabricmc:yarn:${rootProject.yarn_mappings}:v2"
|
|
modApi "net.fabricmc:fabric-loader:${rootProject.loader_version}"
|
|
modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_version}"
|
|
}
|
|
|
|
processResources {
|
|
inputs.property "version", project.version
|
|
|
|
filesMatching("fabric.mod.json") {
|
|
expand "version": project.version
|
|
}
|
|
}
|
|
|
|
// 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
|
|
tasks.withType(JavaCompile).configureEach {
|
|
it.options.encoding = "UTF-8"
|
|
it.options.release = 16
|
|
}
|
|
|
|
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()
|
|
}
|
|
|
|
jar {
|
|
}
|
|
|
|
afterEvaluate {
|
|
artifacts {
|
|
dev file: file("${project.buildDir}/libs/$archivesBaseName-${version}-dev.jar"), type: "jar", builtBy: sourcesJar
|
|
}
|
|
}
|
|
}
|
|
|
|
subprojects {
|
|
version = rootProject.version
|
|
}
|
|
|
|
sourceSets {
|
|
testmod {
|
|
compileClasspath += main.compileClasspath
|
|
runtimeClasspath += main.runtimeClasspath
|
|
}
|
|
test {
|
|
compileClasspath += main.compileClasspath
|
|
runtimeClasspath += main.runtimeClasspath
|
|
}
|
|
}
|
|
|
|
subprojects.each { remapJar.dependsOn("${it.path}:remapJar") }
|
|
|
|
repositories {
|
|
maven {
|
|
name = "JitPack"
|
|
url = "https://jitpack.io"
|
|
}
|
|
maven {
|
|
name = "TerraformersMC"
|
|
url = "https://maven.terraformersmc.com/releases"
|
|
}
|
|
|
|
}
|
|
|
|
dependencies {
|
|
modImplementation "net.fabricmc.fabric-api:fabric-api:0.34.8+1.17"
|
|
modImplementation ("com.terraformersmc:modmenu:${project.mod_menu_version}") {
|
|
exclude group: "net.fabricmc.fabric-api"
|
|
}
|
|
|
|
subprojects.each {
|
|
api project(path: ":${it.name}", configuration: "dev")
|
|
include project(":${it.name}")
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
artifact(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar")) {
|
|
builtBy(remapJar)
|
|
}
|
|
pom.withXml {
|
|
def depsNode = asNode().appendNode("dependencies")
|
|
subprojects.each {
|
|
def depNode = depsNode.appendNode("dependency")
|
|
depNode.appendNode("groupId", it.group)
|
|
depNode.appendNode("artifactId", it.name)
|
|
depNode.appendNode("version", it.version)
|
|
depNode.appendNode("scope", "compile")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|