fabric/build.gradle

237 lines
5.4 KiB
Groovy
Raw Normal View History

plugins {
id 'java'
id 'eclipse'
id 'idea'
id 'maven-publish'
2019-07-24 17:07:45 -04:00
id 'fabric-loom' version '0.2.5-SNAPSHOT' apply false
id 'net.minecrell.licenser' version '0.4.1'
id "org.ajoberstar.grgit" version "3.1.1"
2019-05-11 18:00:57 -04:00
id 'com.matthewprenger.cursegradle' version "1.1.2"
}
def ENV = System.getenv()
class Globals {
Bring dimension API to 1.15 branch (#373) * Update versioning to match 1.15 branch * Fix builtin mods being added as resource packs * Update fabric-loader to replace deprecated methods * Add more metadata to the modules (#353) * Add fabric-api-base as a dep to fabric-networking-v0 * Allow for running fabric-api-base on the server-side environment (#360) * Set curse version to 1.14.4 Also forces it to build again * Fix NPE in fluid renderer mixin (#361) * Fix NPE in fluid renderer mixin * Ensure state, view, and pos are never null * Bump fabric-rendering-fluids-v1 version * Cooler dimension API, #309 (#319) * pyro API * Update fabric-dimensions-v1/src/main/java/net/fabricmc/fabric/api/dimension/EntityPlacer.java clarify portalDir param Co-Authored-By: Pyrofab <redstoneinfire@gmail.com> * Update fabric-dimensions-v1/src/main/java/net/fabricmc/fabric/api/dimension/EntityPlacer.java rename & clarify verticalOffset param Co-Authored-By: Pyrofab <redstoneinfire@gmail.com> * Update fabric-dimensions-v1/src/main/java/net/fabricmc/fabric/api/dimension/FabricDimensions.java Co-Authored-By: Pyrofab <redstoneinfire@gmail.com> * Update fabric-dimensions-v1/src/main/java/net/fabricmc/fabric/api/dimension/EntityPlacer.java Co-Authored-By: Pyrofab <redstoneinfire@gmail.com> * update parameter * Add fabric-networking and fabric-registry-sync to dependencies * Refactor FabricDimensionType to use a builder Also adds a desiredRawId field separate from the actual raw id fixed internally. The fixedRawId field is now set by DimensionIdsFixer through reflection. This change addresses concerns about the ability for any mod to set a FabricDimensionType's raw id at any time. * Improve javadoc of FabricDimensions#teleport * Add an overload for FabricDimensions#teleport * Update javadoc on DimensionIdsFixer * Inline clientside packet handling * Add side assertions to FabricDimensions#teleport * Nuke minecraft's attempts to overwrite bad level properties * Add license headers * Reformat dimension API source code * Update FabricDimensionType javadoc * Remove redundant ThreadLocal from FabricDimensionInternals * Fix crash on dedicated servers * Fix Illegal Access during remapping * Fix dimension remap exception propagation * clarify EntityPlacer docs * spacing fixes * api.dimension -> api.dimension.v1 * Increment API patch version Signifies inclusion of new Dimension API * Partial fix to FabricDimensionType * Bump dimension version * Updates based on feedback
2019-09-22 11:32:08 -04:00
static def baseVersion = "0.3.3"
static def mcVersion = "19w38b"
2019-09-18 14:01:22 -04:00
static def yarnVersion = "+build.4"
}
import org.apache.commons.codec.digest.DigestUtils
def getSubprojectVersion(project, version) {
if (grgit == null) {
return version + "+nogit"
}
def latestCommits = grgit.log(paths: [project.name], maxCommits: 1)
if (latestCommits.isEmpty()) {
return version + "+uncommited"
} else {
return version + "+" + latestCommits.get(0).id.substring(0, 8) + DigestUtils.sha256Hex(Globals.mcVersion).substring(0, 2)
}
}
def getBranch(){
2019-08-27 15:26:27 -04:00
if(System.getenv().GIT_BRANCH){
2019-08-27 15:40:07 -04:00
def branch = System.getenv().GIT_BRANCH
return branch.substring(branch.lastIndexOf("/") + 1)
2019-08-27 15:26:27 -04:00
}
if (grgit == null) {
return "unknown"
}
return grgit.branch.current().name
}
allprojects {
apply plugin: 'maven-publish'
apply plugin: 'fabric-loom'
apply plugin: 'net.minecrell.licenser'
2018-12-14 13:48:37 -05:00
sourceCompatibility = 1.8
targetCompatibility = 1.8
2019-04-24 13:15:08 -04:00
group = "net.fabricmc.fabric-api"
dependencies {
minecraft "com.mojang:minecraft:$Globals.mcVersion"
mappings "net.fabricmc:yarn:${Globals.mcVersion}${Globals.yarnVersion}"
2019-09-18 18:24:15 -04:00
modCompile "net.fabricmc:fabric-loader:0.6.2+build.166"
}
2018-12-09 11:47:35 -05:00
configurations {
dev
}
repositories {
mavenLocal()
}
2019-07-24 17:07:45 -04:00
jar {
classifier = "dev"
}
afterEvaluate {
2019-07-24 17:07:45 -04:00
remapJar {
input = file("${project.buildDir}/libs/$archivesBaseName-${version}-dev.jar")
archiveName = "${archivesBaseName}-${version}.jar"
}
artifacts {
dev file: file("${project.buildDir}/libs/$archivesBaseName-${version}-dev.jar"), type: "jar", builtBy: jar
}
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"
}
}
license {
header rootProject.file('HEADER')
include '**/*.java'
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
}
javadoc{
options.memberLevel = "PACKAGE"
allprojects.each{
source( it.sourceSets.main.allJava.srcDirs)
}
classpath = sourceSets.main.compileClasspath
2018-12-22 10:21:31 -05:00
}
subprojects {
task remapMavenJar(type: Copy, dependsOn: remapJar) {
afterEvaluate {
from("${project.buildDir}/libs/$archivesBaseName-${version}.jar")
into("${project.buildDir}/libs/")
rename { String fn -> "$archivesBaseName-${version}-maven.jar" }
}
}
2019-04-23 19:14:43 -04:00
publishing {
publications {
mavenJava(MavenPublication) {
artifact(file("${project.buildDir}/libs/$archivesBaseName-${version}-maven.jar")) {
builtBy remapMavenJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
2019-07-24 17:07:45 -04:00
}
2019-04-23 19:14:43 -04:00
repositories {
maven {
url "http://mavenupload.modmuss50.me/"
if (project.hasProperty('mavenPass')) {
credentials {
username 'buildslave'
password project.getProperty('mavenPass')
}
}
}
}
}
javadoc.enabled = false
}
task remapMavenJar(type: net.fabricmc.loom.task.RemapJarTask, dependsOn: jar) {
afterEvaluate {
input = file("${project.buildDir}/libs/${archivesBaseName}-${version}-dev.jar")
2019-07-24 17:07:45 -04:00
archiveName = "${archivesBaseName}-${version}-maven.jar"
addNestedDependencies = false
}
}
publishing {
publications {
mavenJava(MavenPublication) {
2019-04-23 19:14:43 -04:00
artifact(file("${project.buildDir}/libs/$archivesBaseName-${version}-maven.jar")) {
builtBy remapMavenJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
pom.withXml {
def depsNode = asNode().appendNode("dependencies")
subprojects.each {
def depNode = depsNode.appendNode("dependency")
depNode.appendNode("groupId", it.group)
depNode.appendNode("artifactId", it.name)
2019-05-17 10:20:37 -04:00
depNode.appendNode("version", it.version)
depNode.appendNode("scope", "compile")
}
}
}
}
2019-04-23 19:14:43 -04:00
repositories {
maven {
url "http://mavenupload.modmuss50.me/"
if (project.hasProperty('mavenPass')) {
credentials {
username 'buildslave'
password project.getProperty('mavenPass')
}
}
}
}
}
task licenseFormatAll
subprojects { p -> licenseFormatAll.dependsOn("${p.path}:licenseFormat") }
subprojects.each { remapJar.dependsOn("${it.path}:remapJar") }
dependencies {
afterEvaluate {
subprojects.each {
compile project(path: ":${it.name}", configuration: "dev")
include project("${it.name}:")
}
}
}
version = Globals.baseVersion + "+" + (ENV.BUILD_NUMBER ? ("build." + ENV.BUILD_NUMBER) : "local") + "-" + getBranch()
2019-08-27 15:26:27 -04:00
logger.lifecycle("Building Fabric: " + version)
2019-05-11 18:00:57 -04:00
curseforge {
if (project.hasProperty('curse_api_key')){
apiKey = project.getProperty('curse_api_key')
}
project {
id = '306612'
changelog = 'A changelog can be found at https://github.com/FabricMC/fabric/commits/master'
2019-06-03 13:02:38 -04:00
releaseType = 'alpha'
addGameVersion '1.15-Snapshot'
2019-05-11 18:00:57 -04:00
mainArtifact(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar")) {
displayName = "[$Globals.mcVersion] Fabric API $Globals.baseVersion build $ENV.BUILD_NUMBER"
2019-05-11 18:00:57 -04:00
}
afterEvaluate {
uploadTask.dependsOn("remapJar")
}
}
options{
forgeGradleIntegration = false
}
}
2018-12-14 13:48:37 -05:00
apply from: 'https://github.com/FabricMC/fabric-docs/raw/master/gradle/ideconfig.gradle'