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 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  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.overminddl1.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.overminddl1.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 "net.electricalage.eln:ElectricalAge-jrddunbr:1.16.3:dev"
  181. compileOnly "net.sengir.forestry:forestry_1.7.10:4.2.16.64:dev"
  182. compileOnly "com.mod-buildcraft:buildcraft:7.1.23:dev"
  183. compileOnly "com.azanor.baubles:Baubles:1.7.10-1.0.1.10:deobf"
  184. compileOnly "micdoodle8.mods:MicdoodleCore:1.7-3.0.12.504:Dev"
  185. compileOnly "micdoodle8.mods:GalacticraftCore:1.7-3.0.12.504:Dev"
  186. compileOnly "micdoodle8.mods:Galacticraft-Planets:1.7-3.0.12.504:Dev"
  187. compileOnly "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev"
  188. compileOnly "enviromine:EnviroMine:1.3.124:deobf"
  189. compileOnly "vazkii.botania:Botania:r1.8-250:deobf"
  190. compileOnly "mods.railcraft:Railcraft_1.7.10:9.12.3.0:dev"
  191. compileOnly "twilightforest:twilightforest:1.7.10-2.3.8dev:dev"
  192. compileOnly "appeng:appliedenergistics2:rv3-beta-6:dev"
  193. compileOnly "cofh:CoFHLib:1.7.10R3.0.3:dev"
  194. compileOnly "applecore:AppleCore:1.7.10-3.1.1:deobf"
  195. compileOnly "li.cil.oc:OpenComputers:MC1.7.10-1.7.2.1204:dev"
  196. // This ComputerCraft thing is *SUCH* a hack, but ComputerCraft is... not right... This only works because of CodeChickenCore Magic being included up above...
  197. compileOnly "dan200.computercraft:ComputerCraft:1.75"
  198. compileOnly "openblocks:OpenBlocks:1.7.10-1.6-1.7.10:deobf"
  199. compileOnly "openmods:OpenModsLib:1.7.10-0.10:deobf"
  200. compileOnly "ic2:IC2Classic:1.2.1.8:dev"
  201. compileOnly "com.builtbroken:AddictedToRed:1.7.10-0.4.0b145:deobf"
  202. compileOnly "com.builtbroken:Assembly-Line:1.7.10-0.5.7b180:deobf-dev"
  203. compileOnly "com.builtbroken:BasicIndustry:1.7.10-0.1.0b162:deobf"
  204. compileOnly "com.builtbroken:ComeCloser:1.7.10-0.7.0b10:deobf"
  205. compileOnly "com.builtbroken:ICBM-classic:1.7.10-2.16.4b239:deobf"
  206. compileOnly "com.builtbroken:Mffs:1.7.10-4.0.0b160:deobf"
  207. compileOnly "com.builtbroken:MilitaryBaseDecor:1.7.10-0.1.0b203:deobf"
  208. compileOnly "com.builtbroken:VoltzEngine:1.7.10-1.11.0b466:deobf"
  209. // List of potentially useful mods that may or may not be linked in here:
  210. //compileOnly "appeng:appliedenergistics2:rv3-beta-6:dev"
  211. //compileOnly "applecore:AppleCore:1.7.10-3.1.1:deobf"
  212. //compileOnly "binnie:binnie-mods:1.7.10-2.0.22:dev"
  213. //compileOnly "blusunrize:ImmersiveEngineering:0.7.7:deobf"
  214. //compileOnly "climateControl:ClimateControl:0.6.61" // Hack
  215. //compileOnly "climateControl:ClimateControl:0.8.2" // Hack
  216. //compileOnly "climateControl:climateControl:0.6.beta59:dev" // Does nothing but compiles successfully
  217. //compileOnly "codechicken:CodeChickenCore:1.7.10-1.0.7.47:dev"
  218. //compileOnly "codechicken:CodeChickenLib:1.7.10-1.1.3.140:dev"
  219. //compileOnly "codechicken:ForgeMultipart:1.7.10-1.2.0.347:dev"
  220. //compileOnly "codechicken:NotEnoughItems:1.7.10-1.0.5.120:dev"
  221. //compileOnly "cofh:CoFHCore:1.7.10R3.0.4:dev"
  222. //compileOnly "cofh:CoFHLib:1.7.10R3.0.3:dev"
  223. //compileOnly "com.InfinityRaider.AgriCraft:AgriCraft:1.7.10-1.5.0:dev"
  224. //compileOnly "com.amadornes.framez:Framez:1.7.10-0.2-33:deobf"
  225. //compileOnly "com.amadornes.jtraits:JTraits:0.1"
  226. //compileOnly "com.azanor.baubles:Baubles:1.7.10-1.0.1.10:deobf"
  227. //compileOnly "com.bioxx.tfc:TerraFirmaCraft_1.7.10:0.79.28.908:deobf"
  228. //compileOnly "com.bluepowermod:BluePower:1.7.10-0.2.963:deobf"
  229. //compileOnly "com.builtbroken:AddictedToRed:1.7.10-0.4.0b145:deobf"
  230. //compileOnly "com.builtbroken:Assembly-Line:1.7.10-0.5.7b180:deobf-dev"
  231. //compileOnly "com.builtbroken:BasicIndustry:1.7.10-0.1.0b162:deobf"
  232. //compileOnly "com.builtbroken:ComeCloser:1.7.10-0.7.0b10:deobf"
  233. //compileOnly "com.builtbroken:ICBM-classic:1.7.10-2.16.4b239:deobf"
  234. //compileOnly "com.builtbroken:Mffs:1.7.10-4.0.0b160:deobf"
  235. //compileOnly "com.builtbroken:MilitaryBaseDecor:1.7.10-0.1.0b203:deobf"
  236. //compileOnly "com.builtbroken:VoltzEngine:1.7.10-1.11.0b466:deobf"
  237. //compileOnly "com.carpentersblocks:CarpentersBlocks:3.3.8.2:dev"
  238. //compileOnly "com.chocolate.chocolateQuest:chocolateQuest:1.7.10-1.1d" // Hack
  239. //compileOnly "com.creativemd:craftingmanager:0.7.6:dev"
  240. //compileOnly "com.creativemd:creativecore:1.3.24:dev"
  241. //compileOnly "com.gregoriust.gregtech:gregtech_1.7.10:6.09.00:dev"
  242. //compileOnly "com.mod-buildcraft:buildcraft:7.1.23:dev"
  243. //compileOnly "com.rwtema.funkylocomotion:funky-locomotion-1.7.10:beta-7:deobf"
  244. //compileOnly "com.shedar.IC2NuclearControl:IC2NuclearControl:2.4.3a:dev"
  245. //compileOnly "com.wayoftime.bloodmagic:BloodMagic:1.7.10-1.3.3-18:deobf"
  246. //compileOnly "com.xcompwiz:mystcraft:1.7.10-0.12.3.04:dev"
  247. //compileOnly "dan200.computercraft:ComputerCraft:1.75" // Hack
  248. //compileOnly "delvr.streams:Streams:1.7.10-0.3.4:deobf"
  249. //compileOnly "enviromine:EnviroMine:1.3.124:deobf"
  250. //compileOnly "extracells:ExtraCells:1.7.10-2.3.14b200:deobf"
  251. //compileOnly "ic2:IC2Classic:1.2.1.8:dev"
  252. //compileOnly "io.netty-opis:Netty-opis:4.0.23" // Needed for dev opis because it doesn't know how to specify dependencies properly
  253. //compileOnly "java.moze_intel:ProjectE:1.7.10-PE1.10.1:dev"
  254. //compileOnly "li.cil.oc:OpenComputers:MC1.7.10-1.7.2.1204:dev"
  255. //compileOnly "mcp.mobius.opis:Opis:1.2.5_1.7.10:dev"
  256. //compileOnly "mcp.mobius.waila:Waila:1.5.10_1.7.10:dev"
  257. //compileOnly "mcp.mobius.waila:Waila:1.5.11-RC2-NONEI_1.7.10:dev"
  258. //compileOnly "mekanism:MekanismAll:1.7.10-9.1.1.283:dev"
  259. //compileOnly "micdoodle8.mods:Galacticraft-Planets:1.7-3.0.12.504:Dev"
  260. //compileOnly "micdoodle8.mods:GalacticraftCore:1.7-3.0.12.504:Dev"
  261. //compileOnly "micdoodle8.mods:MicdoodleCore:1.7-3.0.12.504:Dev"
  262. //compileOnly "minechem:Minechem:1.7.10-6.0.407:dev"
  263. //compileOnly "minetweaker:MineTweaker3:1.7.10-3.0.10:dev-full"
  264. //compileOnly "mods.railcraft:Railcraft_1.7.10:9.12.3.0:dev"
  265. //compileOnly "mrtjp:ForgeRelocation:0.0.1.4:dev"
  266. //compileOnly "mrtjp:MrTJPCore:1.1.0.34:dev"
  267. //compileOnly "mrtjp:ProjectRed:1.7.10-4.7.0pre11.52:dev"
  268. //compileOnly "net.bdew:bdlib:1.9.4.110-mc1.7.10:dev"
  269. //compileOnly "net.bdew:gendustry:1.6.4-133-mc1.7.10:dev"
  270. //compileOnly "net.electricalage.eln:ElectricalAge-jrddunbr:1.16.3:dev"
  271. //compileOnly "net.machinemuse:ModularPowersuits:1.7.10-0.11.1.114" // Hack
  272. //compileOnly "net.machinemuse:Numina:0.4.1.105" // Hack
  273. //compileOnly "net.sengir.forestry:forestry_1.7.10:4.2.16.64:dev"
  274. //compileOnly "openblocks:OpenBlocks:1.7.10-1.6-1.7.10:deobf"
  275. //compileOnly "openmods:OpenModsLib:1.7.10-0.10:deobf"
  276. //compileOnly "pneumaticCraft:PneumaticCraft:1.7.10-1.12.7-153:userdev"
  277. //compileOnly "powercrystals:MineFactoryReloaded:[1.7.10]2.8.2B1-201:dev"
  278. //compileOnly "qmunity:QmunityLib:0.2.118:deobf"
  279. //compileOnly "santa:hairy-spice:0.1:dev"
  280. //compileOnly "team.chisel.ctmlib:CTMLib:MC1.7.10-1.4.1.5:deobf"
  281. //compileOnly "team.chisel:Chisel:2.9.5.12:deobf"
  282. //compileOnly "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev"
  283. //compileOnly "ttftcuts.atg:ATG:1.7.10-0.12.0:DEV"
  284. //compileOnly "twilightforest:twilightforest:1.7.10-2.3.8dev:dev"
  285. //compileOnly "vazkii.botania:Botania:r1.8-250:deobf"
  286. //compileOnly 'com.miglayout:miglayout-swing:4.2' // Needed for dev opis because it doesn't know how to specify dependencies properly
  287. //compileOnly 'net.sf.opencsv:opencsv:2.3' // Needed for dev opis because it doesn't know how to specify dependencies properly
  288. //compileOnly 'org.apache.commons:commons-math3:3.2' // Needed for dev opis because it doesn't know how to specify dependencies properly
  289. //compileOnly 'org.jfree:jcommon:1.0.21' // Needed for dev opis because it doesn't know how to specify dependencies properly
  290. //compileOnly 'org.jfree:jfreechart:1.0.17' // Needed for dev opis because it doesn't know how to specify dependencies properly
  291. }
  292. runClient {
  293. jvmArgs "-Xmx4096m", "-Xms1024m"
  294. }
  295. runServer {
  296. jvmArgs "-Xmx4096m", "-Xms1024m"
  297. }
  298. task buildInfo {
  299. def matcher = "v6.[0-9]*"
  300. def cmdTag = "git describe --match ${matcher} --abbrev=0 --exact-match --dirty"
  301. def procTag = cmdTag.execute()
  302. procTag.waitFor()
  303. if (procTag.exitValue() == 0) {
  304. ext.isRelease = true
  305. ext.tag = "${procTag.text.trim().substring(1)}" // Full Release
  306. ext.version = ext.tag
  307. } else {
  308. ext.isRelease = false
  309. def cmdLat = "git describe --match ${matcher} --dirty"
  310. def procLat = cmdLat.execute()
  311. procLat.waitFor()
  312. if (procLat.exitValue() == 0) {
  313. ext.tag = procLat.text.trim().substring(1)
  314. } else {
  315. def cmdDes = "git describe --dirty"
  316. def procDes = cmdDes.execute()
  317. procDes.waitFor()
  318. if (procDes.exitValue() == 0) {
  319. ext.tag = "DEV-${procDes.text.trim()}"
  320. } else {
  321. ext.tag = "NOGIT" // No tags at all?!
  322. }
  323. }
  324. if (System.getenv().VERSION_FALLBACK != null) {
  325. ext.version = System.getenv().VERSION_FALLBACK
  326. } else {
  327. ext.version = ext.tag
  328. }
  329. }
  330. }
  331. if (System.getenv().ARTIFACT_VERSION == null) {
  332. version = "${project.buildInfo.version}"
  333. } else {
  334. version = "${System.getenv().ARTIFACT_VERSION}"
  335. }
  336. processResources {
  337. inputs.property "version", project.buildInfo.tag
  338. inputs.property "mcversion", project.minecraft.version
  339. from(sourceSets.main.resources.srcDirs) {
  340. include 'mcmod.info'
  341. expand 'version':project.buildInfo.tag, 'mcversion':project.minecraft.version
  342. }
  343. from(sourceSets.main.resources.srcDirs) {
  344. exclude 'mcmod.info'
  345. }
  346. }
  347. task generateBuildInfo(type: Copy) {
  348. def templateContext = [
  349. version: project.buildInfo.tag,
  350. mcversion: project.minecraft.version,
  351. builddate: new Date().toString(),
  352. ]
  353. inputs.properties templateContext
  354. from 'src/template/java'
  355. into "$buildDir/generated-source/java"
  356. expand templateContext
  357. }
  358. sourceSets.main.java.srcDir "$buildDir/generated-source/java"
  359. compileJava.dependsOn generateBuildInfo
  360. task wrapper(type: Wrapper) {
  361. gradleVersion = '3.5.1'
  362. }
  363. //weave {
  364. // classesDir = sourceSets.main.output.classesDir
  365. // enableArtemisPlugin = true
  366. // enablePooledWeaving = true
  367. // generateLinkMutators = true
  368. // optimizeEntitySystems = true
  369. //}
  370. //fluid {
  371. // doFirst {
  372. // sourceSets.main.compileClasspath.each { c ->
  373. // if(!c.exists() && c.getName().lastIndexOf('.')==-1) {
  374. // c.mkdirs()
  375. // }
  376. // }
  377. // }
  378. // doLast {
  379. // def fp = "$buildDir/generated-source/fluid/com/artemis/E.java"
  380. // String fc = new File(fp).getText('UTF-8')
  381. // fc = fc.replaceAll('public final class', '@SuppressWarnings("all") public final class')
  382. // new File(fp).write(fc, 'UTF-8')
  383. //
  384. // fp = "$buildDir/generated-source/fluid/com/artemis/SuperMapper.java"
  385. // fc = new File(fp).getText('UTF-8')
  386. // fc = fc.replaceAll('public final class', '@SuppressWarnings("all") public final class')
  387. // fc = fc.replaceAll('E getE\\(int entityId\\) \\{', '@SuppressWarnings("unchecked") E getE(int entityId) {')
  388. // new File(fp).write(fc, 'UTF-8')
  389. // }
  390. // generatedSourcesDirectory = file("$buildDir/generated-source/fluid/")
  391. // classpath = sourceSets.main.compileClasspath
  392. //
  393. // // Fluid Configuration
  394. // // preferences.prefixComponentGetter = "get" // prefix for E::[get]pos()
  395. // // preferences.prefixComponentCreate = "" // prefix for E::[]pos()
  396. // // preferences.prefixComponentHas = "has" // prefix for E::[has]Pos()
  397. // // preferences.prefixComponentRemove = "remove" // prefix for E::[remove]Pos()
  398. // // preferences.generateTagMethods = true // add tag convenience methods (true).
  399. // // preferences.generateGroupMethods = true // add group convenience methods (true).
  400. // // preferences.generateBooleanComponentAccessors = true // Generate boolean accessors for flag components (true)?
  401. // // preferences.swallowGettersWithParameters = false // global setting. overridden by @Fluid annotation (false).
  402. //}
  403. //sourceSets.main.java.srcDirs += file("$buildDir/generated-source/fluid/")
  404. //sourceMainJava.dependsOn fluid
  405. //classes.finalizedBy weave
  406. jar {
  407. manifest {
  408. attributes 'FMLAT': 'gregtech_at.cfg'
  409. }
  410. configurations.shade.each { dep ->
  411. from(project.zipTree(dep)) {
  412. exclude 'META-INF', 'META-INF/**'
  413. }
  414. }
  415. }
  416. task sourceJar(type: Jar) {
  417. manifest {}
  418. classifier = 'sources'
  419. from sourceSets.main.allSource
  420. exclude 'assets/**', 'logos/**'
  421. }
  422. task devJar(type: Jar) {
  423. manifest {
  424. attributes 'FMLAT': 'gregtech_at.cfg'
  425. }
  426. configurations.shade.each { dep ->
  427. from(project.zipTree(dep)) {
  428. exclude 'META-INF', 'META-INF/**'
  429. }
  430. }
  431. classifier = 'dev'
  432. from sourceSets.main.output
  433. }
  434. //task coreJar(type: Jar) {
  435. // dependsOn jar
  436. // manifest {
  437. // attributes 'FMLAT': 'gregtech_at.cfg'
  438. // }
  439. // classifier = 'core'
  440. // from sourceSets.main.output
  441. // exclude('gregtech/**')
  442. //}
  443. task changelog(type: Copy) {
  444. from('./CHANGELOG.md') {
  445. rename '.*', "$archivesBaseName-$version-changelog.md"
  446. }
  447. into './build/libs'
  448. ext.output = new File("./build/libs/$archivesBaseName-$version-changelog.md")
  449. }
  450. task supporterlist(type: Copy) {
  451. from('./src/main/resources/supporterlist.txt') {
  452. rename '.*', "$archivesBaseName-$version-supporterlist.txt"
  453. }
  454. into './build/libs'
  455. ext.output = new File("./build/libs/$archivesBaseName-$version-supporterlist.txt")
  456. }
  457. task supporterlistgold(type: Copy) {
  458. from('./src/main/resources/supporterlistgold.txt') {
  459. rename '.*', "$archivesBaseName-$version-supporterlistgold.txt"
  460. }
  461. into './build/libs'
  462. ext.output = new File("./build/libs/$archivesBaseName-$version-supporterlistgold.txt")
  463. }
  464. task defaultConfigPack(type: Zip) {
  465. from('./.defaultconfigs/')
  466. include('**/')
  467. classifier = 'defaultConfigPack'
  468. destinationDir = new File('./build/libs/')
  469. }
  470. jar.dependsOn supporterlist
  471. jar.dependsOn supporterlistgold
  472. jar.dependsOn changelog
  473. jar.dependsOn defaultConfigPack
  474. reobf {
  475. //reobf(coreJar) {
  476. // spec -> spec.classpath = sourceSets.main.compileClasspath
  477. //}
  478. }
  479. artifacts {
  480. archives devJar, sourceJar, changelog.output, supporterlist.output, supporterlistgold.output, defaultConfigPack //, coreJar
  481. }
  482. if (!hasProperty("mavenUsername")) {
  483. ext.mavenUsername="${System.getenv().MAVEN_USERNAME}"
  484. }
  485. if (!hasProperty("mavenPassword")) {
  486. ext.mavenPassword="${System.getenv().MAVEN_PASSWORD}"
  487. }
  488. if (!hasProperty("mavenURL")) {
  489. ext.mavenURL="${System.getenv().MAVEN_URL}"
  490. }
  491. if ( !project.buildInfo.tag.contains("-dirty") && (System.getenv().ONLY_RELEASES!="true" || project.buildInfo.isRelease) ) {
  492. uploadArchives {
  493. repositories {
  494. mavenDeployer {
  495. uniqueVersion = false
  496. repository(url: mavenURL) {
  497. authentication(userName: mavenUsername, password: mavenPassword)
  498. }
  499. }
  500. }
  501. }
  502. }