ForgePatch/build.gradle

203 lines
6 KiB
Groovy
Raw Normal View History

2013-11-10 03:48:53 +00:00
buildscript {
repositories {
mavenLocal()
2018-08-27 17:10:07 +00:00
maven { url = 'http://files.minecraftforge.net/maven' }
jcenter()
2013-11-10 03:48:53 +00:00
mavenCentral()
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:3.+'
2013-11-10 03:48:53 +00:00
}
}
plugins {
id 'net.minecrell.licenser' version '0.4'
}
2018-08-27 17:10:07 +00:00
apply plugin: 'eclipse'
2013-11-10 03:48:53 +00:00
group = 'net.minecraftforge'
2018-08-27 17:10:07 +00:00
version = '1.0.0'
2018-08-27 17:10:07 +00:00
project(':mcp') {
apply plugin: 'net.minecraftforge.gradle.forgedev.mcp'
mcp {
config = 'de.oceanlabs.mcp:mcp_config:1.13-2018.09.12.04.11.00@zip'
2018-08-27 17:10:07 +00:00
pipeline = 'joined'
}
2018-06-21 06:39:31 +00:00
}
2018-08-27 17:10:07 +00:00
project(':clean') {
evaluationDependsOn(':mcp')
apply plugin: 'eclipse'
apply plugin: 'net.minecraftforge.gradle.forgedev.patcher'
repositories {
mavenCentral()
}
2018-08-27 17:10:07 +00:00
patcher {
parent = project(':mcp')
patchedSrc = file('src/main/java')
mappings channel: 'snapshot', version: '20180813-1.12'
mcVersion = '1.13'
}
2018-09-05 00:23:45 +00:00
task runclient(type: JavaExec) {
doFirst {
mkdir 'runclient'
}
classpath sourceSets.main.runtimeClasspath
args = ['--accessToken', '0', '--version', '1.13']
main 'net.minecraft.client.main.Main'
workingDir 'runclient'
}
}
2018-08-27 17:10:07 +00:00
project(':forge') {
evaluationDependsOn(':clean')
apply plugin: 'java-library'
2018-08-27 17:10:07 +00:00
apply plugin: 'eclipse'
apply plugin: 'net.minecraftforge.gradle.forgedev.patcher'
apply plugin: 'net.minecrell.licenser'
compileJava.sourceCompatibility = compileJava.targetCompatibility = sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
2018-08-27 17:10:07 +00:00
sourceSets {
main {
java {
srcDir "$rootDir/src/main/java"
}
resources {
srcDir "$rootDir/src/main/resources"
}
}
}
2018-08-27 17:10:07 +00:00
repositories {
mavenLocal()
2018-08-27 17:10:07 +00:00
mavenCentral()
}
2018-08-27 17:10:07 +00:00
patcher {
parent = project(':clean')
patches = file("$rootDir/patches/minecraft")
patchedSrc = file('src/main/java')
accessTransformer = file("$rootDir/src/main/resources/forge_at.cfg")
exc = file("$rootDir/src/main/resources/forge.exc")
srgPatches = true
2018-09-10 20:08:35 +00:00
clientRun {
main = 'net.minecraftforge.fml.LaunchTesting'
environment = [
2018-09-10 20:08:35 +00:00
target: 'fmldevclient'
]
properties = [
target: 'fmldevclient',
assetDirectory: downloadAssets.output
]
2018-09-10 20:08:35 +00:00
}
serverRun {
main = 'net.minecraftforge.fml.LaunchTesting'
environment = [
2018-09-10 20:08:35 +00:00
target: 'fmldevserver'
]
}
mcVersion = '1.13'
}
2018-08-27 17:10:07 +00:00
applyPatches {
canonicalizeAccess true
canonicalizeWhitespace true
maxFuzz 3
}
2018-08-27 17:10:07 +00:00
dependencies {
api 'net.minecraft:client:1.13:extra'
api 'cpw.mods:modlauncher:0.1.0-rc.3' //Pinned until cpw fixes getCommonSupertype
api 'net.minecraftforge:accesstransformers:0.10+:shadowed'
api 'net.minecraftforge:eventbus:0.1+:service'
api 'net.minecraftforge:forgespi:0.1+'
api 'net.minecraftforge:coremods:0.1+'
api 'com.electronwill.night-config:core:3.4.0'
api 'com.electronwill.night-config:toml:3.4.0'
api 'org.jline:jline:3.5.1'
api 'org.apache.maven:maven-artifact:3.5.3'
api 'java3d:vecmath:1.5.2'
}
2013-11-20 00:47:50 +00:00
2018-08-27 17:10:07 +00:00
configurations {
ecj
2013-11-10 03:48:53 +00:00
}
2018-08-27 17:10:07 +00:00
dependencies {
ecj 'org.eclipse.jdt.core.compiler:ecj:4.6.1'
}
/* Forge compiles, no longer need eclipse compiler
2018-08-27 17:10:07 +00:00
compileJava {
options.fork = true
options.failOnError = false
options.forkOptions.with {
executable = 'java'
jvmArgs = ['-classpath', project.configurations.ecj.asPath, 'org.eclipse.jdt.internal.compiler.batch.Main', '-nowarn', '-proceedOnError', '-preserveAllLocals', '-parameters']
}
}
*/
2018-09-05 00:23:45 +00:00
task runclient(type: JavaExec, dependsOn: [":forge:downloadAssets", ":forge:extractNatives"]) {
2018-09-05 00:23:45 +00:00
doFirst {
mkdir 'runclient'
}
doFirst {
copy {
from sourceSets.main.resources
into "$buildDir/classes/java/main"
}
}
// jvmArgs = ['-verbose:class']
2018-08-27 17:10:07 +00:00
classpath sourceSets.main.runtimeClasspath
main 'net.minecraftforge.fml.LaunchTesting'
systemProperties = [
"org.lwjgl.util.Debug": "true",
"org.lwjgl.util.DebugLoader": "true"
]
environment += [
target:'fmldevclient',
assetDirectory: file("${gradle.getGradleUserHomeDir()}/caches/forge_gradle/assets/"),
nativesDirectory: extractNatives.output
]
2018-08-27 18:11:24 +00:00
workingDir 'runclient'
}
2018-08-27 17:10:07 +00:00
task runserver(type: JavaExec) {
2018-08-27 18:11:24 +00:00
doFirst {
mkdir 'runserver'
}
2018-08-27 17:10:07 +00:00
classpath sourceSets.main.runtimeClasspath
main 'net.minecraftforge.fml.LaunchTesting'
2018-08-27 18:11:24 +00:00
args 'nogui'
2018-09-10 20:08:35 +00:00
environment target:'fmldevserver'
2018-08-27 18:11:24 +00:00
workingDir 'runserver'
}
license {
header = file("$rootDir/LICENSE-header.txt")
include 'net/minecraftforge/'
exclude 'net/minecraftforge/server/terminalconsole/'
exclude 'net/minecraftforge/fml/common/versioning/ComparableVersion.java'
exclude 'net/minecraftforge/fml/common/versioning/InvalidVersionSpecificationException.java'
exclude 'net/minecraftforge/fml/common/versioning/Restriction.java'
exclude 'net/minecraftforge/fml/common/versioning/VersionRange.java'
tasks {
main {
files = files("$rootDir/src/main/java")
}
test {
files = files("$rootDir/src/test/java")
}
}
}
}
2015-06-29 17:56:23 +00:00
2018-08-27 17:10:07 +00:00
//evaluationDependsOnChildren()
task setup() {
dependsOn ':clean:extractMapped'
dependsOn ':forge:extractMapped' //These must be strings so that we can do lazy resolution. Else we need evaluationDependsOnChildren above
}