baritone/build.gradle

138 lines
4.3 KiB
Groovy
Executable File

/*
* 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/>.
*/
allprojects {
apply plugin: 'java'
apply plugin: "xyz.wagyourtail.unimined"
apply plugin: "maven-publish"
archivesBaseName = rootProject.archives_base_name
def vers = 'git describe --always --tags --dirty'.execute().text.trim()
if (!vers.startsWith("v")) {
println "git doesn't appear to be installed!"
println "using version number: " + rootProject.mod_version
version = rootProject.mod_version
} else {
version = vers.substring(1)
}
group = rootProject.maven_group
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
repositories {
maven {
name = 'spongepowered-repo'
url = 'https://repo.spongepowered.org/repository/maven-public/'
}
maven {
name = 'fabric-maven'
url = 'https://maven.fabricmc.net/'
}
maven {
name = 'impactdevelopment-repo'
url = 'https://impactdevelopment.github.io/maven/'
}
maven {
name = "ldtteam"
url = "https://maven.parchmentmc.net/"
}
// for the newer version of launchwrapper
maven {
name = "multimc-maven"
url = "https://files.multimc.org/maven/"
metadataSources {
artifact()
}
}
mavenCentral()
}
dependencies {
minecraft "net.minecraft:minecraft:${rootProject.minecraft_version}"
// The following line declares the mojmap mappings, you may use other mappings as well
mappings "net.fabricmc:intermediary:${rootProject.minecraft_version}:v2"
mappings "net.minecraft:minecraft:${rootProject.minecraft_version}:client-mappings"
mappings "org.parchmentmc.data:parchment-1.19.2:2022.11.27@zip"
implementation "org.spongepowered:mixin:0.8.5"
implementation "org.ow2.asm:asm:9.3"
// The following line declares the yarn mappings you may select this one as well.
// mappings "net.fabricmc:yarn:1.17.1+build.32:v2"
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
def targetVersion = 17
if (JavaVersion.current().isJava9Compatible()) {
it.options.release = targetVersion
}
}
}
minecraft {
runs.off = true
}
archivesBaseName = archivesBaseName + "-common"
sourceSets {
api {
compileClasspath += main.compileClasspath
runtimeClasspath += main.runtimeClasspath
}
main {
compileClasspath += api.output
runtimeClasspath += api.output
}
test {
compileClasspath += main.compileClasspath + main.runtimeClasspath + main.output
runtimeClasspath += main.compileClasspath + main.runtimeClasspath + main.output
}
launch {
compileClasspath += main.compileClasspath + main.runtimeClasspath + main.output
runtimeClasspath += main.compileClasspath + main.runtimeClasspath + main.output
}
schematica_api {
compileClasspath += main.compileClasspath
runtimeClasspath += main.runtimeClasspath
}
main {
compileClasspath += schematica_api.output
runtimeClasspath += schematica_api.output
}
}
dependencies {
testImplementation 'junit:junit:4.13.2'
}
jar {
from sourceSets.main.output, sourceSets.launch.output, sourceSets.api.output
}
remapJar {
target = "mojmap"
}
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 :^)
source = sourceSets.api.allJava
classpath += sourceSets.api.compileClasspath
}