Skip to content

Commit

Permalink
Fix for minor version bug with Bukkit build
Browse files Browse the repository at this point in the history
Signed-off-by: Dries007 <admin@dries007.net>
  • Loading branch information
dries007 committed Jan 28, 2018
1 parent 0286702 commit 0548091
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 40 deletions.
3 changes: 2 additions & 1 deletion Bukkit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import org.apache.tools.ant.filters.ReplaceTokens

processResources {
from(sourceSets.main.resources.srcDirs) {
filter ReplaceTokens, tokens: [version: version]
filter ReplaceTokens, tokens: [version: rootProject.version]
}
}

Expand All @@ -34,6 +34,7 @@ curseforge {
releaseType = 'beta'
changelog = rootProject.getChangeLog() + '\n[Automatic build]'
addGameVersion '1.8'
addGameVersion '1.8.1'
addGameVersion '1.9'
addGameVersion '1.10'
addGameVersion '1.10'
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ Copyright &copy; 2017 - 2018 Dries007. **All rights reserved.**
2. Official builds can be distributed on any freely accessible platform.
1. List of official build sources:
1. [The MCLink website](https://mclink.dries007.net/)
2. CurseForge [1](https://www.curseforge.com/minecraft/mc-mods/mclink) or [2](https://minecraft.curseforge.com/projects/mclink)
3. [The build server](https://jenkins.dries007.net/job/MCLink/)
2. CurseForge: [1](https://www.curseforge.com/minecraft/mc-mods/mclink) or [2](https://minecraft.curseforge.com/projects/mclink)
3. Bukkit: [1](https://www.curseforge.com/minecraft/bukkit-plugins/mclink) or [2](https://dev.bukkit.org/projects/mclink)
4. [The build server](https://jenkins.dries007.net/job/MCLink/)
2. You are allowed to _privately_ use a modified version while developing a Pull Request.
3. A freely accessible platform is defined as a platform requiring no payment for access.
So called "Premium" access (for example payment in exchange for removal of advertisements or faster downloads) is allowed.
Expand Down
70 changes: 33 additions & 37 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,44 +86,40 @@ subprojects {
jarTask.appendix = 'Forge-' + project.minecraft.version
}

processResources
{
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version

from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version': project.version, 'mcversion': project.minecraft.version
}

from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}

doLast {
//noinspection GroovyAssignabilityCheck
def updateFile = new File(project.archivesBaseName.toLowerCase() + '.json')
def json
if (updateFile.exists()) {
json = new JsonSlurper().parseText(updateFile.getText())
} else {
def builder = new JsonBuilder()
json = builder(
homepage: "https://mclink.dries007.net",
promos: new HashMap<>()
)
}
//noinspection GroovyAssignabilityCheck
json['promos'][project.minecraft.version + '-latest'] = project.version
//noinspection GroovyAssignabilityCheck
json['promos'][project.minecraft.version + '-recommended'] = project.version
if (!json.containsKey(project.minecraft.version)) json.put(project.minecraft.version, new HashMap<>())
//noinspection GroovyAssignabilityCheck
def version = json[project.minecraft.version]
version.put(project.version, getChangeLog())
updateFile.write JsonOutput.prettyPrint(JsonOutput.toJson(json))
}
processResources {
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version

from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version': project.version, 'mcversion': project.minecraft.version
}

from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}

doLast {
//noinspection GroovyAssignabilityCheck
def updateFile = new File(project.archivesBaseName.toLowerCase() + '.json')
def json
if (updateFile.exists()) {
json = new JsonSlurper().parseText(updateFile.getText())
} else {
def builder = new JsonBuilder()
json = builder(homepage: "https://mclink.dries007.net", promos: new HashMap<>())
}
//noinspection GroovyAssignabilityCheck
json['promos'][project.minecraft.version + '-latest'] = project.version
//noinspection GroovyAssignabilityCheck
json['promos'][project.minecraft.version + '-recommended'] = project.version
if (!json.containsKey(project.minecraft.version)) json.put(project.minecraft.version, new HashMap<>())
//noinspection GroovyAssignabilityCheck
def version = json[project.minecraft.version]
version.put(project.version, getChangeLog())
updateFile.write JsonOutput.prettyPrint(JsonOutput.toJson(json))
}
}

rootProject.setupDecompWorkspace.dependsOn setupDecompWorkspace
rootProject.setupDevWorkspace.dependsOn setupDevWorkspace
Expand Down

0 comments on commit 0548091

Please sign in to comment.