Skip to content

Instantly share code, notes, and snippets.

@falseresync
Created July 3, 2019 15:38
Show Gist options
  • Save falseresync/a56e2a2936ab4714296ffd1dca05c379 to your computer and use it in GitHub Desktop.
Save falseresync/a56e2a2936ab4714296ffd1dca05c379 to your computer and use it in GitHub Desktop.
plugins {
id "fabric-loom" version "0.2.4-SNAPSHOT" apply false
id "com.jfrog.artifactory" version "4.9.0" apply false
}
def minecraft = "1.14.3"
def mappings = "1.14.3+build.12"
def loader = "0.4.8+build.155"
//Publishing details
if (rootProject.file("private.gradle").exists()) {
apply from: "private.gradle"
}
allprojects {
apply plugin: "fabric-loom"
apply plugin: "maven-publish"
apply plugin: "com.jfrog.artifactory"
version = "0.9.0-rc.1"
group = "io.github.cottonmc.cotton"
sourceCompatibility = 1.8
targetCompatibility = 1.8
minecraft {
refmapName = "mixins.${archivesBaseName}.refmap.json"
}
repositories {
maven {
name = "Cotton"
url = "http://server.bbkr.space:8081/artifactory/libs-release/"
}
maven {
name = "Cotton (snapshots)"
url = "http://server.bbkr.space:8081/artifactory/libs-snapshot/"
}
}
dependencies {
minecraft "com.mojang:minecraft:$minecraft"
mappings "net.fabricmc:yarn:$mappings"
modImpementation "net.fabricmc:fabric-loader:$loader"
}
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"
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}
jar {
from rootProject.files("LICENSE")
}
publishing {
publications {
maven(MavenPublication) {
//release jar - file location not provided anywhere in loom
artifact ("${project.buildDir.absolutePath}/libs/${archivesBaseName}-${project.version}.jar") {
classifier null
builtBy remapJar
}
//release jar - file location not provided anywhere in loom
artifact ("${project.buildDir.absolutePath}/libs/${archivesBaseName}-${project.version}-dev.jar") {
classifier "dev"
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}
}
artifactory {
if (rootProject.hasProperty("artifactoryUsername")) {
contextUrl = "http://server.bbkr.space:8081/artifactory/libs-release/"
publish {
repository {
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"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment