BlueMap/implementations/forge-1.16.2/build.gradle

173 lines
4.6 KiB
Groovy
Raw Normal View History

2020-01-20 14:51:20 +01:00
buildscript {
repositories {
// These repositories are only for Gradle plugins, put any other repositories in the repository block further below
maven { url = 'https://maven.minecraftforge.net' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.0.9', changing: true
}
}
plugins {
id "java"
id "java-library"
id "com.diffplug.spotless" version "6.1.2"
id "com.palantir.git-version" version "0.12.3"
id "com.github.node-gradle.node" version "3.0.1"
id "com.github.johnrengelman.shadow" version "7.1.2"
2020-01-20 14:51:20 +01:00
}
apply plugin: "net.minecraftforge.gradle"
def git = versionDetails()
def releaseProperties = new Properties()
releaseProperties.load(new FileInputStream(file("../../release.properties")))
group = "de.bluecolored.bluemap.forge"
version = releaseProperties.version.toString()
archivesBaseName = 'bluemap'
def javaTarget = 16
java {
sourceCompatibility = JavaVersion.toVersion(javaTarget)
targetCompatibility = JavaVersion.toVersion(javaTarget)
}
2020-01-20 14:51:20 +01:00
minecraft {
mappings channel: 'snapshot', version: '20200514-1.16'
runs {
server {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
mods {
bluemap {
source sourceSets.main
}
}
}
}
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories {
mavenCentral()
maven {
setUrl("https://libraries.minecraft.net")
}
maven {
setUrl("https://jitpack.io")
}
}
configurations {
implementation.extendsFrom(shadowInclude)
}
2020-01-20 14:51:20 +01:00
dependencies {
2020-09-12 13:49:42 +02:00
minecraft 'net.minecraftforge:forge:1.16.3-34.0.0'
shadowInclude ("de.bluecolored.bluemap.common:BlueMapCommon") {
//exclude dependencies provided by fabric
exclude (group: "com.google.guava", module: "guava")
exclude (group: "com.google.code.gson", module: "gson")
exclude (group: "org.apache.commons", module: "commons-lang3")
exclude (group: "commons-io", module: "commons-io")
exclude (group: "com.mojang", module: "brigadier")
}
testImplementation ("org.junit.jupiter:junit-jupiter:5.8.2")
testRuntimeOnly ("org.junit.jupiter:junit-jupiter-engine:5.8.2")
}
spotless {
java {
target ("src/*/java/**/*.java")
licenseHeaderFile("../../HEADER")
indentWithSpaces()
trimTrailingWhitespace()
}
}
jar {
manifest {
attributes([
"Specification-Title" : "bluemap",
"Specification-Vendor" : "bluemap",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : "bluemap",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
jar.finalizedBy('reobfJar')
tasks.withType(JavaCompile).configureEach {
options.encoding = "utf-8"
}
tasks.withType(AbstractArchiveTask).configureEach {
setReproducibleFileOrder(true)
setPreserveFileTimestamps(false)
}
test {
useJUnitPlatform()
}
shadowJar {
destinationDirectory.set(file("../../build/release"))
archiveFileName.set("BlueMap-${archiveVersion.get()}-${project.name}.jar")
configurations = [project.configurations.shadowInclude]
//relocate ("com.flowpowered.math", "de.bluecolored.shadow.flowpowered.math") //DON"T relocate this, because the API depends on it
relocate ("com.typesafe.config", "de.bluecolored.shadow.typesafe.config")
relocate ("net.querz.nbt", "de.bluecolored.shadow.querz.nbt")
relocate ("org.spongepowered.configurate", "de.bluecolored.shadow.configurate")
relocate ("com.github.benmanes.caffeine", "de.bluecolored.shadow.benmanes.caffeine")
relocate ("org.aopalliance", "de.bluecolored.shadow.aopalliance")
relocate ("javax.inject", "de.bluecolored.shadow.javax.inject")
relocate ("org.checkerframework", "de.bluecolored.shadow.checkerframework")
relocate ("org.codehaus", "de.bluecolored.shadow.codehaus")
relocate ("io.leangen.geantyref", "de.bluecolored.shadow.geantyref")
relocate ("com.google.errorprone", "de.bluecolored.shadow.google.errorprone")
relocate ("com.google.inject", "de.bluecolored.shadow.google.inject")
relocate ("org.apache.commons.dbcp2", "de.bluecolored.shadow.apache.commons.dbcp2")
relocate ("org.apache.commons.logging", "de.bluecolored.shadow.apache.commons.logging")
relocate ("org.apache.commons.pool2", "de.bluecolored.shadow.apache.commons.pool2")
}
processResources {
from(sourceSets.main.resources.srcDirs) {
2020-04-04 16:05:56 +02:00
include 'mcmod.info','META-INF/mods.toml'
duplicatesStrategy = DuplicatesStrategy.WARN
expand (
version: project.version
)
}
}
2020-04-04 16:05:56 +02:00
afterEvaluate {
reobf {
shadowJar {
mappings = createMcpToSrg.output
}
}
}
task release {
dependsOn(build)
}