Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- buildscript {
- repositories {
- mavenCentral()
- maven {
- name = "forge"
- url = "http://files.minecraftforge.net/maven"
- }
- maven {
- name = "sonatype"
- url = "https://oss.sonatype.org/content/repositories/snapshots/"
- }
- }
- dependencies {
- classpath 'net.minecraftforge.gradle:ForgeGradle:1.1-SNAPSHOT'
- }
- }
- ENV = System.getenv()
- // define the properties file
- ext.configFile = file "build.properties"
- configFile.withReader {
- // read config. it shall from now on be referenced as simply config or as project.config
- def prop = new Properties()
- prop.load(it)
- ext.config = new ConfigSlurper().parse prop
- }
- // Drone.io Support
- if(ENV.DRONE_BUILD_NUMBER)
- buildNum = ENV.DRONE_BUILD_NUMBER + " - drone"
- // Jenkins and TeamCity Support
- else if (ENV.BUILD_NUMBER)
- buildNum = ENV.BUILD_NUMBER + " - CI"
- // Travis Support
- else if (ENV.TRAVIS_BUILD_NUMBER)
- buildNum = ENV.TRAVIS_BUILD_NUMBER + " - travis"
- // Codeship.io Support
- else if (ENV.CI_BUILD_NUMBER)
- buildNum = ENV.CI_BUILD_NUMBER + " - codeship"
- else
- buildNum = config.build_number
- apply plugin: 'java'
- apply plugin: 'forge'
- version = config.mod_version + "." + buildNum
- group= "com.tgame" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
- archivesBaseName = "apptherm"
- minecraft {
- version = config.minecraft_version + "-" + config.forge_version
- replace "@VERSION@", project.version
- replace "@AUTHOR@", config.author_name
- }
- processResources
- {
- // replace stuff in mcmod.info, nothing else
- from(sourceSets.main.resources.srcDirs) {
- include 'mcmod.info'
- expand 'version' : project.version, 'mcversion' : project.minecraft.version
- }
- // copy everything else, thats not the mcmod.info
- from(sourceSets.main.resources.srcDirs) {
- exclude '**/*.lang'
- exclude '**/*.info'
- exclude '**/*.properties'
- }
- }
- task deobfJar(type: Jar) {
- from sourceSets.main.output
- appendix = 'deobf'
- }
- // creates an API jar
- task apiJar(type: Jar) {
- from(sourceSets.main.java)
- {
- include "com/tgame/apptherm/api/*"
- }
- appendix = 'api'
- }
- artifacts {
- archives deobfJar
- }
- // Used in my Private Build of Actual releases, increments the build number on build.properties, Unneeded in jenkins or any other CI.
- // task incrementBuildNumber() {
- // dependsOn "reobf"
- // doLast {
- // increment
- // config.build_number = (config.build_number.toString().toInteger()) + 1
- // write back to the file
- // configFile.withWriter {
- // config.toProperties().store(it, "")
- // }
- // }
- //}
- // tasks.build.dependsOn "incrementBuildNumber"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement