2019-02-23 00:12:04 +00:00
|
|
|
/*
|
|
|
|
* This file is part of Baritone.
|
|
|
|
*
|
|
|
|
* Baritone is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Baritone is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
group 'baritone'
|
2020-02-14 23:28:37 +00:00
|
|
|
version '1.5.1'
|
2019-02-23 00:12:04 +00:00
|
|
|
|
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
name = 'forge'
|
|
|
|
url = 'http://files.minecraftforge.net/maven'
|
|
|
|
}
|
2019-03-09 05:18:00 +00:00
|
|
|
maven {
|
|
|
|
name = 'impactdevelopment-repo'
|
|
|
|
url = 'https://impactdevelopment.github.io/maven/'
|
|
|
|
}
|
2019-02-23 00:12:04 +00:00
|
|
|
jcenter()
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2019-03-12 06:05:39 +00:00
|
|
|
classpath group: 'com.github.ImpactDevelopment', name: 'ForgeGradle', version: '3.0.115'
|
2019-03-12 06:43:03 +00:00
|
|
|
classpath group: 'com.github.ImpactDevelopment', name: 'MixinGradle', version: '0.6.2'
|
2019-02-23 00:12:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
import baritone.gradle.task.CreateDistTask
|
|
|
|
import baritone.gradle.task.ProguardTask
|
2019-03-15 23:22:51 +00:00
|
|
|
import org.apache.tools.ant.taskdefs.condition.Os
|
2019-02-23 00:12:04 +00:00
|
|
|
|
|
|
|
apply plugin: 'java'
|
2019-03-08 20:30:43 +00:00
|
|
|
apply plugin: 'net.minecraftforge.gradle'
|
2019-03-12 06:05:39 +00:00
|
|
|
apply plugin: 'org.spongepowered.mixin'
|
2019-02-23 00:12:04 +00:00
|
|
|
|
|
|
|
sourceCompatibility = targetCompatibility = '1.8'
|
|
|
|
compileJava {
|
|
|
|
sourceCompatibility = targetCompatibility = '1.8'
|
|
|
|
options.encoding = "UTF-8" // allow emoji in comments :^)
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
2019-03-08 20:30:43 +00:00
|
|
|
api {
|
|
|
|
compileClasspath += main.compileClasspath
|
|
|
|
}
|
|
|
|
main {
|
|
|
|
compileClasspath += api.output
|
|
|
|
}
|
|
|
|
test {
|
2019-03-12 06:05:39 +00:00
|
|
|
compileClasspath += main.compileClasspath + main.runtimeClasspath + main.output
|
2019-03-12 16:38:05 +00:00
|
|
|
runtimeClasspath += main.compileClasspath + main.runtimeClasspath + main.output
|
2019-03-08 20:30:43 +00:00
|
|
|
}
|
2019-02-23 00:12:04 +00:00
|
|
|
launch {
|
|
|
|
compileClasspath += main.compileClasspath + main.runtimeClasspath + main.output
|
2019-03-15 22:32:51 +00:00
|
|
|
runtimeClasspath += main.compileClasspath + main.runtimeClasspath + main.output
|
2019-02-23 00:12:04 +00:00
|
|
|
}
|
2019-07-22 00:54:02 +00:00
|
|
|
|
|
|
|
schematica_api {
|
|
|
|
compileClasspath += main.compileClasspath
|
|
|
|
}
|
2019-07-24 22:38:14 +00:00
|
|
|
|
2019-07-22 00:54:02 +00:00
|
|
|
main {
|
|
|
|
compileClasspath += schematica_api.output
|
|
|
|
}
|
2019-02-23 00:12:04 +00:00
|
|
|
}
|
|
|
|
|
2019-03-12 06:05:39 +00:00
|
|
|
task sourceJar(type: Jar, dependsOn: classes) {
|
|
|
|
classifier = 'sources'
|
|
|
|
from sourceSets.api.allSource
|
2019-02-23 00:12:04 +00:00
|
|
|
}
|
2019-03-08 20:30:43 +00:00
|
|
|
|
|
|
|
minecraft {
|
2020-02-13 20:42:29 +00:00
|
|
|
mappings channel: 'snapshot', version: '20200213-1.15.1'
|
2019-03-09 05:18:00 +00:00
|
|
|
reobfMappings 'notch'
|
2019-03-08 20:30:43 +00:00
|
|
|
|
|
|
|
runs {
|
|
|
|
client {
|
|
|
|
workingDirectory project.file('run')
|
2019-03-15 21:00:11 +00:00
|
|
|
source sourceSets.launch
|
2019-03-12 06:05:39 +00:00
|
|
|
|
|
|
|
main 'baritone.launch.LaunchTesting'
|
|
|
|
|
|
|
|
environment 'assetIndex', '{asset_index}'
|
|
|
|
environment 'assetDirectory', downloadAssets.output
|
|
|
|
environment 'nativesDirectory', extractNatives.output
|
|
|
|
|
|
|
|
environment 'tweakClass', 'baritone.launch.BaritoneTweaker'
|
2019-03-21 22:51:36 +00:00
|
|
|
|
2019-03-15 23:22:51 +00:00
|
|
|
if (Os.isFamily(Os.FAMILY_MAC)) {
|
|
|
|
jvmArgs "-XstartOnFirstThread"
|
|
|
|
}
|
2019-03-12 06:05:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
autoTest {
|
|
|
|
workingDirectory project.file('autotest')
|
2019-03-15 21:00:11 +00:00
|
|
|
source sourceSets.launch
|
2019-03-12 06:05:39 +00:00
|
|
|
|
|
|
|
main 'baritone.launch.LaunchTesting'
|
|
|
|
|
|
|
|
environment 'assetIndex', '{asset_index}'
|
|
|
|
environment 'assetDirectory', downloadAssets.output
|
|
|
|
environment 'nativesDirectory', extractNatives.output
|
|
|
|
|
|
|
|
environment 'tweakClass', 'baritone.launch.BaritoneTweaker'
|
|
|
|
environment 'BARITONE_AUTO_TEST', 'true'
|
2019-03-15 23:22:51 +00:00
|
|
|
|
|
|
|
if (Os.isFamily(Os.FAMILY_MAC)) {
|
|
|
|
jvmArgs "-XstartOnFirstThread"
|
|
|
|
}
|
2019-03-08 20:30:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-02-23 00:12:04 +00:00
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
|
|
|
|
maven {
|
|
|
|
name = 'spongepowered-repo'
|
|
|
|
url = 'http://repo.spongepowered.org/maven/'
|
|
|
|
}
|
|
|
|
|
|
|
|
maven {
|
|
|
|
name = 'impactdevelopment-repo'
|
|
|
|
url = 'https://impactdevelopment.github.io/maven/'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2020-02-05 22:54:03 +00:00
|
|
|
minecraft 'com.github.ImpactDevelopment:Vanilla:1.15.2'
|
2019-03-08 20:30:43 +00:00
|
|
|
|
2019-03-12 06:05:39 +00:00
|
|
|
runtime launchCompile('net.minecraft:launchwrapper:1.12') {
|
|
|
|
exclude module: 'lwjgl'
|
|
|
|
}
|
|
|
|
runtime launchCompile('org.ow2.asm:asm-debug-all:5.2')
|
2019-02-23 00:12:04 +00:00
|
|
|
runtime launchCompile('com.github.ImpactDevelopment:SimpleTweaker:1.2')
|
|
|
|
runtime launchCompile('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
|
|
|
|
// Mixin includes a lot of dependencies that are too up-to-date
|
|
|
|
exclude module: 'launchwrapper'
|
|
|
|
exclude module: 'guava'
|
|
|
|
exclude module: 'gson'
|
|
|
|
exclude module: 'commons-io'
|
|
|
|
exclude module: 'log4j-core'
|
|
|
|
}
|
2019-03-08 20:30:43 +00:00
|
|
|
|
2019-02-23 00:12:04 +00:00
|
|
|
testImplementation 'junit:junit:4.12'
|
|
|
|
}
|
|
|
|
|
|
|
|
mixin {
|
|
|
|
defaultObfuscationEnv searge
|
|
|
|
add sourceSets.launch, 'mixins.baritone.refmap.json'
|
|
|
|
}
|
|
|
|
|
|
|
|
javadoc {
|
|
|
|
options.addStringOption('Xwerror', '-quiet') // makes the build fail on travis when there is a javadoc error
|
|
|
|
options.linkSource true
|
|
|
|
options.encoding "UTF-8" // allow emoji in comments :^)
|
2019-02-23 07:29:08 +00:00
|
|
|
source = sourceSets.api.allJava
|
2019-02-23 00:12:04 +00:00
|
|
|
classpath += sourceSets.api.compileClasspath
|
|
|
|
}
|
|
|
|
|
|
|
|
jar {
|
|
|
|
from sourceSets.launch.output, sourceSets.api.output
|
|
|
|
preserveFileTimestamps = false
|
|
|
|
reproducibleFileOrder = true
|
|
|
|
|
|
|
|
manifest {
|
|
|
|
attributes(
|
|
|
|
'MixinConfigs': 'mixins.baritone.json',
|
|
|
|
|
|
|
|
'Implementation-Title': 'Baritone',
|
|
|
|
'Implementation-Version': version
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task proguard(type: ProguardTask) {
|
|
|
|
url 'https://downloads.sourceforge.net/project/proguard/proguard/6.0/proguard6.0.3.zip'
|
|
|
|
extract 'proguard6.0.3/lib/proguard.jar'
|
|
|
|
}
|
|
|
|
|
|
|
|
task createDist(type: CreateDistTask, dependsOn: proguard)
|
|
|
|
|
|
|
|
build.finalizedBy(createDist)
|