Skip to content

Commit

Permalink
add in version handling/ replacement inside mcmodinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
progwml6 committed Nov 23, 2013
1 parent 707f799 commit 24beb22
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions build.gradle
Expand Up @@ -52,9 +52,13 @@ minecraft {
version = '1.6.4-9.11.1.964'
assetDir = 'run/assets'
}

sourceCompatibility = '1.6'
targetCompatibility = '1.6'
// sets version to the slimeKnights version format
task buildInfo {
def cmd = "git rev-parse --short HEAD"
def proc = cmd.execute()
ext.revision = proc.text.trim()
}
version = "${minecraft.version}-${System.getenv().BUILD_NUMBER}.${project.buildInfo.revision}"

sourceSets {
main {
Expand All @@ -63,6 +67,22 @@ sourceSets {
}
}
}
processResources
{
// replace stuff in text files, not binary ones.
from(sourceSets.main.resources.srcDirs) {
include '**/*.info'
// replace version and MCVersion
// forge version is also accessible via project.minecraftforgeVersion
// it contains the full minecraft version, including buildNumber
expand 'version':project.version, 'mcversion':project.minecraft.version
}

// copy everything else, thats not text
from(sourceSets.main.resources.srcDirs) {
exclude '**/*.info'
}
}


jar {
Expand Down

0 comments on commit 24beb22

Please sign in to comment.