EnergonRelics/build.gradle

130 lines
4.0 KiB
Groovy
Raw Normal View History

2020-07-13 20:37:21 +00:00
plugins {
2020-08-06 01:33:50 +00:00
id "fabric-loom" version "0.5-SNAPSHOT"
id "com.matthewprenger.cursegradle" version "1.4.0"
id "maven-publish"
2020-07-13 20:37:21 +00:00
}
compileJava {
2020-08-05 00:54:28 +00:00
sourceCompatibility = JavaVersion.VERSION_1_8
2020-07-13 20:37:21 +00:00
targetCompatibility = JavaVersion.VERSION_1_8
}
2020-08-04 17:06:11 +00:00
version = "${project.mod_version}+${project.minecraft_version}"
group = project.maven_group as Object
2020-07-13 20:37:21 +00:00
2020-08-01 23:28:24 +00:00
loom {
accessWidener "src/main/resources/energonrelics.accesswidener"
2020-07-13 20:37:21 +00:00
}
2020-07-21 02:39:30 +00:00
repositories {
maven {
2020-08-06 01:33:50 +00:00
name = "Earthcomputer Mods"
url = "https://dl.bintray.com/earthcomputer/mods"
2020-07-21 02:39:30 +00:00
}
}
2020-07-13 20:37:21 +00:00
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.minecraft_version}+build.${project.yarn_build}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.fabric_loader_version}"
2020-07-13 20:37:21 +00:00
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
2020-08-06 01:33:50 +00:00
modImplementation("io.github.prospector:modmenu:${project.modmenu_version}") {
exclude group: "net.fabricmc.fabric-api"
}
2020-07-30 19:49:18 +00:00
modCompileOnly "me.shedaniel:RoughlyEnoughItems-api:${project.roughlyenoughitems_version}"
2020-08-06 01:33:50 +00:00
modRuntime("me.shedaniel:RoughlyEnoughItems:${project.roughlyenoughitems_version}") {
exclude group: "net.fabricmc.fabric-api"
}
modImplementation "me.shedaniel.cloth:config-2:${project.cloth_config_version}"
include "me.shedaniel.cloth:config-2:${project.cloth_config_version}"
modImplementation "me.sargunvohra.mcmods:autoconfig1u:${project.autoconfig_version}"
include "me.sargunvohra.mcmods:autoconfig1u:${project.autoconfig_version}"
2020-07-21 02:39:30 +00:00
2020-08-06 01:59:47 +00:00
compileOnly "org.jetbrains:annotations:${project.jetbrains_annotations_version}"
2020-07-13 20:37:21 +00:00
}
2020-08-04 02:08:21 +00:00
publishing {
publications {
2020-08-05 00:54:28 +00:00
//noinspection GroovyAssignabilityCheck
2020-08-04 02:08:21 +00:00
mavenJava(MavenPublication) {
2020-08-05 00:54:28 +00:00
//noinspection GroovyAssignabilityCheck
2020-08-04 02:08:21 +00:00
artifact(remapJar) {
2020-08-05 00:54:28 +00:00
//noinspection GroovyAssignabilityCheck
2020-08-04 02:08:21 +00:00
builtBy remapJar
}
}
}
repositories {
maven {
2020-08-06 01:33:50 +00:00
url "/data/maven"
2020-08-04 02:08:21 +00:00
}
}
}
2020-07-13 20:37:21 +00:00
processResources {
inputs.property "version", project.version
from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"
expand "version": project.version
}
from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
}
// ensure that the encoding is set to UTF-8, no matter what the system default is
// 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
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
2020-08-01 23:28:39 +00:00
classifier "sources"
2020-07-13 20:37:21 +00:00
from sourceSets.main.allSource
}
jar {
from "LICENSE"
}
2020-08-04 17:06:11 +00:00
javadoc {
title "EnergonRelics v${version}"
}
2020-08-06 01:33:50 +00:00
if (project.hasProperty("curseforge.api_key")) {
curseforge {
2020-08-06 01:33:50 +00:00
apiKey = project.getProperty("curseforge.api_key")
//noinspection GroovyAssignabilityCheck
project {
id = project.curseforge_id
2020-08-06 01:33:50 +00:00
changelog = "A changelog can be found at https://gitea.thebrokenrail.com/TheBrokenRail/EnergonRelics/src/branch/master/CHANGELOG.md"
releaseType = mod_version.startsWith("0") || mod_version.endsWith("-unstable") ? "beta" : "release"
addGameVersion project.simple_minecraft_version
2020-08-06 01:33:50 +00:00
addGameVersion "Fabric"
mainArtifact(remapJar) {
displayName = "EnergonRelics v${mod_version} for ${project.minecraft_version}"
}
afterEvaluate {
2020-08-06 01:33:50 +00:00
uploadTask.dependsOn("remapJar")
}
relations {
2020-08-06 01:33:50 +00:00
requiredDependency "fabric-api"
}
}
options {
forgeGradleIntegration = false
}
}
}