build.gradle 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. // define the properties file
  2. ext.configFile = file "gradle.properties"
  3. configFile.withReader {
  4. // read config. it shall from now on be referenced as simply config or as project.config
  5. def prop = new Properties()
  6. prop.load(it)
  7. project.ext.config = new ConfigSlurper().parse prop
  8. }
  9. // For those who want the bleeding edge
  10. buildscript {
  11. repositories {
  12. jcenter()
  13. maven {
  14. name = "forge"
  15. url = "http://files.minecraftforge.net/maven"
  16. }
  17. }
  18. dependencies {
  19. classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
  20. }
  21. }
  22. apply plugin: 'java'
  23. apply plugin: 'idea'
  24. apply plugin: 'net.minecraftforge.gradle.forge'
  25. apply plugin: 'maven'
  26. ///////////////////////////////////////////////////
  27. // IDE Settings
  28. ///////////////////////////////////////////////////
  29. idea {
  30. project {
  31. languageLevel = '1.8'
  32. }
  33. }
  34. ///////////////////////////////////////////////////
  35. // ForgeGradle
  36. ///////////////////////////////////////////////////
  37. version = (hasProperty("CIRevision") ? CIRevision : config.mod_version)
  38. group = config.group_name
  39. archivesBaseName = "${config.mod_id}-${config.minecraft_version}"
  40. sourceCompatibility = JavaVersion.VERSION_1_8
  41. targetCompatibility = JavaVersion.VERSION_1_8
  42. minecraft {
  43. version = config.minecraft_version + "-" + config.forge_version // grab latest forge
  44. runDir = "run"
  45. mappings = config.mcp_mappings
  46. makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
  47. replace '@mod_version@', version
  48. replace '@mod_id@', config.mod_id
  49. replace '@ci_build@', hasProperty("CIRevision") ? 'true' : 'false'
  50. replaceIn 'TwilightForestMod.java'
  51. replace '@VERSION@', project.version
  52. }
  53. processResources {
  54. //replaceIn 'assets/twilightforest/patchouli_books/guide/book.json'
  55. //replace '@EDITION@', project.version
  56. // this will ensure that this task is redone when the versions change.
  57. inputs.property "version", project.version
  58. inputs.property "mcversion", project.minecraft.version
  59. // replace stuff in mcmod.info, nothing else
  60. from(sourceSets.main.resources.srcDirs) {
  61. include '**/*.info'
  62. //include '**/*.properties'
  63. include 'assets/twilightforest/patchouli_books/guide/book.json'
  64. // replace version and mcversion
  65. expand ([
  66. 'version':project.version,
  67. 'mcversion':project.minecraft.version,
  68. 'forge_version': config.forge_version,
  69. 'mod_version': config.mod_version,
  70. 'minecraft_version': config.minecraft_version,
  71. 'edition': (project.version - (config.mod_version + '.')),
  72. 's': '$'
  73. ])
  74. }
  75. // copy everything else, thats not the mcmod.info
  76. from(sourceSets.main.resources.srcDirs) {
  77. exclude 'mcmod.info'
  78. exclude 'assets/twilightforest/patchouli_books/guide/book.json'
  79. }
  80. }
  81. compileJava {
  82. options.encoding = 'UTF-8'
  83. }
  84. jar {
  85. classifier = 'universal'
  86. manifest {
  87. attributes 'FMLAT': 'tf_at.cfg'
  88. }
  89. }
  90. repositories {
  91. maven {
  92. name 'progwm\'s Maven' // JEI + Mantle + TCon
  93. url 'https://dvs1.progwml6.com/files/maven'
  94. }
  95. maven {
  96. name 'tterrag\'s Maven' // CTM
  97. url 'https://maven.tterrag.com/'
  98. }
  99. maven {
  100. name 'Jared\'s Maven' // Immersive Engineering + Patchouli
  101. url 'https://blamejared.com/maven'
  102. }
  103. maven {
  104. name 'player\'s Maven' // Forestry
  105. url 'http://maven.ic2.player.to/'
  106. }
  107. maven {
  108. name 'Curseforge Maven' // Baubles + Thaumcraft
  109. url 'https://minecraft.curseforge.com/api/maven/'
  110. }
  111. }
  112. dependencies {
  113. // progwml6
  114. deobfCompile "mezz.jei:jei_${minecraft_version}:${jei_version}"
  115. deobfCompile "slimeknights.mantle:Mantle:${minecraft_sub_version}-${mantle_version}"
  116. deobfCompile "slimeknights:TConstruct:${minecraft_version}-${tcon_version}"
  117. // tterrag
  118. deobfCompile "team.chisel.ctm:CTM:MC${minecraft_version}-${ctm_version}"
  119. //deobfCompile "team.chisel:Chisel:MC${minecraft_version}-${chisel_version}"
  120. // blamejared
  121. deobfCompile "blusunrize:ImmersiveEngineering:${immersive_engineering_version}"
  122. deobfCompile "vazkii.patchouli:Patchouli:${patchouli_version}"
  123. // player
  124. deobfCompile "net.sengir.forestry:forestry_${minecraft_version}:${forestry_version}"
  125. // curseforge
  126. deobfCompile "baubles:Baubles:${minecraft_sub_version}:${baubles_version}"
  127. deobfCompile "thaumcraft:Thaumcraft:${minecraft_version}:${thaumcraft_version}"
  128. }
  129. task createPom {
  130. doLast {
  131. pom {
  132. project {
  133. groupId project.group
  134. artifactId project.archivesBaseName
  135. version project.version
  136. inceptionYear '2012'
  137. licenses {
  138. license {
  139. name 'LGPL 2.1'
  140. url 'https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html'
  141. distribution 'repo'
  142. }
  143. }
  144. }
  145. }.writeTo(libsDir.path + "/" + project.archivesBaseName + "-" + project.version + ".pom")
  146. }
  147. }
  148. build.dependsOn createPom