Created
May 13, 2016 10:21
-
-
Save Ivorforce/2b7e6db967dba413c695917d3ff2cc7a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
jcenter() | |
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:2.0-SNAPSHOT' | |
} | |
} | |
apply plugin: 'net.minecraftforge.gradle.forge' | |
apply plugin: 'maven' | |
version = "1.2.2" | |
def ENV = System.getenv() | |
if (ENV.DRONE_BUILD_NUMBER) { | |
version += ".n" + ENV.DRONE_BUILD_NUMBER | |
} | |
group = "ivorius.ivtoolkit" // http://maven.apache.org/guides/mini/guide-naming-conventions.html | |
archivesBaseName = "IvToolkit" | |
minecraft { | |
version = "1.8-11.14.4.1563" | |
runDir = "eclipse" | |
mappings = "stable_18" | |
useDepAts = true | |
} | |
jar { | |
manifest { | |
attributes 'FMLCorePlugin': 'ivorius.ivtoolkit.IvToolkitLoadingPlugin' | |
} | |
} | |
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' | |
} | |
} | |
runClient { | |
jvmArgs '-Dfml.coreMods.load=ivorius.ivtoolkit.IvToolkitLoadingPlugin' | |
} | |
runServer { | |
jvmArgs '-Dfml.coreMods.load=ivorius.ivtoolkit.IvToolkitLoadingPlugin' | |
} | |
// compile SevenCommonsLoader separately, targeting Java 6 | |
// for the warning message | |
task compileLoader(type: JavaCompile) { | |
source = fileTree(dir: "src/main/java") | |
classpath = sourceSets.main.compileClasspath | |
destinationDir = sourceSets.main.output.classesDir | |
include 'ivorius/ivtoolkit/IvToolkitLoadingPlugin*' | |
include 'ivorius/ivtoolkit/tools/JavaCompatibility*' | |
sourceCompatibility = 1.6 | |
targetCompatibility = 1.6 | |
} | |
compileJava { | |
exclude 'ivorius/ivtoolkit/IvToolkitLoadingPlugin*' | |
exclude 'ivorius/ivtoolkit/tools/JavaCompatibility*' | |
sourceCompatibility = 1.8 | |
targetCompatibility = 1.8 | |
options.encoding = 'UTF-8' | |
} | |
tasks.compileJava.dependsOn('compileLoader') | |
uploadArchives() { | |
dependsOn build | |
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") | |
} | |
pom { | |
groupId = project.group | |
version = project.version | |
artifactId = project.archivesBaseName | |
project { | |
name project.archivesBaseName | |
packaging 'jar' | |
description 'Shared functionality for Ivorius\' mods' | |
url 'https://github.com/Ivorforce/IvToolkit' | |
scm { | |
url 'scm:git:[email protected]:Ivorforce/IvToolkit.git' | |
connection 'scm:git:[email protected]:Ivorforce/IvToolkit.git' | |
developerConnection 'scm:git:[email protected]:Ivorforce/IvToolkit.git' | |
} | |
issueManagement { | |
system 'github' | |
url 'https://github.com/Ivorforce/IvToolkit/issues' | |
} | |
licenses { | |
license { | |
name 'Apache 2.0' | |
url 'http://www.apache.org/licenses/LICENSE-2.0.html' | |
distribution 'repo' | |
} | |
} | |
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