2021-11-20 12:31:18 +01:00
|
|
|
buildscript {
|
2022-01-15 01:18:02 +01:00
|
|
|
repositories {
|
|
|
|
// These repositories are only for Gradle plugins, put any other repositories in the repository block further below
|
2021-11-20 12:31:18 +01:00
|
|
|
maven { url = 'https://maven.minecraftforge.net' }
|
2022-01-15 01:18:02 +01:00
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
dependencies {
|
|
|
|
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
id "java"
|
|
|
|
id "java-library"
|
|
|
|
id "com.diffplug.spotless" version "6.1.2"
|
|
|
|
id "com.github.node-gradle.node" version "3.0.1"
|
|
|
|
id "com.github.johnrengelman.shadow" version "7.1.2"
|
2022-10-24 23:24:41 +02:00
|
|
|
id "com.modrinth.minotaur" version "2.+"
|
2022-11-11 13:13:54 +01:00
|
|
|
id "com.matthewprenger.cursegradle" version "1.4.0"
|
2021-11-20 12:31:18 +01:00
|
|
|
}
|
|
|
|
|
2022-01-15 01:18:02 +01:00
|
|
|
apply plugin: "net.minecraftforge.gradle"
|
|
|
|
|
|
|
|
group = "de.bluecolored.bluemap.forge"
|
2022-07-30 16:07:10 +02:00
|
|
|
version = System.getProperty("bluemap.version") ?: "?" // set by BlueMapCore
|
2022-01-15 01:18:02 +01:00
|
|
|
archivesBaseName = 'bluemap'
|
|
|
|
|
|
|
|
def javaTarget = 16
|
|
|
|
java {
|
|
|
|
sourceCompatibility = JavaVersion.toVersion(javaTarget)
|
|
|
|
targetCompatibility = JavaVersion.toVersion(javaTarget)
|
|
|
|
}
|
2021-11-20 15:06:52 +01:00
|
|
|
|
2021-11-20 12:31:18 +01:00
|
|
|
minecraft {
|
2022-01-15 01:18:02 +01:00
|
|
|
mappings channel: 'official', version: '1.17.1'
|
|
|
|
|
|
|
|
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")
|
|
|
|
}
|
2021-11-20 12:31:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
configurations {
|
2022-01-15 01:18:02 +01:00
|
|
|
implementation.extendsFrom(shadowInclude)
|
2021-11-20 12:31:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
minecraft 'net.minecraftforge:forge:1.17.1-37.0.109'
|
2022-01-15 01:18:02 +01:00
|
|
|
|
|
|
|
shadowInclude ("de.bluecolored.bluemap.common:BlueMapCommon") {
|
2022-04-24 16:17:35 +02:00
|
|
|
//exclude dependencies provided by forge
|
2022-01-15 01:18:02 +01:00
|
|
|
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"))
|
2022-07-30 16:07:10 +02:00
|
|
|
archiveFileName.set("BlueMap-${project.version}-${project.name}.jar")
|
2022-07-27 15:10:23 +02:00
|
|
|
|
2022-01-15 01:18:02 +01:00
|
|
|
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")
|
2023-05-09 22:52:29 +02:00
|
|
|
relocate ("io.airlift", "de.bluecolored.shadow.airlift")
|
2022-01-15 01:18:02 +01:00
|
|
|
|
|
|
|
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")
|
2021-11-20 12:31:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
processResources {
|
|
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
|
|
include 'mcmod.info','META-INF/mods.toml'
|
|
|
|
duplicatesStrategy = DuplicatesStrategy.WARN
|
2022-01-15 01:18:02 +01:00
|
|
|
|
2021-11-20 12:31:18 +01:00
|
|
|
expand (
|
2022-01-15 01:18:02 +01:00
|
|
|
version: project.version
|
2021-11-20 12:31:18 +01:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
afterEvaluate {
|
|
|
|
reobf {
|
|
|
|
shadowJar {
|
|
|
|
mappings = createMcpToSrg.output
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-01-15 01:18:02 +01:00
|
|
|
|
|
|
|
task release {
|
|
|
|
dependsOn(build)
|
|
|
|
}
|
2022-10-24 23:24:41 +02:00
|
|
|
|
|
|
|
modrinth {
|
|
|
|
token = System.getenv("MODRINTH_TOKEN")
|
|
|
|
projectId = "swbUV1cr"
|
|
|
|
versionNumber = "${project.version}-${project.name}"
|
|
|
|
changelog = "Releasenotes and Changelog:\nhttps://github.com/BlueMap-Minecraft/BlueMap/releases/tag/v${project.version}"
|
|
|
|
uploadFile = shadowJar
|
|
|
|
gameVersions = ["1.17.1"]
|
|
|
|
}
|
|
|
|
|
2022-11-11 13:13:54 +01:00
|
|
|
curseforge {
|
2022-11-11 13:27:56 +01:00
|
|
|
apiKey = System.getenv("CURSEFORGE_TOKEN") ?: ""
|
2022-11-11 13:13:54 +01:00
|
|
|
project {
|
|
|
|
id = "406463"
|
|
|
|
changelogType = "markdown"
|
|
|
|
changelog = "**Releasenotes and Changelog:**\n\nhttps://github.com/BlueMap-Minecraft/BlueMap/releases/tag/v${project.version}"
|
|
|
|
releaseType = "release"
|
|
|
|
|
|
|
|
addGameVersion "Forge"
|
|
|
|
|
|
|
|
addGameVersion "Java 18"
|
|
|
|
addGameVersion "Java 17"
|
|
|
|
addGameVersion "Java 16"
|
|
|
|
|
|
|
|
addGameVersion "1.17.1"
|
|
|
|
|
|
|
|
mainArtifact shadowJar
|
|
|
|
}
|
|
|
|
options {
|
|
|
|
javaVersionAutoDetect = false
|
|
|
|
javaIntegration = false
|
|
|
|
forgeGradleIntegration = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-24 23:24:41 +02:00
|
|
|
task publish {
|
|
|
|
dependsOn(tasks.findByName("modrinth"))
|
2022-11-11 13:13:54 +01:00
|
|
|
dependsOn(tasks.findByName("curseforge"))
|
2022-10-24 23:24:41 +02:00
|
|
|
}
|