3
0

Merge branch 'kcx-1614' of ssh://git.xjboss.net:3389/KC-RELOADED/KCauldronX into kcx-1614

This commit is contained in:
xjboss 2017-07-23 15:24:13 +08:00
commit b1e1c4abb1
2 changed files with 14 additions and 38 deletions

View File

@ -197,10 +197,7 @@ tasks.packageUniversal {
manifest.attributes(generateManifest(true))
}
task jar(type: Jar, dependsOn: packageUniversal) {
destinationDir file("${buildDir}/distributions")
from zipTree(tasks.packageUniversal.archivePath)
manifest.attributes(generateManifest())
task jar(dependsOn: packageUniversal) {
}
tasks.createChangelog.onlyIf { false }
@ -218,6 +215,7 @@ task packageChangelog(type: CreateChangelog) {
*/
}
/*
task bundleStub(type: Jar) {
classifier = 'stub'
manifest.attributes([
@ -225,9 +223,10 @@ task bundleStub(type: Jar) {
'Class-Path': "libraries/${project.group.replace('.', '/')}/${project.name}/${project.version}/${project.name}-${project.version}.jar"
])
}
*/
task installBundle(type: InstallBundle, dependsOn: jar) {
serverJar tasks.jar.archivePath
task installBundle(type: InstallBundle, dependsOn: packageUniversal) {
serverJar tasks.packageUniversal.archivePath
bootstrapClasspath configurations.bootstrap
bootstrapMain 'pw.prok.bootstrap.Main'
}
@ -235,14 +234,15 @@ task installBundle(type: InstallBundle, dependsOn: jar) {
task packageBundle(type: Zip, dependsOn: installBundle) {
classifier = 'bundle'
from fileTree(installBundle.installLocation)
from bundleStub
rename bundleStub.archiveName, 'KCauldron.jar'
from packageUniversal
// from bundleStub
// rename bundleStub.archiveName, 'KCauldron.jar'
}
task signJars(type: Sign, dependsOn: [packageChangelog, packageBundle, jar, 'generatePomFileForMavenPublication']) {
task signJars(type: Sign, dependsOn: [packageChangelog, packageBundle, packageUniversal, 'generatePomFileForMavenPublication']) {
sign packageChangelog
sign packageBundle
sign jar
sign packageUniversal
}
task signPom(type: Sign, dependsOn: 'generatePomFileForMavenPublication') {
@ -320,6 +320,9 @@ tasks.generateProjectCauldron {
}
}
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
dependencies {
''')
configurations.libraries.resolvedConfiguration.resolvedArtifacts.collect { it.moduleVersion.id }.each { module ->

View File

@ -32,34 +32,7 @@ class InstallBundle extends DefaultTask {
def install() {
installLocation.deleteDir()
installLocation.mkdirs()
new File(installLocation, "README.txt").withWriter {
def String jarPath = 'libraries' << File.separator << (project.group as String).replace('.', File.separator) << File.separator << project.name << File.separator << project.version << File.separator << project.name << '-' << project.version << '.jar'
it << '''KCauldron installation guide
# Understanding this bundle
You're reading this guide because you're using deprecated installation method
If you want use easier & safer method please read about KBootstrap at https://prok.pw/KBootstrap
# Installation and usage
1. Unpack this zip into server directory
2. Use following line to start the server:
java -jar '''
it << jarPath
it << '''
... or
java -jar KCauldron.jar
3. That's end, enjoy
# Why I should use KBootstrap?
1. Easiest server installation
2. Built-in libraries management
3. Update & run server in one line
4. Ability to not read this boring guide
5. What else?
If you are not yet convinced and want to use bundles instead KBootstrap... Meh, this is your choice.
'''
}
def cp = bootstrapClasspath
for (int i = 0; i < 3; i++) {
def result = project.javaexec { it ->