Repository for GregTech 6
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.gradle 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  1. buildscript {
  2. repositories {
  3. mavenCentral()
  4. jcenter()
  5. //maven {
  6. // name = "forge"
  7. // url = "https://files.minecraftforge.net/maven"
  8. //}
  9. maven {
  10. name = "gt"
  11. url = "https://gregtech.mechaenetia.com/"
  12. }
  13. maven {
  14. name = "sonatype"
  15. url = "https://oss.sonatype.org/content/repositories/snapshots/"
  16. }
  17. }
  18. dependencies {
  19. classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
  20. //classpath 'net.onedaybeard.artemis:artemis-odb-gradle-plugin:2.2.0'
  21. //classpath 'net.onedaybeard.artemis:artemis-fluid-gradle-plugin:2.2.0'
  22. }
  23. }
  24. allprojects {
  25. tasks.withType(JavaCompile) {
  26. options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
  27. }
  28. }
  29. apply plugin: 'eclipse'
  30. eclipse {
  31. classpath {
  32. downloadJavadoc = true
  33. downloadSources = true
  34. }
  35. }
  36. def eclipseRuntimeClasspath = ""
  37. def eclipseRuntimeClasspathTemplate = "<listEntry value=\"&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry externalArchive=&quot;@@PATH@@&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;\"/>\n"
  38. task eclipseForgeWorkspace(type: Copy) {
  39. doFirst {
  40. sourceSets.main.runtimeClasspath.collect {
  41. eclipseRuntimeClasspath += eclipseRuntimeClasspathTemplate.replaceAll('@@PATH@@', it.toString())
  42. ""
  43. }
  44. }
  45. from(".meta/eclipse/.metadata") {
  46. include '**/*.template'
  47. rename { it.replace '.template', '' }
  48. filter { it.replaceAll('@@eclipseRuntimeClasspath@@', eclipseRuntimeClasspath) }
  49. //rename '(.*).template', '$1'
  50. }
  51. from(".meta/eclipse/.metadata") {
  52. exclude '**/*.launch'
  53. }
  54. into "eclipse/.metadata"
  55. }
  56. import org.apache.tools.ant.taskdefs.condition.Os
  57. task eclipseForgeProject {
  58. doLast {
  59. if(!(new File("eclipse/Minecraft")).exists()) {
  60. if(!Os.isFamily(Os.FAMILY_WINDOWS)) {
  61. ant.symlink(resource: "../", link: "eclipse/Minecraft")
  62. } else {
  63. println("WINDOWS: Before loading this workspace with Eclipse, manually run this in an Elevated/Admin command prompt:")
  64. println("mklink /D " + (new File("").absolutePath) + "/eclipse/Minecraft " + (new File("").absolutePath))
  65. }
  66. }
  67. }
  68. }
  69. eclipseForgeProject.dependsOn(eclipseForgeWorkspace)
  70. tasks.eclipse.dependsOn(eclipseForgeProject)
  71. apply plugin: 'idea'
  72. idea{
  73. module {
  74. downloadJavadoc = true
  75. downloadSources = true
  76. }
  77. }
  78. repositories {
  79. maven {
  80. name = "gt"
  81. url = "https://gregtech.mechaenetia.com/"
  82. }
  83. maven {
  84. name = "sonatype"
  85. url = "https://oss.sonatype.org/content/repositories/snapshots/"
  86. }
  87. //maven {
  88. // name = "forge"
  89. // url = "https://files.minecraftforge.net/maven"
  90. //}
  91. //// No official maven'y storage for:
  92. //// - Baubles
  93. //// - MicdoodleCore
  94. //// - GalacticraftCore
  95. //// - Galacticraft-Planets
  96. //// - Thaumcraft
  97. //// - EnviroMine
  98. //// - Botania
  99. //// - Railcraft
  100. //// - twilightforest
  101. //// - appliedenergistics2
  102. //// - CoFHLib
  103. //// - ComputerCraft
  104. //// - RTG
  105. //// - OpenBlocks
  106. //// - IC2Classic
  107. //// Main storage for forestry_1.7.10
  108. //maven {
  109. // name = "ic2"
  110. // url = "http://maven.ic2.player.to/"
  111. //}
  112. //// Main storage for waila, jabba
  113. //maven {
  114. // name = "profmobius"
  115. // url = "http://default.mobiusstrip.eu/maven"
  116. //}
  117. //// Main storage for buildcraft
  118. //ivy {
  119. // name "BuildCraft"
  120. // artifactPattern "http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision](-[classifier]).[ext]"
  121. //}
  122. //// Main storage for CodeChickenCore, NotEnoughItems
  123. //// CodeChickenLib is in the Forge maven
  124. //maven {
  125. // name = "chickenbones"
  126. // url = "http://chickenbones.net/maven/"
  127. //}
  128. //// Main storage for AppleCore
  129. //maven {
  130. // name = "Apple"
  131. // url "http://www.ryanliptak.com/maven/"
  132. //}
  133. //// Main storage for OpenComputers
  134. //maven {
  135. // name = "OC repo"
  136. // url = "http://maven.cil.li/"
  137. //}
  138. }
  139. apply plugin: 'forge'
  140. //apply plugin: 'artemis'
  141. //apply plugin: 'artemis-fluid'
  142. group = "com.gregoriust.gregtech"
  143. archivesBaseName = "gregtech_1.7.10"
  144. version = "<UNKNOWN>"
  145. sourceCompatibility = 1.7
  146. targetCompatibility = 1.7
  147. compileJava.options.bootClasspath = org.gradle.internal.jvm.Jvm.current().getJre().getHomeDir().toString() +"/lib/rt.jar"
  148. compileJava {
  149. options.encoding = "UTF-8"
  150. }
  151. configurations {
  152. shade
  153. compile.extendsFrom shade
  154. }
  155. minecraft {
  156. version = "1.7.10-10.13.4.1614-1.7.10"
  157. runDir = "instance"
  158. // This is how you rename a namespace
  159. //srgExtra "PK: com/artemis gregtech/thirdparty/com/artemis"
  160. //srgExtra "PK: net/mostlyoriginal gregtech/thirdparty/net/mostlyoriginal"
  161. //srgExtra "PK: net/fbridault/eeel gregtech/thirdparty/net/fbridault/eeel"
  162. }
  163. dependencies {
  164. //compile fileTree(dir: 'libs', include: '*.jar')
  165. //shade 'net.onedaybeard.artemis:artemis-odb:2.2.0'
  166. //shade 'net.mostlyoriginal.artemis-odb:contrib-core:2.3.0'
  167. //shade 'net.mostlyoriginal.artemis-odb:contrib-eventbus:2.3.0'
  168. //shade 'net.fbridault.eeel:artemis-odb-eeel:1.2'
  169. runtime 'org.apache.commons:commons-math3:3.2' // Needed for dev opis because it doesn't know how to specify dependencies properly
  170. runtime 'org.jfree:jcommon:1.0.21' // Needed for dev opis because it doesn't know how to specify dependencies properly
  171. runtime 'org.jfree:jfreechart:1.0.17' // Needed for dev opis because it doesn't know how to specify dependencies properly
  172. runtime 'com.miglayout:miglayout-swing:4.2' // Needed for dev opis because it doesn't know how to specify dependencies properly
  173. runtime 'net.sf.opencsv:opencsv:2.3' // Needed for dev opis because it doesn't know how to specify dependencies properly
  174. runtime "io.netty-opis:Netty-opis:4.0.23" // Needed for dev opis because it doesn't know how to specify dependencies properly
  175. runtime "mcp.mobius.opis:Opis:1.2.5_1.7.10:dev"
  176. compile "mcp.mobius.waila:Waila:1.5.11-RC2-NONEI_1.7.10:dev"
  177. compile "codechicken:CodeChickenLib:1.7.10-1.1.3.140:dev"
  178. compile "codechicken:CodeChickenCore:1.7.10-1.0.7.47:dev"
  179. compile "codechicken:NotEnoughItems:1.7.10-1.0.5.120:dev"
  180. compileOnly "inventorytweaks:InventoryTweaks:1.59-dev:deobf"
  181. compileOnly "net.electricalage.eln:ElectricalAge-jrddunbr:1.16.3:dev"
  182. compileOnly "net.sengir.forestry:forestry_1.7.10:4.2.16.64:dev"
  183. compileOnly "com.mod-buildcraft:buildcraft:7.1.23:dev"
  184. compileOnly "com.azanor.baubles:Baubles:1.7.10-1.0.1.10:deobf"
  185. compileOnly "micdoodle8.mods:MicdoodleCore:1.7-3.0.12.504:Dev"
  186. compileOnly "micdoodle8.mods:GalacticraftCore:1.7-3.0.12.504:Dev"
  187. compileOnly "micdoodle8.mods:Galacticraft-Planets:1.7-3.0.12.504:Dev"
  188. compileOnly "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev"
  189. compileOnly "enviromine:EnviroMine:1.3.124:deobf"
  190. compileOnly "vazkii.botania:Botania:r1.8-250:deobf"
  191. compileOnly "mods.railcraft:Railcraft_1.7.10:9.12.3.0:dev"
  192. compileOnly "twilightforest:twilightforest:1.7.10-2.3.8dev:dev"
  193. compileOnly "appeng:appliedenergistics2:rv3-beta-6:dev"
  194. compileOnly "cofh:CoFHCore:1.7.10R3.0.4:dev"
  195. compileOnly "cofh:CoFHLib:1.7.10R3.0.3:dev"
  196. compileOnly "applecore:AppleCore:1.7.10-3.1.1:deobf"
  197. compileOnly "iguanaman:HungerOverhaul:1.7.10-1.0.0-basic:deobf"
  198. compileOnly "li.cil.oc:OpenComputers:MC1.7.10-1.7.2.1204:dev"
  199. // This ComputerCraft thing is *SUCH* a hack, but ComputerCraft is... not right... This only works because of CodeChickenCore Magic being included up above...
  200. compileOnly "dan200.computercraft:ComputerCraft:1.75"
  201. compileOnly "openblocks:OpenBlocks:1.7.10-1.6-1.7.10:deobf"
  202. compileOnly "openmods:OpenModsLib:1.7.10-0.10:deobf"
  203. compileOnly "pneumaticCraft:PneumaticCraft:1.7.10-1.12.7-153:userdev"
  204. compileOnly "powercrystals:MineFactoryReloaded:[1.7.10]2.8.2B1-201:dev"
  205. compileOnly "ic2:IC2Classic:1.2.1.8:dev"
  206. compileOnly "com.builtbroken:AddictedToRed:1.7.10-0.4.0b145:deobf"
  207. compileOnly "com.builtbroken:Assembly-Line:1.7.10-0.5.7b180:deobf-dev"
  208. compileOnly "com.builtbroken:BasicIndustry:1.7.10-0.1.0b162:deobf"
  209. compileOnly "com.builtbroken:ComeCloser:1.7.10-0.7.0b10:deobf"
  210. compileOnly "com.builtbroken:ICBM-classic:1.7.10-2.16.4b239:deobf"
  211. compileOnly "com.builtbroken:Mffs:1.7.10-4.0.0b160:deobf"
  212. compileOnly "com.builtbroken:MilitaryBaseDecor:1.7.10-0.1.0b203:deobf"
  213. compileOnly "com.builtbroken:VoltzEngine:1.7.10-1.11.0b466:deobf"
  214. compileOnly "com.hbm:hbm:1.0.27:dev"
  215. compileOnly "com.celestek.hexcraft:HEXCraft:1.7.10-0.13.1:dev"
  216. compileOnly "team.chisel.ctmlib:CTMLib:MC1.7.10-1.4.1.5:deobf"
  217. compileOnly "team.chisel:Chisel:2.9.5.12:deobf"
  218. compileOnly "ganymedes01.etfuturum:Et_Futurum_Requiem:2.1.2:dev"
  219. compileOnly "blusunrize:ImmersiveEngineering:0.7.7:deobf"
  220. compileOnly "com.rwtema.funkylocomotion:funky-locomotion-1.7.10:beta-7:deobf"
  221. // List of potentially useful mods that may or may not be linked in here:
  222. //compileOnly "appeng:appliedenergistics2:rv3-beta-6:dev"
  223. //compileOnly "applecore:AppleCore:1.7.10-3.1.1:deobf"
  224. //compileOnly "binnie:binnie-mods:1.7.10-2.0.22:dev"
  225. //compileOnly "blusunrize:AquaTweaks-1.7.10:1.0:deobf"
  226. //compileOnly "blusunrize:ImmersiveEngineering:0.7.7:deobf"
  227. //compileOnly "climateControl:ClimateControl:0.6.61" // Hack
  228. //compileOnly "climateControl:ClimateControl:0.8.2" // Hack
  229. //compileOnly "climateControl:climateControl:0.6.beta59:dev" // Does nothing but compiles successfully
  230. //compileOnly "codechicken:CodeChickenCore:1.7.10-1.0.7.47:dev"
  231. //compileOnly "codechicken:CodeChickenLib:1.7.10-1.1.3.140:dev"
  232. //compileOnly "codechicken:ForgeMultipart:1.7.10-1.2.0.347:dev"
  233. //compileOnly "codechicken:NotEnoughItems:1.7.10-1.0.5.120:dev"
  234. //compileOnly "cofh:CoFHCore:1.7.10R3.0.4:dev"
  235. //compileOnly "cofh:CoFHLib:1.7.10R3.0.3:dev"
  236. //compileOnly "coloredlightscore:ColoredLightsCore:1.3.7.d524c02:deobf"
  237. //compileOnly "com.InfinityRaider.AgriCraft:AgriCraft:1.7.10-1.5.0:dev"
  238. //compileOnly "com.amadornes.framez:Framez:1.7.10-0.2-33:deobf"
  239. //compileOnly "com.amadornes.jtraits:JTraits:0.1"
  240. //compileOnly "com.azanor.baubles:Baubles:1.7.10-1.0.1.10:deobf"
  241. //compileOnly "com.bioxx.tfc:TerraFirmaCraft_1.7.10:0.79.28.908:deobf"
  242. //compileOnly "com.bluepowermod:BluePower:1.7.10-0.2.963:deobf"
  243. //compileOnly "com.builtbroken:AddictedToRed:1.7.10-0.4.0b145:deobf"
  244. //compileOnly "com.builtbroken:Assembly-Line:1.7.10-0.5.7b180:deobf-dev"
  245. //compileOnly "com.builtbroken:BasicIndustry:1.7.10-0.1.0b162:deobf"
  246. //compileOnly "com.builtbroken:ComeCloser:1.7.10-0.7.0b10:deobf"
  247. //compileOnly "com.builtbroken:ICBM:1.7.10-2.15.5b514:deobf-dev"
  248. //compileOnly "com.builtbroken:ICBM-classic:1.7.10-2.16.4b239:deobf"
  249. //compileOnly "com.builtbroken:Mffs:1.7.10-4.0.0b160:deobf"
  250. //compileOnly "com.builtbroken:MilitaryBaseDecor:1.7.10-0.1.0b203:deobf"
  251. //compileOnly "com.builtbroken:VoltzEngine:1.7.10-1.11.0b466:deobf"
  252. //compileOnly "com.carpentersblocks:CarpentersBlocks:3.3.8.2:dev"
  253. //compileOnly "com.celestek.hexcraft:HEXCraft:1.7.10-0.13.2:dev"
  254. //compileOnly "com.chocolate.chocolateQuest:chocolateQuest:1.7.10-1.1d" // Hack
  255. //compileOnly "com.creativemd:craftingmanager:0.7.6:dev"
  256. //compileOnly "com.creativemd:creativecore:1.3.24:dev"
  257. //compileOnly "com.enderio:EnderIO/1.7.10-2.3.0.430_beta:dev"
  258. //compileOnly "com.github.glitchfiend.biomesoplenty:BiomesOPlenty:1.7.10-2.1.0.1465:deobf"
  259. //compileOnly "com.gregoriust.gregtech:gregtech_1.7.10:6.09.00:dev"
  260. //compileOnly "com.hbm:hbm:1.0.27:dev"
  261. //compileOnly "com.mod-buildcraft:buildcraft:7.1.23:dev"
  262. //compileOnly "com.pahimar.ee3:EquivalentExchange3:1.7.10-0.3.0.0:dev"
  263. //compileOnly "com.rwtema.funkylocomotion:funky-locomotion-1.7.10:beta-7:deobf"
  264. //compileOnly "com.shedar.IC2NuclearControl:IC2NuclearControl:2.4.3a:dev"
  265. //compileOnly "com.wayoftime.bloodmagic:BloodMagic:1.7.10-1.3.3-18:deobf"
  266. //compileOnly "com.xcompwiz:mystcraft:1.7.10-0.12.3.04:dev"
  267. //compileOnly "dan200.computercraft:ComputerCraft:1.75" // Hack
  268. //compileOnly "delvr.streams:Streams:1.7.10-0.3.4:deobf"
  269. //compileOnly "enviromine:EnviroMine:1.3.124:deobf"
  270. //compileOnly "ganymedes01.etfuturum:Et_Futurum_Requiem:2.1.2:dev"
  271. //compileOnly "extracells:ExtraCells:1.7.10-2.3.14b200:deobf"
  272. //compileOnly "ic2:IC2Classic:1.2.1.8:dev"
  273. //compileOnly "iguanaman:HungerOverhaul:1.7.10-1.0.0-basic:deobf"
  274. //compileOnly "io.netty-opis:Netty-opis:4.0.23" // Needed for dev opis because it doesn't know how to specify dependencies properly
  275. //compileOnly "inventorytweaks:InventoryTweaks:1.59-dev:deobf"
  276. //compileOnly "java.moze_intel:ProjectE:1.7.10-PE1.10.1:dev"
  277. //compileOnly "k4unl:HydCraft:1.7.10-2.1.253:deobf"
  278. //compileOnly "k4unl:k4lib:1.7.10-0.1.55:deobf"
  279. //compileOnly "li.cil.oc:OpenComputers:MC1.7.10-1.7.2.1204:dev"
  280. //compileOnly "mcp.mobius.opis:Opis:1.2.5_1.7.10:dev"
  281. //compileOnly "mcp.mobius.waila:Waila:1.5.10_1.7.10:dev"
  282. //compileOnly "mcp.mobius.waila:Waila:1.5.11-RC2-NONEI_1.7.10:dev"
  283. //compileOnly "mekanism:MekanismAll:1.7.10-9.1.1.283:dev"
  284. //compileOnly "micdoodle8.mods:Galacticraft-Planets:1.7-3.0.12.504:Dev"
  285. //compileOnly "micdoodle8.mods:GalacticraftCore:1.7-3.0.12.504:Dev"
  286. //compileOnly "micdoodle8.mods:MicdoodleCore:1.7-3.0.12.504:Dev"
  287. //compileOnly "minechem:Minechem:1.7.10-6.0.407:dev"
  288. //compileOnly "minetweaker:MineTweaker3:1.7.10-3.0.10:dev-full"
  289. //compileOnly "mods.railcraft:Railcraft_1.7.10:9.12.3.0:dev"
  290. //compileOnly "mrtjp:ForgeRelocation:0.0.1.4:dev"
  291. //compileOnly "mrtjp:MrTJPCore:1.1.0.34:dev"
  292. //compileOnly "mrtjp:ProjectRed:1.7.10-4.7.0pre11.52:dev"
  293. //compileOnly "net.bdew:bdlib:1.9.4.110-mc1.7.10:dev"
  294. //compileOnly "net.bdew:gendustry:1.6.4-133-mc1.7.10:dev"
  295. //compileOnly "net.electricalage.eln:ElectricalAge-jrddunbr:1.16.3:dev"
  296. //compileOnly "net.machinemuse:ModularPowersuits:1.7.10-0.11.1.114" // Hack
  297. //compileOnly "net.machinemuse:Numina:0.4.1.105" // Hack
  298. //compileOnly "net.sengir.forestry:forestry_1.7.10:4.2.16.64:dev"
  299. //compileOnly "openblocks:OpenBlocks:1.7.10-1.6-1.7.10:deobf"
  300. //compileOnly "openmods.codecs:NotEnoughCodecs:1.7.10-0.6:deobf"
  301. //compileOnly "openmods:OpenModsLib:1.7.10-0.10:deobf"
  302. //compileOnly "pneumaticCraft:PneumaticCraft:1.7.10-1.12.7-153:userdev"
  303. //compileOnly "powercrystals:MineFactoryReloaded:[1.7.10]2.8.2B1-201:dev"
  304. //compileOnly "qmunity:QmunityLib:0.2.118:deobf"
  305. //compileOnly "santa:hairy-spice:0.1:dev"
  306. //compileOnly "train:Traincraft:5.0.2:dev"
  307. //compileOnly "team.chisel.ctmlib:CTMLib:MC1.7.10-1.4.1.5:deobf"
  308. //compileOnly "team.chisel:Chisel:2.9.5.12:deobf"
  309. //compileOnly "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev"
  310. //compileOnly "thaumicenergistics:thaumicenergistics:1.1.3.0:dev"
  311. //compileOnly "thermalexpansion:ThermalExpansion:1.7.10R4.0.3:dev"
  312. //compileOnly "thermalfoundation:ThermalFoundation:1.7.10R1.2.0:dev"
  313. //compileOnly "ttftcuts.atg:ATG:1.7.10-0.12.0:DEV"
  314. //compileOnly "tuhljin:automagy:0.28.2:api"
  315. //compileOnly "twilightforest:twilightforest:1.7.10-2.3.8dev:dev"
  316. //compileOnly "vazkii.botania:Botania:r1.8-250:deobf"
  317. //compileOnly 'com.miglayout:miglayout-swing:4.2' // Needed for dev opis because it doesn't know how to specify dependencies properly
  318. //compileOnly 'net.sf.opencsv:opencsv:2.3' // Needed for dev opis because it doesn't know how to specify dependencies properly
  319. //compileOnly 'org.apache.commons:commons-math3:3.2' // Needed for dev opis because it doesn't know how to specify dependencies properly
  320. //compileOnly 'org.jfree:jcommon:1.0.21' // Needed for dev opis because it doesn't know how to specify dependencies properly
  321. //compileOnly 'org.jfree:jfreechart:1.0.17' // Needed for dev opis because it doesn't know how to specify dependencies properly
  322. //compileOnly "zmaster587.advancedRocketry:AdvancedRocketry:1.7.10-1.4.0-21:deobf"
  323. }
  324. runClient {
  325. jvmArgs "-Xmx4096m", "-Xms1024m"
  326. if (project.hasProperty("appArgs")) {
  327. args Eval.me(appArgs)
  328. }
  329. }
  330. runServer {
  331. jvmArgs "-Xmx4096m", "-Xms1024m"
  332. if (project.hasProperty("appArgs")) {
  333. args Eval.me(appArgs)
  334. }
  335. }
  336. task buildInfo {
  337. def matcher = "v6.[0-9]*"
  338. def cmdTag = "git describe --match ${matcher} --abbrev=0 --exact-match --dirty"
  339. def procTag = cmdTag.execute()
  340. procTag.waitFor()
  341. if (procTag.exitValue() == 0) {
  342. ext.isRelease = true
  343. ext.tag = "${procTag.text.trim().substring(1)}" // Full Release
  344. ext.version = ext.tag
  345. } else {
  346. ext.isRelease = false
  347. def cmdLat = "git describe --match ${matcher} --dirty"
  348. def procLat = cmdLat.execute()
  349. procLat.waitFor()
  350. if (procLat.exitValue() == 0) {
  351. ext.tag = procLat.text.trim().substring(1)
  352. } else {
  353. def cmdDes = "git describe --dirty"
  354. def procDes = cmdDes.execute()
  355. procDes.waitFor()
  356. if (procDes.exitValue() == 0) {
  357. ext.tag = "DEV-${procDes.text.trim()}"
  358. } else {
  359. ext.tag = "NOGIT" // No tags at all?!
  360. }
  361. }
  362. if (System.getenv().VERSION_FALLBACK != null) {
  363. ext.version = System.getenv().VERSION_FALLBACK
  364. } else {
  365. ext.version = ext.tag
  366. }
  367. }
  368. }
  369. if (System.getenv().ARTIFACT_VERSION == null) {
  370. version = "${project.buildInfo.version}"
  371. } else {
  372. version = "${System.getenv().ARTIFACT_VERSION}"
  373. }
  374. processResources {
  375. inputs.property "version", project.buildInfo.tag
  376. inputs.property "mcversion", project.minecraft.version
  377. from(sourceSets.main.resources.srcDirs) {
  378. include 'mcmod.info'
  379. expand 'version':project.buildInfo.tag, 'mcversion':project.minecraft.version
  380. }
  381. from(sourceSets.main.resources.srcDirs) {
  382. exclude 'mcmod.info'
  383. }
  384. }
  385. task generateBuildInfo(type: Copy) {
  386. def templateContext = [
  387. version: project.buildInfo.tag,
  388. mcversion: project.minecraft.version,
  389. ]
  390. inputs.properties templateContext
  391. from 'src/template/java'
  392. into "$buildDir/generated-source/java"
  393. expand templateContext
  394. }
  395. sourceSets.main.java.srcDir "$buildDir/generated-source/java"
  396. compileJava.dependsOn generateBuildInfo
  397. compileJava.options.incremental = true
  398. task wrapper(type: Wrapper) {
  399. gradleVersion = '3.5.1'
  400. }
  401. //weave {
  402. // classesDir = sourceSets.main.output.classesDir
  403. // enableArtemisPlugin = true
  404. // enablePooledWeaving = true
  405. // generateLinkMutators = true
  406. // optimizeEntitySystems = true
  407. //}
  408. //fluid {
  409. // doFirst {
  410. // sourceSets.main.compileClasspath.each { c ->
  411. // if(!c.exists() && c.getName().lastIndexOf('.')==-1) {
  412. // c.mkdirs()
  413. // }
  414. // }
  415. // }
  416. // doLast {
  417. // def fp = "$buildDir/generated-source/fluid/com/artemis/E.java"
  418. // String fc = new File(fp).getText('UTF-8')
  419. // fc = fc.replaceAll('public final class', '@SuppressWarnings("all") public final class')
  420. // new File(fp).write(fc, 'UTF-8')
  421. //
  422. // fp = "$buildDir/generated-source/fluid/com/artemis/SuperMapper.java"
  423. // fc = new File(fp).getText('UTF-8')
  424. // fc = fc.replaceAll('public final class', '@SuppressWarnings("all") public final class')
  425. // fc = fc.replaceAll('E getE\\(int entityId\\) \\{', '@SuppressWarnings("unchecked") E getE(int entityId) {')
  426. // new File(fp).write(fc, 'UTF-8')
  427. // }
  428. // generatedSourcesDirectory = file("$buildDir/generated-source/fluid/")
  429. // classpath = sourceSets.main.compileClasspath
  430. //
  431. // // Fluid Configuration
  432. // // preferences.prefixComponentGetter = "get" // prefix for E::[get]pos()
  433. // // preferences.prefixComponentCreate = "" // prefix for E::[]pos()
  434. // // preferences.prefixComponentHas = "has" // prefix for E::[has]Pos()
  435. // // preferences.prefixComponentRemove = "remove" // prefix for E::[remove]Pos()
  436. // // preferences.generateTagMethods = true // add tag convenience methods (true).
  437. // // preferences.generateGroupMethods = true // add group convenience methods (true).
  438. // // preferences.generateBooleanComponentAccessors = true // Generate boolean accessors for flag components (true)?
  439. // // preferences.swallowGettersWithParameters = false // global setting. overridden by @Fluid annotation (false).
  440. //}
  441. //sourceSets.main.java.srcDirs += file("$buildDir/generated-source/fluid/")
  442. //sourceMainJava.dependsOn fluid
  443. //classes.finalizedBy weave
  444. jar {
  445. manifest {
  446. attributes(
  447. 'FMLAT': 'gregtech_at.cfg',
  448. 'FMLCorePluginContainsFMLMod': 'true',
  449. 'FMLCorePlugin': 'gregtech.asm.GT_ASM'
  450. )
  451. }
  452. configurations.shade.each { dep ->
  453. from(project.zipTree(dep)) {
  454. exclude 'META-INF', 'META-INF/**'
  455. }
  456. }
  457. exclude 'gregtech/api/interfaces/tileentity/IGregTechTileEntity.class'
  458. }
  459. task sourceJar(type: Jar) {
  460. manifest {}
  461. classifier = 'sources'
  462. from sourceSets.main.allSource
  463. exclude 'assets/**', 'logos/**'
  464. }
  465. task devJar(type: Jar) {
  466. manifest {
  467. attributes(
  468. 'FMLAT': 'gregtech_at.cfg',
  469. 'FMLCorePluginContainsFMLMod': 'true',
  470. 'FMLCorePlugin': 'gregtech.asm.GT_ASM'
  471. )
  472. }
  473. configurations.shade.each { dep ->
  474. from(project.zipTree(dep)) {
  475. exclude 'META-INF', 'META-INF/**'
  476. }
  477. }
  478. classifier = 'dev'
  479. from sourceSets.main.output
  480. }
  481. //task coreJar(type: Jar) {
  482. // dependsOn jar
  483. // manifest {
  484. // attributes(
  485. // 'FMLAT': 'gregtech_at.cfg',
  486. // 'FMLCorePluginContainsFMLMod': 'true',
  487. // 'FMLCorePlugin': 'gregtech.asm.GT_ASM'
  488. // )
  489. // }
  490. // classifier = 'core'
  491. // from sourceSets.main.output
  492. // exclude('gregtech/**')
  493. //}
  494. task changelog(type: Copy) {
  495. from('./CHANGELOG.md') {
  496. rename '.*', "$archivesBaseName-$version-changelog.md"
  497. }
  498. into './build/libs'
  499. ext.output = new File("./build/libs/$archivesBaseName-$version-changelog.md")
  500. }
  501. task supporterlist(type: Copy) {
  502. from('./src/main/resources/supporterlist.txt') {
  503. rename '.*', "$archivesBaseName-$version-supporterlist.txt"
  504. }
  505. into './build/libs'
  506. ext.output = new File("./build/libs/$archivesBaseName-$version-supporterlist.txt")
  507. }
  508. task supporterlistgold(type: Copy) {
  509. from('./src/main/resources/supporterlistgold.txt') {
  510. rename '.*', "$archivesBaseName-$version-supporterlistgold.txt"
  511. }
  512. into './build/libs'
  513. ext.output = new File("./build/libs/$archivesBaseName-$version-supporterlistgold.txt")
  514. }
  515. task defaultConfigPack(type: Zip) {
  516. from('./.defaultconfigs/')
  517. include('**/')
  518. classifier = 'defaultConfigPack'
  519. destinationDir = new File('./build/libs/')
  520. }
  521. jar.dependsOn supporterlist
  522. jar.dependsOn supporterlistgold
  523. jar.dependsOn changelog
  524. jar.dependsOn defaultConfigPack
  525. reobf {
  526. //reobf(coreJar) {
  527. // spec -> spec.classpath = sourceSets.main.compileClasspath
  528. //}
  529. }
  530. artifacts {
  531. archives devJar, sourceJar, changelog.output, supporterlist.output, supporterlistgold.output, defaultConfigPack //, coreJar
  532. }
  533. if (!hasProperty("mavenUsername")) {
  534. ext.mavenUsername="${System.getenv().MAVEN_USERNAME}"
  535. }
  536. if (!hasProperty("mavenPassword")) {
  537. ext.mavenPassword="${System.getenv().MAVEN_PASSWORD}"
  538. }
  539. if (!hasProperty("mavenURL")) {
  540. ext.mavenURL="${System.getenv().MAVEN_URL}"
  541. }
  542. if ( !project.buildInfo.tag.contains("-dirty") && (System.getenv().ONLY_RELEASES!="true" || project.buildInfo.isRelease) ) {
  543. task testIfUploadable {}
  544. uploadArchives {
  545. repositories {
  546. mavenDeployer {
  547. uniqueVersion = false
  548. repository(url: mavenURL) {
  549. authentication(userName: mavenUsername, password: mavenPassword)
  550. }
  551. }
  552. }
  553. }
  554. }