Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
178 lines (123 sloc) 4.64 KB
buildscript {
repositories {
jcenter()
maven {
url = 'http://files.minecraftforge.net/maven'
}
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'gradle.plugin.com.matthewprenger:CurseGradle:1.1.0'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'com.matthewprenger.cursegradle'
apply plugin: 'maven-publish'
apply from: 'https://raw.githubusercontent.com/MinecraftModDevelopment/Gradle-Collection/master/generic/secrets.gradle'
apply from: 'https://raw.githubusercontent.com/MinecraftModDevelopment/Gradle-Collection/master/generic/patreon.gradle'
apply from: 'https://raw.githubusercontent.com/MinecraftModDevelopment/Gradle-Collection/master/generic/markdown-git-changelog.gradle'
apply from: 'https://raw.githubusercontent.com/MinecraftModDevelopment/Gradle-Collection/master/minecraft/artifacts.gradle'
apply from: 'https://raw.githubusercontent.com/MinecraftModDevelopment/Gradle-Collection/master/minecraft/maven.gradle'
loadSecrets()
version = "${mod_version}" + getBuildNumber()
group = "${mod_group}"
archivesBaseName = "${mod_name}-${version_minecraft}"
sourceCompatibility = 1.8
targetCompatibility = 1.8
minecraft {
version = "${version_minecraft}-${version_forge}"
mappings = "${version_mcp}"
runDir = 'run'
replace '@VERSION@', project.version
replace '@FINGERPRINT@', project.findProperty('signSHA1')
replaceIn "${mod_class}.java"
}
repositories {
maven {
url 'https://maven.mcmoddev.com'
}
maven {
url 'http://dvs1.progwml6.com/files/maven'
}
maven {
url 'http://maven.blamejared.com'
}
}
dependencies {
deobfProvided "net.darkhax.bookshelf:Bookshelf-1.12.2:${version_bookshelf}"
deobfProvided "net.darkhax.gamestages:GameStages-1.12.2:${version_gamestages}"
deobfProvided "CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-${version_minetweaker}"
deobfProvided "mezz.jei:jei_1.12.2:${version_jei}"
}
processResources {
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version':project.version, 'mcversion':project.minecraft.version
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
from 'LICENSE'
}
String getBuildNumber() {
return System.getenv('BUILD_NUMBER') ? System.getenv('BUILD_NUMBER') : System.getenv('TRAVIS_BUILD_NUMBER') ? System.getenv('TRAVIS_BUILD_NUMBER') : '0';
}
//Shuts up javadoc failures
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
curseforge {
apiKey = findProperty('curse_auth') ?: 0
def versions = "${curse_versions}".split(', ')
project {
id = "${curse_project}"
releaseType = 'alpha'
changelog = getGitChangelog() + "\n\nHuge thanks to my supporters on [Patreon](https://www.patreon.com/Darkhax?MCChangelog?${mod_class})\n\n" + getPledgeLog()
changelogType = 'markdown'
versions.each {
addGameVersion "${it}"
}
if (project.hasProperty('curse_requirements') || project.hasProperty('curse_optionals')) {
mainArtifact(jar) {
relations {
if (project.hasProperty('curse_requirements')) {
def requirements = "${curse_requirements}".split(', ')
requirements.each {
requiredLibrary "${it}"
}
}
if (project.hasProperty('curse_optionals')) {
def optionals = "${curse_optionals}".split(', ')
optionals.each {
optionalLibrary "${it}"
}
}
}
}
}
addArtifact(sourcesJar)
addArtifact(javadocJar)
addArtifact(deobfJar)
}
}
task signJar(type: SignJar, dependsOn: reobfJar) {
onlyIf {
project.hasProperty('keyStore')
}
keyStore = project.findProperty('keyStore')
alias = project.findProperty('keyStoreAlias')
storePass = project.findProperty('keyStorePass')
keyPass = project.findProperty('keyStoreKeyPass')
inputFile = jar.archivePath
outputFile = jar.archivePath
}
build.dependsOn signJar