ReFramed/build.gradle

135 lines
3.0 KiB
Groovy
Raw Normal View History

2019-06-18 11:33:36 +02:00
buildscript {
repositories {
maven {
name = "Fabric"
url = "https://maven.fabricmc.net/"
content {
includeGroup "net.fabricmc"
includeGroup "fabric-loom"
}
2019-06-18 11:33:36 +02:00
}
mavenCentral()
2019-06-18 11:33:36 +02:00
}
dependencies {
classpath "fabric-loom:fabric-loom.gradle.plugin:1.1.14"
2019-06-18 11:33:36 +02:00
}
}
plugins {
id "com.jfrog.artifactory" version "4.9.0"
}
apply plugin: "fabric-loom"
apply plugin: "maven-publish"
2019-06-18 11:33:36 +02:00
2023-06-15 08:06:21 +02:00
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
java.withSourcesJar()
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
2023-06-15 08:06:21 +02:00
options.release = 17
}
2019-06-18 11:33:36 +02:00
if(rootProject.file("private.gradle").exists()) { //Publishing details
apply from: "private.gradle"
2019-06-18 11:33:36 +02:00
}
2019-06-20 00:29:15 +02:00
archivesBaseName = "templates"
2019-06-18 11:33:36 +02:00
group = "io.github.cottonmc"
2023-07-21 01:59:17 +02:00
version = "2.0.2+1.20.1"
2019-06-18 11:33:36 +02:00
repositories {
mavenCentral()
2023-07-21 02:33:51 +02:00
maven {
url = "https://maven.terraformersmc.com/releases/"
content {
includeGroup "com.terraformersmc"
}
}
2019-06-18 11:33:36 +02:00
}
dependencies {
2023-06-15 08:06:21 +02:00
minecraft "com.mojang:minecraft:1.20.1"
mappings "net.fabricmc:yarn:1.20.1+build.2"
modApi "net.fabricmc:fabric-loader:0.14.21"
2023-06-15 08:06:21 +02:00
modApi "net.fabricmc.fabric-api:fabric-api:0.83.1+1.20.1"
2019-06-18 11:33:36 +02:00
implementation "com.google.code.findbugs:jsr305:3.0.2"
2023-07-21 02:33:51 +02:00
modRuntimeOnly "com.terraformersmc:modmenu:7.2.1"
2019-06-18 11:33:36 +02:00
}
2023-07-11 10:16:48 +02:00
loom {
mixin {
defaultRefmapName = "templates.refmap.json" //see templates.mixins.json. I just like to always specify the name
}
}
2019-06-18 11:33:36 +02:00
processResources {
inputs.property "version", project.version
filesMatching("**/fabric.mod.json") {
expand "version": project.version
2019-06-18 11:33:36 +02:00
}
}
jar {
from "LICENSE"
}
// configure the maven publication
// TODO: i'm far from a maven guru, this is probably broken & idk how to fix it -quat
2019-06-18 11:33:36 +02:00
publishing {
publications {
maven(MavenPublication) {
// add all the jars that should be included when publishing to maven
//artifact(jar) {
// builtBy remapJar
//}
artifact ("${project.buildDir.absolutePath}/libs/${archivesBaseName}-${project.version}.jar") { //release jar - file location not provided anywhere in loom
classifier null
builtBy remapJar
}
artifact ("${project.buildDir.absolutePath}/libs/${archivesBaseName}-${project.version}-dev.jar") { //release jar - file location not provided anywhere in loom
classifier "dev"
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}
// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
// mavenLocal()
}
}
artifactory {
if (project.hasProperty("artifactoryUsername")) {
contextUrl = "http://server.bbkr.space:8081/artifactory/"
publish {
repository {
if (version.contains("SNAPSHOT")) {
repoKey = "libs-snapshot"
} else {
repoKey = "libs-release"
}
username = artifactoryUsername
password = artifactoryPassword
}
defaults {
publications("maven")
publishArtifacts = true
publishPom = true
}
}
} else {
println "Cannot configure artifactory; please define ext.artifactoryUsername and ext.artifactoryPassword before running artifactoryPublish"
}
}