|
|
|
@ -20,6 +20,11 @@ buildscript {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
repositories { |
|
|
|
|
maven { url 'https://prok.pw/repo' } |
|
|
|
|
jcenter() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
tasks.whenTaskAdded { |
|
|
|
|
if (it.name.startsWith('publish')) it.dependsOn 'preparePublication' |
|
|
|
|
} |
|
|
|
@ -35,15 +40,6 @@ minecraft {
|
|
|
|
|
mainClass = 'cpw.mods.fml.relauncher.ServerLaunchWrapper' |
|
|
|
|
tweakClass = 'cpw.mods.fml.common.launcher.FMLTweaker' |
|
|
|
|
installerVersion = "1.4" |
|
|
|
|
subprojects { |
|
|
|
|
repositories { |
|
|
|
|
mavenCentral() |
|
|
|
|
maven { |
|
|
|
|
name = "sonatype" |
|
|
|
|
url = "https://oss.sonatype.org/content/repositories/snapshots/" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
srgExtra "PK: org/bukkit/craftbukkit org/bukkit/craftbukkit/v1_7_R4" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -98,70 +94,148 @@ launch4j {
|
|
|
|
|
jreMinVersion = '1.6.0' |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
tasks.packageUniversal { |
|
|
|
|
classifier = 'server' |
|
|
|
|
manifest.attributes([ |
|
|
|
|
configurations { |
|
|
|
|
compile.extendsFrom exported |
|
|
|
|
libraries |
|
|
|
|
bootstrap |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
dependencies { |
|
|
|
|
bootstrap 'pw.prok:KBootstrap:0.0.9+' |
|
|
|
|
|
|
|
|
|
libraries 'net.minecraft:launchwrapper:1.11' |
|
|
|
|
libraries 'org.ow2.asm:asm-all:5.0.3' |
|
|
|
|
libraries 'com.typesafe.akka:akka-actor_2.11:2.3.3' |
|
|
|
|
libraries 'com.typesafe:config:1.2.1' |
|
|
|
|
libraries 'org.scala-lang:scala-actors-migration_2.11:1.1.0' |
|
|
|
|
libraries 'org.scala-lang:scala-compiler:2.11.1' |
|
|
|
|
libraries 'org.scala-lang.plugins:scala-continuations-library_2.11:1.0.2' |
|
|
|
|
libraries 'org.scala-lang.plugins:scala-continuations-plugin_2.11.1:1.0.2' |
|
|
|
|
libraries 'org.scala-lang:scala-library:2.11.1' |
|
|
|
|
libraries 'org.scala-lang:scala-parser-combinators_2.11:1.0.1' |
|
|
|
|
libraries 'org.scala-lang:scala-reflect:2.11.1' |
|
|
|
|
libraries 'org.scala-lang:scala-swing_2.11:1.0.1' |
|
|
|
|
libraries 'org.scala-lang:scala-xml_2.11:1.0.2' |
|
|
|
|
libraries 'net.sf.jopt-simple:jopt-simple:4.5' |
|
|
|
|
libraries 'lzma:lzma:0.0.1' |
|
|
|
|
libraries 'net.sf.jopt-simple:jopt-simple:4.5' |
|
|
|
|
libraries 'org.yaml:snakeyaml:1.9' |
|
|
|
|
libraries 'commons-lang:commons-lang:2.6' |
|
|
|
|
libraries 'org.avaje:ebean:2.7.3' |
|
|
|
|
libraries 'jline:jline:2.6' |
|
|
|
|
libraries 'net.md-5:SpecialSource:1.7-SNAPSHOT' |
|
|
|
|
libraries 'net.sourceforge.argo:argo:2.25' |
|
|
|
|
libraries 'org.fusesource.jansi:jansi:1.8' |
|
|
|
|
libraries 'com.googlecode.json-simple:json-simple:1.1' |
|
|
|
|
libraries 'org.xerial:sqlite-jdbc:3.7.2' |
|
|
|
|
libraries 'mysql:mysql-connector-java:5.1.14' |
|
|
|
|
libraries 'javax.persistence:persistence-api:1.0.2' |
|
|
|
|
libraries 'net.minecraft:server:1.7.10' |
|
|
|
|
libraries 'pw.prok:KImagine:0.1.12@jar' |
|
|
|
|
libraries 'org.apache.httpcomponents:httpclient:4.4.1' |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
packageUniversal { |
|
|
|
|
from { configurations.exported.collect { it.isDirectory() ? it : zipTree(it) } } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
def String repeat(String string, int times) { |
|
|
|
|
StringBuilder builder = new StringBuilder(string.length() * times) |
|
|
|
|
times.times { builder.append(string) } |
|
|
|
|
builder as String |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
def generateClasspath(boolean legacy = false) { |
|
|
|
|
def classpath = '' |
|
|
|
|
configurations.libraries.resolvedConfiguration.resolvedArtifacts.collect { it.moduleVersion.id }.each { |
|
|
|
|
def jar = "${it.group.replace('.', '/')}/${it.name}/${it.version}/${it.name}-${it.version}.jar" |
|
|
|
|
classpath += " ${legacy ? 'libraries/' : repeat('../', (group as String).split('\\.').length + 2)}${jar}" |
|
|
|
|
} |
|
|
|
|
return classpath.trim() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
def generateManifest(boolean legacy = false) { |
|
|
|
|
[ |
|
|
|
|
'KCauldron-Git-Branch' : gitInfo('branch'), |
|
|
|
|
'KCauldron-Git-Hash' : gitInfo('fullHash'), |
|
|
|
|
'KCauldron-Version' : project.version, |
|
|
|
|
'KCauldron-Channel' : project.name, |
|
|
|
|
'KCauldron-Legacy' : legacy, |
|
|
|
|
'Implementation-Vendor' : 'Prototik', |
|
|
|
|
'Implementation-Title' : project.name, |
|
|
|
|
'Implementation-Version': project.version, |
|
|
|
|
'Forge-Version' : '10.13.3.1448', |
|
|
|
|
'Specification-Vendor' : 'Bukkit Team', |
|
|
|
|
'Specification-Title' : 'Bukkit', |
|
|
|
|
'Specification-Version' : '1.7.10-R0.1-SNAPSHOT' |
|
|
|
|
]) |
|
|
|
|
'Specification-Version' : '1.7.10-R0.1-SNAPSHOT', |
|
|
|
|
'Forge-Version' : '10.13.3.1448', |
|
|
|
|
'TweakClass' : 'cpw.mods.fml.common.launcher.FMLTweaker', |
|
|
|
|
'Main-Class' : 'cpw.mods.fml.relauncher.ServerLaunchWrapper', |
|
|
|
|
'Class-Path' : generateClasspath(legacy) |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
tasks.packageUniversal { |
|
|
|
|
classifier = 'server' |
|
|
|
|
setManifest {} |
|
|
|
|
manifest.attributes(generateManifest(true)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
task jar(type: Jar, dependsOn: packageUniversal) { |
|
|
|
|
destinationDir file("${buildDir}/distributions") |
|
|
|
|
from zipTree(tasks.packageUniversal.archivePath) |
|
|
|
|
manifest.attributes(generateManifest()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
tasks.createChangelog.onlyIf { false } |
|
|
|
|
tasks.packageInstaller.onlyIf { false } |
|
|
|
|
|
|
|
|
|
task packageChangelog(type: CreateChangelog) { |
|
|
|
|
onlyIf { project.hasProperty('officialBuild') } |
|
|
|
|
classifier = 'changelog' |
|
|
|
|
extension = 'txt' |
|
|
|
|
oldChangelogUrl = "https://prok.pw/repo/${project.group.replace('.','/')}/${project.name}/${buildInfo('version')}/${project.name}-${buildInfo('version')}-changelog.txt" |
|
|
|
|
oldChangelogUrl = "https://prok.pw/repo/${project.group.replace('.', '/')}/${project.name}/${buildInfo('version')}/${project.name}-${buildInfo('version')}-changelog.txt" |
|
|
|
|
hash = gitInfo('hash') |
|
|
|
|
message = gitInfo('message') |
|
|
|
|
version = project.version |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
task installBundle(type: InstallBundle, dependsOn: packageInstaller) { |
|
|
|
|
installer packageInstaller.archivePath |
|
|
|
|
task installBundle(type: InstallBundle, dependsOn: packageUniversal) { |
|
|
|
|
serverJar tasks.jar.archivePath |
|
|
|
|
bootstrapClasspath configurations.bootstrap |
|
|
|
|
bootstrapMain 'pw.prok.bootstrap.Main' |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
task packageBundle(type: Zip, dependsOn: installBundle) { |
|
|
|
|
onlyIf { project.hasProperty('officialBuild') } |
|
|
|
|
classifier = 'bundle' |
|
|
|
|
from packageInstaller |
|
|
|
|
from packageUniversal |
|
|
|
|
from fileTree(installBundle.installLocation, { |
|
|
|
|
include 'libraries/**' |
|
|
|
|
include 'minecraft_server.*.jar' |
|
|
|
|
}) |
|
|
|
|
from fileTree(installBundle.installLocation) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
task signJars(type: Sign, dependsOn: [packageUniversal, packageInstaller, packageChangelog, packageBundle]) { |
|
|
|
|
sign packageInstaller |
|
|
|
|
task signJars(type: Sign, dependsOn: [packageUniversal, packageChangelog, packageBundle, jar, 'generatePomFileForMavenPublication']) { |
|
|
|
|
sign packageUniversal |
|
|
|
|
sign packageChangelog |
|
|
|
|
sign packageBundle |
|
|
|
|
sign jar |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
task preparePublication(dependsOn: signJars) {} |
|
|
|
|
task signPom(type: Sign, dependsOn: 'generatePomFileForMavenPublication') { |
|
|
|
|
outputs.upToDateWhen { false } |
|
|
|
|
sign file("${buildDir}/publications/maven/pom-default.xml") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
task preparePublication(dependsOn: [signJars, signPom]) {} |
|
|
|
|
|
|
|
|
|
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') } |
|
|
|
|
def signedChangelog = allFiles.find { it.name.contains('-changelog') } |
|
|
|
|
def signedBundle = allFiles.find { it.name.contains('-bundle') } |
|
|
|
|
def signedJar = (allFiles - [signedServer, signedChangelog, signedBundle])[0] |
|
|
|
|
return [ |
|
|
|
|
[archive: signedServer, classifier: 'server', extension: 'jar.asc'], |
|
|
|
|
[archive: signedInstaller, classifier: 'installer', extension: 'jar.asc'], |
|
|
|
|
[archive: signedChangelog, classifier: 'changelog', extension: 'txt.asc'], |
|
|
|
|
[archive: signedBundle, classifier: 'bundle', extension: 'jar.asc'] |
|
|
|
|
[archive: signedBundle, classifier: 'bundle', extension: 'jar.asc'], |
|
|
|
|
[archive: signedJar, classifier: null, extension: 'jar.asc'] |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -186,13 +260,17 @@ publishing {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
artifact packageUniversal |
|
|
|
|
artifact packageInstaller |
|
|
|
|
artifact packageChangelog |
|
|
|
|
artifact packageBundle |
|
|
|
|
artifact jar |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
tasks.buildPackages { |
|
|
|
|
dependsOn packageUniversal, packageChangelog, packageBundle, jar |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
tasks.generateProjectCauldron << { |
|
|
|
|
def file = new File('eclipse/cauldron/build.gradle') |
|
|
|
|
file.append(''' |
|
|
|
@ -202,27 +280,12 @@ repositories {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
dependencies { |
|
|
|
|
compile 'pw.prok:KImagine:0.1.12+@jar' |
|
|
|
|
compile 'org.apache.httpcomponents:httpclient:4.4.1' |
|
|
|
|
} |
|
|
|
|
''') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
configurations { |
|
|
|
|
compile.extendsFrom exported |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
repositories { |
|
|
|
|
maven { |
|
|
|
|
url 'https://prok.pw/repo' |
|
|
|
|
configurations.libraries.resolvedConfiguration.resolvedArtifacts.collect { it.moduleVersion.id }.each { module -> |
|
|
|
|
if (['net.minecraft:server:', 'org.ow2.asm:asm-all'].findAll {(module as String).startsWith it}.size() > 0) { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
file.append(" compile '${module}'\n") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
dependencies { |
|
|
|
|
exported 'pw.prok:KImagine:0.1.12+@jar' |
|
|
|
|
exported 'org.apache.httpcomponents:httpclient:4.4.1' |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
packageUniversal { |
|
|
|
|
from { configurations.exported.collect { it.isDirectory() ? it : zipTree(it) } } |
|
|
|
|
file.append('}') |
|
|
|
|
} |
|
|
|
|