Guest User

Untitled

a guest
Feb 15th, 2014
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. buildscript {
  2. repositories {
  3. mavenCentral()
  4. maven {
  5. name = "forge"
  6. url = "http://files.minecraftforge.net/maven"
  7. }
  8. }
  9. dependencies {
  10. classpath 'net.minecraftforge.gradle:ForgeGradle:1.1-SNAPSHOT'
  11. }
  12. }
  13. ENV = System.getenv()
  14.  
  15. // define the properties file
  16. ext.configFile = file "build.properties"
  17.  
  18. configFile.withReader {
  19. // read config. it shall from now on be referenced as simply config or as project.config
  20. def prop = new Properties()
  21. prop.load(it)
  22. ext.config = new ConfigSlurper().parse prop
  23. }
  24.  
  25. // Drone.io Support
  26. if(ENV.DRONE_BUILD_NUMBER)
  27. buildNum = ENV.DRONE_BUILD_NUMBER + " - drone"
  28.  
  29. // Jenkins and TeamCity Support
  30. else if (ENV.BUILD_NUMBER)
  31. buildNum = ENV.BUILD_NUMBER + " - CI"
  32.  
  33. // Travis Support
  34. else if (ENV.TRAVIS_BUILD_NUMBER)
  35. buildNum = ENV.TRAVIS_BUILD_NUMBER + " - travis"
  36.  
  37. // Codeship.io Support
  38. else if (ENV.CI_BUILD_NUMBER)
  39. buildNum = ENV.CI_BUILD_NUMBER + " - codeship"
  40.  
  41. else
  42. buildNum = config.build_number
  43.  
  44. apply plugin: 'java'
  45. apply plugin: 'forge'
  46.  
  47. version = config.mod_version + "." + buildNum
  48. group= "com.tgame" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
  49. archivesBaseName = "apptherm"
  50.  
  51. minecraft {
  52. version = config.minecraft_version + "-" + config.forge_version
  53.  
  54. replace "@VERSION@", project.version
  55. replace "@AUTHOR@", config.author_name
  56. }
  57.  
  58. processResources
  59. {
  60. // replace stuff in mcmod.info, nothing else
  61. from(sourceSets.main.resources.srcDirs) {
  62. include 'mcmod.info'
  63.  
  64. expand 'version' : project.version, 'mcversion' : project.minecraft.version
  65. }
  66.  
  67. // copy everything else, thats not the mcmod.info
  68. from(sourceSets.main.resources.srcDirs) {
  69. exclude '**/*.lang'
  70. exclude '**/*.info'
  71. exclude '**/*.properties'
  72. }
  73. }
  74.  
  75. task deobfJar(type: Jar) {
  76. from sourceSets.main.output
  77. appendix = 'deobf'
  78. }
  79.  
  80. // creates an API jar
  81. task apiJar(type: Jar) {
  82. from(sourceSets.main.java)
  83. {
  84. include "com/tgame/apptherm/api/*"
  85. }
  86. appendix = 'api'
  87. }
  88.  
  89. artifacts {
  90. archives deobfJar
  91. }
  92.  
  93. // Used in my Private Build of Actual releases, increments the build number on build.properties, Unneeded in jenkins or any other CI.
  94.  
  95. // task incrementBuildNumber() {
  96. // dependsOn "reobf"
  97. // doLast {
  98. // increment
  99. // config.build_number = (config.build_number.toString().toInteger()) + 1
  100.  
  101. // write back to the file
  102. // configFile.withWriter {
  103. // config.toProperties().store(it, "")
  104. // }
  105. // }
  106. //}
  107.  
  108. // tasks.build.dependsOn "incrementBuildNumber"
Advertisement
Add Comment
Please, Sign In to add comment