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

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