even-more-bountiful/build.gradle

115 lines
3.8 KiB
Groovy
Raw Permalink Normal View History

2018-11-03 16:22:32 -06:00
plugins {
2023-07-25 13:12:40 -06:00
id "fabric-loom" version "1.3-SNAPSHOT"
id "legacy-looming" version "1.3-SNAPSHOT" // Version must be the same as fabric-loom's
id "maven-publish"
2023-08-16 22:20:25 -06:00
id 'io.github.juuxel.loom-vineflower' version "1.11.0"
2023-09-29 04:25:25 -06:00
id "com.modrinth.minotaur" version "2.+"
2018-11-03 16:22:32 -06:00
}
version = project.mod_version
2019-02-15 14:25:50 -07:00
group = project.maven_group
2023-09-29 04:25:25 -06:00
projchangelog = project.projchangelog
2018-11-03 16:22:32 -06:00
2023-07-25 13:12:40 -06:00
repositories {}
2020-03-26 14:24:41 -06:00
2021-10-30 14:01:06 -06:00
loom {
2023-08-28 19:09:16 -06:00
accessWidenerPath = file("src/main/resources/emb.accesswidener")
2022-05-23 08:03:19 -06:00
// Only needed for versions not available from vanilla launcher by default.
// customMinecraftManifest.set("https://meta.legacyfabric.net/v2/manifest/${minecraft_version}")
2021-11-11 13:46:38 -07:00
2022-03-20 15:37:41 -06:00
// Required by 1.7.x
2023-08-12 00:16:58 -06:00
runs {
client {
programArgs "--userProperties", "{}"
}
}
2021-10-30 14:01:06 -06:00
}
2020-04-14 01:16:19 -06:00
dependencies {
2020-12-04 01:07:52 -07:00
minecraft "com.mojang:minecraft:${project.minecraft_version}"
2023-04-29 16:04:20 -06:00
mappings(legacy.yarn(project.minecraft_version, project.yarn_build))
2021-11-01 09:39:40 -06:00
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
2020-11-29 22:43:58 -07:00
2023-07-25 13:12:40 -06:00
// Fabric API provides hooks for events, item registration, and more. As most mods will need this, it's included by default.
2022-03-20 15:37:41 -06:00
// If you know for a fact you don't, it's not required and can be safely removed.
2023-07-25 13:12:40 -06:00
modImplementation "net.legacyfabric.legacy-fabric-api:legacy-fabric-api:${project.fabric_version}"
2022-03-20 15:37:41 -06:00
2023-01-13 08:44:40 -07:00
// You can retrieve a specific api module using this notation.
2023-07-25 13:12:40 -06:00
// modImplementation(legacy.apiModule("legacy-fabric-item-groups-v1", project.fabric_version))
2018-11-03 16:22:32 -06:00
}
2018-12-22 09:37:14 -07:00
2023-04-29 16:26:31 -06:00
base {
archivesName = project.archives_base_name
}
processResources {
2020-12-04 01:07:52 -07:00
inputs.property "version", project.version
2021-11-01 10:09:05 -06:00
filesMatching("fabric.mod.json") {
2020-12-04 01:07:52 -07:00
expand "version": project.version
}
}
2023-07-25 13:12:40 -06:00
// Ensure that the encoding is set to UTF-8, no matter what the system default is
2019-02-15 13:55:33 -07:00
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
2021-11-01 10:21:14 -06:00
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
2021-11-23 09:10:42 -07:00
if (JavaVersion.current().isJava9Compatible()) it.options.release = 8
2023-04-29 16:26:31 -06:00
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
2019-02-15 13:55:33 -07:00
}
2021-11-11 13:46:38 -07:00
java {
2021-11-01 10:24:29 -06:00
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
2021-11-11 13:46:38 -07:00
// If you remove this line, sources will not be generated.
withSourcesJar()
2018-12-22 09:37:14 -07:00
}
jar {
2021-11-01 10:24:29 -06:00
from("LICENSE") {
2023-04-29 16:26:31 -06:00
rename { "${it}_${base.archivesName.get()}" }
2021-11-01 10:24:29 -06:00
}
}
2023-09-29 04:25:25 -06:00
//modrinth
import com.modrinth.minotaur.dependencies.ModDependency
tasks.modrinth.dependsOn(tasks.modrinthSyncBody)
modrinth {
token = System.getenv("MODRINTH_TOKEN") // Please use an environment variable for this! The default is `$MODRINTH_TOKEN`.
projectId = "even-more-bountiful" // The ID of your Modrinth project. Slugs will not work.
versionNumber = version // The (preferably SemVer) version of the mod. If not specified, it'll use the `version` declaration
versionType = "alpha" // This is the default -- can also be `beta` or `alpha`
uploadFile = remapJar // Tells Minotaur to use the remapped jar
gameVersions = ["1.7.10"] // An array of game versions the version supports
loaders = ["fabric"] // Self-explanatory.
changelog = projchangelog
dependencies { // A special DSL for creating dependencies
// scope.type
// The scope can be `required`, `optional`, `incompatible`, or `embedded`
// The type can either be `project` or `version`
required.project "legacy-fabric-api" // Creates a new required dependency on Fabric API
// optional.project "legacy-modmenu"//, "modmenu version" // Creates a new optional dependency on this specific version of Sodium
}
syncBodyFrom = rootProject.file("README.md").text
}
2023-07-25 13:12:40 -06:00
// Configure the maven publication
publishing {
2020-12-04 01:07:52 -07:00
publications {
mavenJava(MavenPublication) {
2021-11-11 13:46:38 -07:00
from components.java
2020-12-04 01:07:52 -07:00
}
}
2023-09-29 04:25:25 -06:00
2023-07-25 13:12:40 -06:00
// Select the repositories you want to publish to
2020-12-04 01:07:52 -07:00
repositories {
2023-07-25 13:12:40 -06:00
// Uncomment to publish to the local maven
2020-12-04 01:07:52 -07:00
// mavenLocal()
}
}