buildscript { repositories { maven { name = "Fabric" url = "https://maven.fabricmc.net/" content { includeGroup "net.fabricmc" includeGroup "fabric-loom" } } mavenCentral() } dependencies { classpath "fabric-loom:fabric-loom.gradle.plugin:1.1.14" } } plugins { id "com.jfrog.artifactory" version "4.9.0" } apply plugin: "fabric-loom" apply plugin: "maven-publish" tasks.withType(JavaCompile) { options.encoding = "UTF-8" sourceCompatibility = 1.8 targetCompatibility = 1.8 } java.withSourcesJar() if(rootProject.file("private.gradle").exists()) { //Publishing details apply from: "private.gradle" } archivesBaseName = "templates" group = "io.github.cottonmc" version = "1.0.7+1.14.4" repositories { mavenCentral() } dependencies { minecraft "com.mojang:minecraft:1.14.4" mappings "net.fabricmc:yarn:1.14.4+build.18" modApi "net.fabricmc:fabric-loader:0.14.21" modApi "net.fabricmc.fabric-api:fabric-api:0.28.5+1.14" implementation "com.google.code.findbugs:jsr305:3.0.2" } processResources { inputs.property "version", project.version filesMatching("**/fabric.mod.json") { expand "version": project.version } } 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 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" } }