Skip to content

Instantly share code, notes, and snippets.

@Ivorforce
Created July 22, 2015 20:01
Show Gist options
  • Save Ivorforce/8b10ed987fb75b96a0ea to your computer and use it in GitHub Desktop.
Save Ivorforce/8b10ed987fb75b96a0ea to your computer and use it in GitHub Desktop.
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
}
}
apply plugin: 'forge'
version = "1.1.2"
def ENV = System.getenv()
if (ENV.DRONE_BUILD_NUMBER) {
version += ".n" + ENV.DRONE_BUILD_NUMBER
}
group = "ivorius.yegamolchattels" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "YeGamolChattels"
minecraft {
version = "1.8-11.14.3.1491"
runDir = "eclipse"
mappings = "snapshot_20150721"
}
dependencies {
compile 'ivorius.ivtoolkit:IvToolkit:1.2.1:dev'
}
processResources
{
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
task sourceJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'dev'
manifest {
}
}
artifacts {
archives sourceJar
archives deobfJar
}
uploadArchives() {
dependsOn reobf
if (project.hasProperty("mavenUrl") && project.hasProperty("mavenUser") && project.hasProperty("mavenPassword")) {
repositories {
logger.info('Publishing to files server')
mavenDeployer {
repository(url: project."mavenUrl") {
authentication(userName: project."mavenUser", password: project."mavenPassword")
}
addFilter('deobf') {artifact, file ->
artifact.attributes['classifier'] == 'dev'
}
pom('deobf').version = project.version
addFilter('sources') {artifact, file ->
artifact.attributes['classifier'] == 'sources'
}
pom('sources').version = project.version
addFilter('universal') {artifact, file ->
artifact.attributes['classifier'] == null
}
pom('universal').version = project.version
pom {
groupId = project.group
version = project.version
artifactId = project.archivesBaseName
project {
name project.archivesBaseName
packaging 'jar'
description 'Adds decorational objects to the game Minecraft'
url 'https://github.com/Ivorforce/YeGamolChattels'
scm {
url 'scm:git:[email protected]:Ivorforce/YeGamolChattels.git'
connection 'scm:git:[email protected]:Ivorforce/YeGamolChattels.git'
developerConnection 'scm:git:[email protected]:Ivorforce/YeGamolChattels.git'
}
issueManagement {
system 'github'
url 'https://github.com/Ivorforce/YeGamolChattels/issues'
}
developers {
developer {
id 'Ivorius'
name 'Ivorius'
roles { role 'developer' }
}
}
}
}
}
}
}
else {
logger.log(LogLevel.ERROR, 'No upload variables defined!');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment