2018-08-24 03:47:01 +02:00
buildscript {
repositories {
2020-07-01 06:37:34 +02:00
maven { url = 'https://files.minecraftforge.net/maven' }
2018-08-24 03:47:01 +02:00
jcenter ( )
2020-07-01 06:37:34 +02:00
mavenCentral ( )
2018-08-24 03:47:01 +02:00
}
dependencies {
2021-06-27 14:34:29 +02:00
classpath group: 'net.minecraftforge.gradle' , name: 'ForgeGradle' , version: '5.+' , changing: true
2018-08-24 03:47:01 +02:00
}
}
2020-07-01 06:37:34 +02:00
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
2018-08-24 03:47:01 +02:00
apply plugin: 'com.github.johnrengelman.shadow'
2020-07-01 06:37:34 +02:00
sourceCompatibility = targetCompatibility = compileJava . sourceCompatibility = compileJava . targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
2018-08-24 03:47:01 +02:00
ext . buildNumber = System . getenv ( ) . BUILD_NUMBER ? : "Dev"
minecraft {
2020-07-01 06:37:34 +02:00
mappings channel: 'snapshot' , version: '20200514-1.16'
accessTransformer = file ( 'src/main/resources/META-INF/accesstransformer.cfg' )
runs {
server {
workingDirectory project . file ( 'run' ) . canonicalPath
}
}
2018-08-24 03:47:01 +02:00
}
2020-07-01 06:37:34 +02:00
project . archivesBaseName = "${project.archivesBaseName}-forge-1.16.1"
dependencies {
2021-06-27 13:51:12 +02:00
implementation project ( path: ":DynmapCore" , configuration: "shadow" )
2020-08-04 21:30:54 +02:00
minecraft 'net.minecraftforge:forge:1.16.1-32.0.106'
2020-07-01 06:37:34 +02:00
}
2018-08-24 03:47:01 +02:00
processResources
{
2021-06-27 19:41:51 +02:00
filesMatching ( 'META-INF/mods.toml' ) {
2018-08-24 03:47:01 +02:00
// replace version and mcversion
expand (
version: project . version + '-' + project . ext . buildNumber ,
2020-07-01 06:37:34 +02:00
mcversion: "1.16.1"
2018-08-24 03:47:01 +02:00
)
}
}
shadowJar {
dependencies {
include ( dependency ( ':DynmapCore' ) )
}
2020-07-01 06:37:34 +02:00
archiveName = "Dynmap-${parent.version}-forge-1.16.1.jar"
2018-08-24 03:47:01 +02:00
destinationDir = file '../target'
}
2020-07-01 06:37:34 +02:00
2018-08-24 03:47:01 +02:00
shadowJar . doLast {
task - >
ant . checksum file: task . archivePath
}
2020-07-01 06:37:34 +02:00
afterEvaluate {
2018-08-24 03:47:01 +02:00
reobf {
shadowJar {
2020-07-01 06:37:34 +02:00
mappings = createMcpToSrg . output
2018-08-24 03:47:01 +02:00
}
}
2020-07-01 06:37:34 +02:00
}
2018-08-24 03:47:01 +02:00
task deobfJar ( type: Jar ) {
from sourceSets . main . output
classifier = 'dev'
}
artifacts {
archives deobfJar
}
build . dependsOn ( shadowJar )