baritone/forge/build.gradle

120 lines
3.1 KiB
Groovy
Raw Permalink Normal View History

2022-04-03 04:36:18 +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/>.
*/
import baritone.gradle.task.CreateDistTask
import baritone.gradle.task.ProguardTask
plugins {
2023-08-24 01:47:07 +00:00
id "com.github.johnrengelman.shadow" version "8.0.0"
2022-04-03 04:36:18 +00:00
}
archivesBaseName = archivesBaseName + "-forge"
2022-04-03 04:36:18 +00:00
2023-08-24 01:47:07 +00:00
unimined.minecraft {
2024-05-07 18:07:02 +00:00
minecraftForge {
2023-08-24 01:47:07 +00:00
loader project.forge_version
mixinConfig ["mixins.baritone.json"]
2022-04-03 04:36:18 +00:00
}
}
2022-12-02 06:04:40 +00:00
//loom {
// forge {
// mixinConfig 'mixins.baritone.json'
// }
//}
2022-04-03 04:36:18 +00:00
configurations {
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
}
dependencies {
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
}
shadowCommon "dev.babbaj:nether-pathfinder:${project.nether_pathfinder_version}"
2022-04-03 04:36:18 +00:00
}
processResources {
inputs.property "version", project.version
2022-12-02 06:04:40 +00:00
filesMatching("META-INF/mods.toml") {
2022-04-03 04:36:18 +00:00
expand "version": project.version
}
}
shadowJar {
configurations = [project.configurations.shadowCommon]
2023-08-24 01:47:07 +00:00
archiveClassifier.set "dev-shadow"
2022-04-03 04:36:18 +00:00
}
remapJar {
2022-12-02 06:04:40 +00:00
inputFile.set shadowJar.archiveFile
2022-04-03 04:36:18 +00:00
dependsOn shadowJar
2023-08-24 01:47:07 +00:00
archiveClassifier.set null
2022-04-03 04:36:18 +00:00
}
jar {
2023-08-24 01:47:07 +00:00
archiveClassifier.set "dev"
2022-04-03 04:36:18 +00:00
manifest {
attributes(
'MixinConfigs': 'mixins.baritone.json',
"MixinConnector": "baritone.launch.BaritoneMixinConnector",
'Implementation-Title': 'Baritone',
'Implementation-Version': version,
)
}
}
components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}
task proguard(type: ProguardTask) {
2024-07-21 11:02:03 +00:00
proguardVersion "7.4.2"
compType "forge"
2022-04-03 04:36:18 +00:00
}
task createDist(type: CreateDistTask, dependsOn: proguard) {
compType "forge"
}
2022-04-03 04:36:18 +00:00
build.finalizedBy(createDist)
publishing {
publications {
mavenFabric(MavenPublication) {
artifactId = rootProject.archives_base_name + "-" + project.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.
}
}