Skip to content
This repository has been archived by the owner on Mar 21, 2019. It is now read-only.

How To: Make a Basic buildscript using GMCP

Nathaniel edited this page Oct 22, 2013 · 6 revisions

Here you will be shown the basics of how to make a buildscript using GMCP, you will also be refered to this page in later tutorials.


Buildscript

buildscript {
    repositories { mavenCentral() }
    dependencies { classpath 'com.github.abrarsyed.gmcp:GMCP:X.X.X' }
}

Here you specify which version of GMCP you want to use, just replace the X.X.X with the GMCP version. After you have picked the GMCP version that you want to use, you write apply plugin: "gmcp", and continue with the rest of the buildscript.

group = 'UNIQUE ID'
version = 'VERSION'
archivesBaseName = 'NAME'

Here is where you specifiy a Unique per mod ID, then the version of the mod which Can support enviroment variables, and the name of the file


Minecraft

minecraft { 
    minecraftVersion = "X.X.X"
}

Here is were you pick the MC version that you want to support. Just replace the X.X.X with the Minecraft Version.


Finished Product

And that is all for now. Below is how the finished buildscript should look like

buildscript {
    repositories { mavenCentral() }
    dependencies { classpath 'com.github.abrarsyed.gmcp:GMCP:0.8.+' }
}

apply plugin: "gmcp"

group = 'red-pipes'
version = "Pre1a"
archivesBaseName = 'Red-Pipes'

logger.lifecycle ""+version

minecraft { minecraftVersion = "1.6.4" }

processResources
{
    from(sourceSets.main.resources.srcDirs) {
    include '**/*.lang'
    include '**/*.info'

    expand 'version':project.version, 'mcversion':project.minecraft.minecraftVersion
}

    from(sourceSets.main.resources.srcDirs) {
        exclude '**/*.lang'
        exclude '**/*.info'
    }
}

task deobfJar(type: Jar) {
    from sourceSets.main.output
    appendix = 'deobf'
}

artifacts {
    archives deobfJar
}

Now this buildscript would give you MOD-NAME-VERSION.jar, so you might want to modify it.
Also you might want to change the GMCP version.