baritone/tweaker/build.gradle

118 lines
3.4 KiB
Groovy
Raw Normal View History

2022-12-02 06:04:40 +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/>.
*/
2022-04-16 09:57:29 +00:00
import baritone.gradle.task.CreateDistTask
import baritone.gradle.task.ProguardTask
2022-12-02 21:09:47 +00:00
//import baritone.gradle.task.TweakerJsonAssembler
2022-04-16 09:57:29 +00:00
2022-12-02 06:04:40 +00:00
plugins {
2023-08-24 01:47:07 +00:00
id "com.github.johnrengelman.shadow" version "8.0.0"
2022-04-16 09:57:29 +00:00
}
2023-08-24 01:47:07 +00:00
unimined.minecraft {
2022-12-02 06:04:40 +00:00
runs.client = {
mainClass = "net.minecraft.launchwrapper.Launch"
args.addAll(["--tweakClass", "baritone.launch.BaritoneTweaker"])
2022-04-16 09:57:29 +00:00
}
}
configurations {
2022-12-02 06:04:40 +00:00
common
shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this.
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
2022-04-16 09:57:29 +00:00
}
dependencies {
2022-12-02 06:04:40 +00:00
implementation "org.spongepowered:mixin:0.8.5"
// for some reason mixin isn't including these...
implementation "org.ow2.asm:asm:9.3"
implementation "org.ow2.asm:asm-tree:9.3"
implementation "org.ow2.asm:asm-commons:9.3"
implementation "org.ow2.asm:asm-util:9.3"
implementation "org.ow2.asm:asm-analysis:9.3"
2022-04-16 09:57:29 +00:00
implementation 'com.github.ImpactDevelopment:SimpleTweaker:1.2'
2022-04-16 10:22:53 +00:00
implementation('net.minecraft:launchwrapper:of-2.3') {
2022-04-16 09:57:29 +00:00
exclude module: 'lwjgl'
exclude module: 'asm-debug-all'
}
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
2022-12-02 06:04:40 +00:00
// because of multiple sourcesets `common project(":")` doesn't work
for (sourceSet in rootProject.sourceSets) {
if (sourceSet == rootProject.sourceSets.test) continue
if (sourceSet == rootProject.sourceSets.schematica_api) continue
2022-12-02 06:04:40 +00:00
common sourceSet.output
shadowCommon sourceSet.output
}
2022-04-16 09:57:29 +00:00
}
2022-12-02 06:04:40 +00:00
shadowJar {
configurations = [project.configurations.shadowCommon]
2023-08-24 01:47:07 +00:00
archiveClassifier.set "dev-shadow"
2022-04-16 09:57:29 +00:00
}
remapJar {
inputFile.set shadowJar.archiveFile
dependsOn shadowJar
2023-08-24 01:47:07 +00:00
archiveClassifier.set null
}
2022-04-16 09:57:29 +00:00
jar {
2023-08-24 01:47:07 +00:00
archiveClassifier.set "dev"
2022-04-16 09:57:29 +00:00
preserveFileTimestamps = false
reproducibleFileOrder = true
manifest {
attributes(
'MixinConfigs': 'mixins.baritone.json',
"MixinConnector": "baritone.launch.BaritoneMixinConnector",
'Implementation-Title': 'Baritone',
'Implementation-Version': version,
)
}
}
task proguard(type: ProguardTask) {
url 'https://github.com/Guardsquare/proguard/releases/download/v7.2.1/proguard-7.2.1.zip'
extract 'proguard-7.2.1/lib/proguard.jar'
}
task createDist(type: CreateDistTask, dependsOn: proguard)
build.finalizedBy(createDist)
publishing {
publications {
mavenCommon(MavenPublication) {
artifactId = rootProject.archives_base_name
from components.java
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
}
}