1
0
forked from xjboss/KCauldronX
KCauldronX/build.gradle

163 lines
4.1 KiB
Groovy
Raw Normal View History

2015-05-26 14:16:16 +00:00
import groovy.json.JsonSlurper
2015-03-22 17:38:04 +00:00
buildscript {
repositories {
mavenCentral()
mavenLocal()
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'
}
}
2015-05-26 14:16:16 +00:00
tasks.whenTaskAdded {
if (it.name.startsWith('publish')) it.dependsOn 'preparePublication'
}
2015-03-22 17:38:04 +00:00
apply plugin: 'maven'
apply plugin: 'cauldron'
2015-05-26 14:16:16 +00:00
apply plugin: 'maven-publish'
apply plugin: 'signing'
2015-03-22 17:38:04 +00:00
minecraft {
version = '1.7.10'
mcpVersion = '9.05'
mainClass = 'cpw.mods.fml.relauncher.ServerLaunchWrapper'
tweakClass = 'cpw.mods.fml.common.launcher.FMLTweaker'
installerVersion = "1.4"
subprojects {
repositories {
2015-05-26 14:16:16 +00:00
mavenCentral()
2015-03-22 17:38:04 +00:00
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
}
srgExtra "PK: org/bukkit/craftbukkit org/bukkit/craftbukkit/v1_7_R4"
}
2015-05-26 14:16:16 +00:00
group = 'pw.prok'
def retrieveBuildNumber() {
2015-05-28 13:25:46 +00:00
if (!project.hasProperty('officialBuild')) return 'UNOFFICIAL.' + retrieveGitHash(false)
2015-05-26 14:16:16 +00:00
new JsonSlurper().parse(new URL("https://prok.pw/version/${group}/${name}"))['nextBuildNumber']
}
2015-05-28 13:25:46 +00:00
def retrieveGitHash(full = true) {
if (file('.git').exists())
2015-05-28 13:25:46 +00:00
return ['git', 'log', "--format=%${full?'H':'h'}", '-n', '1'].execute().text.trim()
return 'NOTGIT'
}
2015-03-22 17:38:04 +00:00
ext.mcVersion = "1.7.10"
2015-05-27 10:46:53 +00:00
ext.forgeVersion = "1408"
2015-05-26 14:16:16 +00:00
ext.revision = retrieveBuildNumber()
version = "${mcVersion}-${forgeVersion}.${revision}"
println " # Updated KCauldron version: ${version}"
2015-03-22 17:38:04 +00:00
launch4j {
jreMinVersion = '1.6.0'
}
tasks.packageUniversal {
classifier = 'server'
2015-05-26 14:16:16 +00:00
manifest.attributes([
'KCauldron-Git-Hash': retrieveGitHash(),
2015-05-26 14:16:16 +00:00
'Implementation-Vendor': 'Prototik',
'Implementationk-Title': 'KCauldron',
'Implementation-Version': 'KCauldron-'+project.version,
2015-05-27 10:46:53 +00:00
'Forge-Version': '10.13.3.1408',
2015-05-26 14:16:16 +00:00
'Specification-Vendor': 'Bukkit Team',
'Specification-Title': 'Bukkit',
'Specification-Version': '1.7.10-R0.1-SNAPSHOT'
])
2015-03-22 17:38:04 +00:00
}
2015-05-26 14:16:16 +00:00
tasks.createChangelog.onlyIf { false }
task signJars(type: Sign, dependsOn: [packageUniversal, packageInstaller]) {
sign packageInstaller
sign packageUniversal
}
task preparePublication(dependsOn: signJars) {}
def getSignatureFiles = {
def allFiles = project.tasks.signJars.signatureFiles.collect { it }
def signedServer = allFiles.find { it.name.contains('-server') }
def signedInstaller = allFiles.find { it.name.contains('-installer') }
return [
[archive: signedServer, classifier: 'server', extension: 'jar.asc'],
[archive: signedInstaller, classifier: 'installer', extension: 'jar.asc']
]
}
publishing {
repositories {
maven {
name 'ProK'
url 'https://prok.pw/repo/'
credentials {
username project.hasProperty('prokRepoUsername') ? prokRepoUsername : null
password project.hasProperty('prokRepoPassword') ? prokRepoPassword : null
}
}
}
publications {
gpg(MavenPublication) {
getSignatureFiles().each { signature ->
artifact(signature.archive) {
classifier = signature.classifier
extension = signature.extension
}
}
}
jar(MavenPublication) {
artifact packageUniversal
artifact packageInstaller
}
}
2015-05-08 09:29:14 +00:00
}
tasks.generateProjectCauldron << {
def file = new File('eclipse/cauldron/build.gradle')
file.append('''
repositories {
maven {
url 'https://prok.pw/repo'
}
}
dependencies {
compile 'pw.prok:KImagine:+@jar'
}
''')
}
configurations {
compile.extendsFrom exported
}
repositories {
maven {
url 'https://prok.pw/repo'
}
}
dependencies {
2015-05-28 10:41:07 +00:00
exported 'pw.prok:KImagine:+@jar'
}
packageUniversal {
from { configurations.exported.collect { it.isDirectory() ? it : zipTree(it) } }
}