From a8a2073de860d1b4490f81e6f9322571a28f197c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=81=AA=E8=81=AA?= <178666380@qq.com> Date: Sun, 23 Jul 2017 14:14:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=A7=BB=E9=99=A4readme=E7=9A=84=E7=94=9F?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../groovy/kcauldron/InstallBundle.groovy | 29 +------------------ 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/buildSrc/src/main/groovy/kcauldron/InstallBundle.groovy b/buildSrc/src/main/groovy/kcauldron/InstallBundle.groovy index 8af41a0..e6b17fe 100644 --- a/buildSrc/src/main/groovy/kcauldron/InstallBundle.groovy +++ b/buildSrc/src/main/groovy/kcauldron/InstallBundle.groovy @@ -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 -> From e92055fbd2d166cd1bf3cf18640d8b9185fa6da1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=81=AA=E8=81=AA?= <178666380@qq.com> Date: Sun, 23 Jul 2017 14:15:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B8=85=E7=A9=BAjar=E4=BB=BB=E5=8A=A1,?= =?UTF-8?q?=E5=88=A0=E9=99=A4bundleStub=E4=BB=BB=E5=8A=A1,=E4=BF=AE?= =?UTF-8?q?=E6=94=B9packageBundle=E6=89=93=E5=8C=85=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 270e2cf..86cfbd6 100644 --- a/build.gradle +++ b/build.gradle @@ -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 ->