dynmap/forge-1.11.2/build.gradle
2021-06-27 13:51:12 +02:00

104 lines
2.4 KiB
Groovy

buildscript {
repositories {
jcenter()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {url = "https://oss.sonatype.org/content/repositories/snapshots/"}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'com.github.johnrengelman.shadow'
dependencies {
implementation project(path: ":DynmapCore", configuration: "shadow")
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
implementation 'org.yaml:snakeyaml:1.23'
implementation 'org.spongepowered:spongeapi:7.0.0'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
ext.buildNumber = System.getenv().BUILD_NUMBER ?: "Dev"
repositories {
maven {
name = 'forge'
url = 'http://files.minecraftforge.net/maven'
}
maven {
name = 'sponge'
url = 'https://repo.spongepowered.org/maven'
}
}
minecraft {
version = "1.11.2-13.20.0.2315"
mappings = "snapshot_20170505"
runDir = 'run'
replaceIn "Version.java"
replace "@VERSION@", project.version + '-' + project.ext.buildNumber
replace "@BUILD_NUMBER@", project.ext.buildNumber
}
project.archivesBaseName = "${project.archivesBaseName}-forge-1.11.2"
processResources
{
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand(
version: project.version + '-' + project.ext.buildNumber,
mcversion: "1.11.2"
)
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
// Move access transformer to META-INF
rename '(.+_at.cfg)', 'META-INF/$1'
}
shadowJar {
dependencies {
include(dependency(':DynmapCore'))
}
archiveName = "Dynmap-${parent.version}-forge-1.11.2.jar"
destinationDir = file '../target'
manifest {
attributes 'FMLAT': 'dynmap_at.cfg'
}
}
shadowJar.doLast {
task ->
ant.checksum file: task.archivePath
}
reobf {
shadowJar {
mappingType = 'SEARGE'
}
}
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'dev'
}
artifacts {
archives deobfJar
}
build.dependsOn(shadowJar)