1
0
forked from xjboss/KCauldronX

Change version start at 1 and change mainfast KCauldron to KCauldronX and using the jenkins's build ID

This commit is contained in:
xjboss 2017-07-22 23:49:54 +08:00
parent f15e1456f3
commit 1a8c4700aa
2 changed files with 22 additions and 19 deletions

View File

@ -57,7 +57,7 @@ minecraft {
srgExtra "PK: org/bukkit/craftbukkit org/bukkit/craftbukkit/v1_7_R4"
}
group = 'pw.prok'
group = 'pw.yumc'
ext.buildInfoCached = null;
def buildInfo(String key) {
@ -96,11 +96,12 @@ def gitInfo(String key) {
}
return key ? gitInfoCached[key] : gitInfoCached;
}
ext.sys= System.properties
ext.mcVersion = "1.7.10"
ext.forgeVersion = VersionParser.parseForgeRevision(file('src/main/resources/fmlversion.properties'))
ext.revision = project.hasProperty('revision') ? project.getProperty('revision') : buildInfo('nextBuildNumber')
version = "${mcVersion}-${forgeVersion}.${revision}"
ext.build = sys.hasProperty('BUILD_NUMBER') ? sys.getProperty('BUILD_NUMBER') : "Unkonwn"
ext.kcx_version = 1
version = "${mcVersion}-${forgeVersion}-${kcx_version}.${build}"
if (project.hasProperty('officialBuild')) println "Updated KCauldron version: ${version}"
launch4j {
@ -169,13 +170,13 @@ def generateClasspath(boolean legacy = false) {
def generateManifest(boolean legacy = false) {
[
'KCauldron-Git-Branch' : gitInfo('branch'),
'KCauldron-Git-Hash' : gitInfo('fullHash'),
'KCauldron-Group' : project.group,
'KCauldron-Channel' : project.name,
'KCauldron-Version' : project.version,
'KCauldron-Legacy' : legacy,
'KCauldron-Official' : project.hasProperty('officialBuild'),
'KCauldronX-Git-Branch' : gitInfo('branch'),
'KCauldronX-Git-Hash' : gitInfo('fullHash'),
'KCauldronX-Group' : project.group,
'KCauldronX-Channel' : project.name,
'KCauldronX-Version' : project.version,
'KCauldronX-Legacy' : legacy,
'KCauldronX-Official' : sys.hasProperty('officialBuild'),
'Implementation-Vendor' : 'Prototik',
'Implementation-Title' : project.name,
'Implementation-Version': '1.7.10-R0.1-SNAPSHOT',
@ -206,12 +207,14 @@ tasks.packageInstaller.onlyIf { false }
task packageChangelog(type: CreateChangelog) {
onlyIf { project.hasProperty('officialBuild') }
/*
classifier = 'changelog'
extension = 'txt'
oldChangelogUrl = "https://repo.prok.pw/${project.group.replace('.', '/')}/${project.name}/${buildInfo('version')}/${project.name}-${buildInfo('version')}-changelog.txt"
hash = gitInfo('hash')
message = gitInfo('message')
version = project.version
*/
}
task bundleStub(type: Jar) {
@ -263,7 +266,7 @@ def getSignatureFiles = {
[archive: signedJar, classifier: null, extension: 'jar.asc']
]
}
/*
publishing {
repositories {
maven {
@ -294,7 +297,7 @@ publishing {
}
}
}
*/
tasks.generateProjectCauldron {
doLast {
def file = new File('eclipse/cauldron/build.gradle')

View File

@ -29,7 +29,7 @@ public class KCauldron {
while (resources.hasMoreElements()) {
URL url = resources.nextElement();
manifest.load(url.openStream());
String version = manifest.getProperty("KCauldron-Version");
String version = manifest.getProperty("KCauldronX-Version");
if (version != null) {
String path = url.getPath();
String jarFilePath = path.substring(path.indexOf(":") + 1,
@ -38,11 +38,11 @@ public class KCauldron {
sServerLocation = new File(jarFilePath);
sCurrentVersion = version;
sGroup = manifest.getProperty("KCauldron-Group");
sBranch = manifest.getProperty("KCauldron-Branch");
sChannel = manifest.getProperty("KCauldron-Channel");
sLegacy = Boolean.parseBoolean(manifest.getProperty("KCauldron-Legacy"));
sOfficial = Boolean.parseBoolean(manifest.getProperty("KCauldron-Official"));
sGroup = manifest.getProperty("KCauldronX-Group");
sBranch = manifest.getProperty("KCauldronX-Branch");
sChannel = manifest.getProperty("KCauldronX-Channel");
sLegacy = Boolean.parseBoolean(manifest.getProperty("KCauldronX-Legacy"));
sOfficial = Boolean.parseBoolean(manifest.getProperty("KCauldronX-Official"));
break;
}
manifest.clear();