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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  1. buildscript {
  2. repositories {
  3. mavenCentral()
  4. maven {
  5. name = "forge"
  6. url = "https://files.minecraftforge.net/maven"
  7. }
  8. maven {
  9. name = "sonatype"
  10. url = "https://oss.sonatype.org/content/repositories/snapshots/"
  11. }
  12. }
  13. dependencies {
  14. classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
  15. }
  16. }
  17. allprojects {
  18. tasks.withType(JavaCompile) {
  19. options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
  20. }
  21. }
  22. apply plugin: 'eclipse'
  23. eclipse {
  24. classpath {
  25. downloadJavadoc = true
  26. downloadSources = true
  27. }
  28. }
  29. def eclipseRuntimeClasspath = ""
  30. 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"
  31. task eclipseForgeWorkspace(type: Copy) {
  32. doFirst {
  33. sourceSets.main.runtimeClasspath.collect {
  34. eclipseRuntimeClasspath += eclipseRuntimeClasspathTemplate.replaceAll('@@PATH@@', it.toString())
  35. ""
  36. }
  37. }
  38. from(".meta/eclipse/.metadata") {
  39. include '**/*.template'
  40. rename { it.replace '.template', '' }
  41. filter { it.replaceAll('@@eclipseRuntimeClasspath@@', eclipseRuntimeClasspath) }
  42. //rename '(.*).template', '$1'
  43. }
  44. from(".meta/eclipse/.metadata") {
  45. exclude '**/*.launch'
  46. }
  47. into "eclipse/.metadata"
  48. }
  49. import org.apache.tools.ant.taskdefs.condition.Os
  50. task eclipseForgeProject {
  51. doLast {
  52. if(!(new File("eclipse/Minecraft")).exists()) {
  53. if(!Os.isFamily(Os.FAMILY_WINDOWS)) {
  54. ant.symlink(resource: "../", link: "eclipse/Minecraft")
  55. } else {
  56. println("WINDOWS: Before loading this workspace with Eclipse, manually run this in an Elevated/Admin command prompt:")
  57. println("mklink /D " + (new File("").absolutePath) + "/eclipse/Minecraft " + (new File("").absolutePath))
  58. }
  59. }
  60. }
  61. }
  62. eclipseForgeProject.dependsOn(eclipseForgeWorkspace)
  63. tasks.eclipse.dependsOn(eclipseForgeProject)
  64. apply plugin: 'idea'
  65. idea{
  66. module {
  67. downloadJavadoc = true
  68. downloadSources = true
  69. }
  70. }
  71. repositories {
  72. maven {
  73. name = "gt"
  74. url = "https://gregtech.overminddl1.com/"
  75. }
  76. maven {
  77. name = "forge"
  78. url = "https://files.minecraftforge.net/maven"
  79. }
  80. //// No official maven'y storage for:
  81. //// - Baubles
  82. //// - MicdoodleCore
  83. //// - GalacticraftCore
  84. //// - Galacticraft-Planets
  85. //// - Thaumcraft
  86. //// - EnviroMine
  87. //// - Botania
  88. //// - Railcraft
  89. //// - twilightforest
  90. //// - appliedenergistics2
  91. //// - CoFHLib
  92. //// - ComputerCraft
  93. //// - RTG
  94. //// - OpenBlocks
  95. //// - IC2Classic
  96. //// Main storage for forestry_1.7.10
  97. //maven {
  98. // name = "ic2"
  99. // url = "http://maven.ic2.player.to/"
  100. //}
  101. //// Main storage for waila, jabba
  102. //maven {
  103. // name = "profmobius"
  104. // url = "http://default.mobiusstrip.eu/maven"
  105. //}
  106. //// Main storage for buildcraft
  107. //ivy {
  108. // name "BuildCraft"
  109. // artifactPattern "http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision](-[classifier]).[ext]"
  110. //}
  111. //// Main storage for CodeChickenCore, NotEnoughItems
  112. //// CodeChickenLib is in the Forge maven
  113. //maven {
  114. // name = "chickenbones"
  115. // url = "http://chickenbones.net/maven/"
  116. //}
  117. //// Main storage for AppleCore
  118. //maven {
  119. // name = "Apple"
  120. // url "http://www.ryanliptak.com/maven/"
  121. //}
  122. //// Main storage for OpenComputers
  123. //maven {
  124. // name = "OC repo"
  125. // url = "http://maven.cil.li/"
  126. //}
  127. }
  128. apply plugin: 'forge'
  129. group = "com.gregoriust.gregtech"
  130. archivesBaseName = "gregtech_1.7.10"
  131. version = "<UNKNOWN>"
  132. sourceCompatibility = 1.7
  133. targetCompatibility = 1.7
  134. compileJava.options.bootClasspath = org.gradle.internal.jvm.Jvm.current().getJre().getHomeDir().toString() +"/lib/rt.jar"
  135. compileJava {
  136. options.encoding = "UTF-8"
  137. }
  138. configurations {
  139. shade
  140. compile.extendsFrom shade
  141. }
  142. minecraft {
  143. version = "1.7.10-10.13.4.1614-1.7.10"
  144. runDir = "instance"
  145. }
  146. dependencies {
  147. //compile fileTree(dir: 'libs', include: '*.jar')
  148. runtime 'org.apache.commons:commons-math3:3.2' // Needed for dev opis because it doesn't know how to specify dependencies properly
  149. runtime 'org.jfree:jcommon:1.0.21' // Needed for dev opis because it doesn't know how to specify dependencies properly
  150. runtime 'org.jfree:jfreechart:1.0.17' // Needed for dev opis because it doesn't know how to specify dependencies properly
  151. runtime 'com.miglayout:miglayout-swing:4.2' // Needed for dev opis because it doesn't know how to specify dependencies properly
  152. runtime 'net.sf.opencsv:opencsv:2.3' // Needed for dev opis because it doesn't know how to specify dependencies properly
  153. runtime "io.netty-opis:Netty-opis:4.0.23" // Needed for dev opis because it doesn't know how to specify dependencies properly
  154. runtime "mcp.mobius.opis:Opis:1.2.5_1.7.10:dev"
  155. compile "mcp.mobius.waila:Waila:1.5.11-RC2-NONEI_1.7.10:dev"
  156. compile "codechicken:CodeChickenLib:1.7.10-1.1.3.140:dev"
  157. compile "codechicken:CodeChickenCore:1.7.10-1.0.7.47:dev"
  158. compile "codechicken:NotEnoughItems:1.7.10-1.0.5.120:dev"
  159. compileOnly "net.sengir.forestry:forestry_1.7.10:4.2.16.64:dev"
  160. compileOnly "com.mod-buildcraft:buildcraft:7.1.23:dev"
  161. compileOnly "com.azanor.baubles:Baubles:1.7.10-1.0.1.10:deobf"
  162. compileOnly "micdoodle8.mods:MicdoodleCore:1.7-3.0.12.504:Dev"
  163. compileOnly "micdoodle8.mods:GalacticraftCore:1.7-3.0.12.504:Dev"
  164. compileOnly "micdoodle8.mods:Galacticraft-Planets:1.7-3.0.12.504:Dev"
  165. compileOnly "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev"
  166. compileOnly "enviromine:EnviroMine:1.3.124:deobf"
  167. compileOnly "vazkii.botania:Botania:r1.8-250:deobf"
  168. compileOnly "mods.railcraft:Railcraft_1.7.10:9.12.3.0:dev"
  169. compileOnly "twilightforest:twilightforest:1.7.10-2.3.8dev:dev"
  170. compileOnly "appeng:appliedenergistics2:rv3-beta-6:dev"
  171. compileOnly "cofh:CoFHLib:1.7.10R3.0.3:dev"
  172. compileOnly "applecore:AppleCore:1.7.10-3.1.1:deobf"
  173. compileOnly "li.cil.oc:OpenComputers:MC1.7.10-1.7.2.1204:dev"
  174. // This ComputerCraft thing is *SUCH* a hack, but ComputerCraft is... not right... This only works because of CodeChickenCore Magic being included up above...
  175. compileOnly "dan200.computercraft:ComputerCraft:1.75"
  176. compileOnly "openblocks:OpenBlocks:1.7.10-1.6-1.7.10:deobf"
  177. compileOnly "openmods:OpenModsLib:1.7.10-0.10:deobf"
  178. compileOnly "ic2:IC2Classic:1.2.1.8:dev"
  179. // List of potentially useful mods that may or may not be linked in here:
  180. //compileOnly "appeng:appliedenergistics2:rv3-beta-6:dev"
  181. //compileOnly "applecore:AppleCore:1.7.10-3.1.1:deobf"
  182. //compileOnly "binnie:binnie-mods:1.7.10-2.0.22:dev"
  183. //compileOnly "blusunrize:ImmersiveEngineering:0.7.7:deobf"
  184. //compileOnly "climateControl:ClimateControl:0.6.61" // Hack
  185. //compileOnly "climateControl:ClimateControl:0.8.2" // Hack
  186. //compileOnly "climateControl:climateControl:0.6.beta59:dev" // Does nothing but compiles successfully
  187. //compileOnly "codechicken:CodeChickenCore:1.7.10-1.0.7.47:dev"
  188. //compileOnly "codechicken:CodeChickenLib:1.7.10-1.1.3.140:dev"
  189. //compileOnly "codechicken:ForgeMultipart:1.7.10-1.2.0.347:dev"
  190. //compileOnly "codechicken:NotEnoughItems:1.7.10-1.0.5.120:dev"
  191. //compileOnly "cofh:CoFHCore:1.7.10R3.0.4:dev"
  192. //compileOnly "cofh:CoFHLib:1.7.10R3.0.3:dev"
  193. //compileOnly "com.InfinityRaider.AgriCraft:AgriCraft:1.7.10-1.5.0:dev"
  194. //compileOnly "com.amadornes.framez:Framez:1.7.10-0.2-33:deobf"
  195. //compileOnly "com.amadornes.jtraits:JTraits:0.1"
  196. //compileOnly "com.azanor.baubles:Baubles:1.7.10-1.0.1.10:deobf"
  197. //compileOnly "com.bioxx.tfc:TerraFirmaCraft_1.7.10:0.79.28.908:deobf"
  198. //compileOnly "com.bluepowermod:BluePower:1.7.10-0.2.963:deobf"
  199. //compileOnly "com.builtbroken:ICBM:1.7.10-2.15.5b514:deobf-dev"
  200. //compileOnly "com.builtbroken:VoltzEngine:1.7.10-1.11.0b466:deobf"
  201. //compileOnly "com.carpentersblocks:CarpentersBlocks:3.3.8.2:dev"
  202. //compileOnly "com.chocolate.chocolateQuest:chocolateQuest:1.7.10-1.1d" // Hack
  203. //compileOnly "com.creativemd:craftingmanager:0.7.6:dev"
  204. //compileOnly "com.creativemd:creativecore:1.3.24:dev"
  205. //compileOnly "com.gregoriust.gregtech:gregtech_1.7.10:6.09.00:dev"
  206. //compileOnly "com.mod-buildcraft:buildcraft:7.1.23:dev"
  207. //compileOnly "com.rwtema.funkylocomotion:funky-locomotion-1.7.10:beta-7:deobf"
  208. //compileOnly "com.wayoftime.bloodmagic:BloodMagic:1.7.10-1.3.3-18:deobf"
  209. //compileOnly "com.xcompwiz:mystcraft:1.7.10-0.12.3.04:dev"
  210. //compileOnly "dan200.computercraft:ComputerCraft:1.75" // Hack
  211. //compileOnly "delvr.streams:Streams:1.7.10-0.3.4:deobf"
  212. //compileOnly "enviromine:EnviroMine:1.3.124:deobf"
  213. //compileOnly "extracells:ExtraCells:1.7.10-2.3.14b200:deobf"
  214. //compileOnly "ic2:IC2Classic:1.2.1.8:dev"
  215. //compileOnly "io.netty-opis:Netty-opis:4.0.23" // Needed for dev opis because it doesn't know how to specify dependencies properly
  216. //compileOnly "java.moze_intel:ProjectE:1.7.10-PE1.10.1:dev"
  217. //compileOnly "li.cil.oc:OpenComputers:MC1.7.10-1.7.2.1204:dev"
  218. //compileOnly "mcp.mobius.opis:Opis:1.2.5_1.7.10:dev"
  219. //compileOnly "mcp.mobius.waila:Waila:1.5.10_1.7.10:dev"
  220. //compileOnly "mcp.mobius.waila:Waila:1.5.11-RC2-NONEI_1.7.10:dev"
  221. //compileOnly "mekanism:MekanismAll:1.7.10-9.1.1.283:dev"
  222. //compileOnly "micdoodle8.mods:Galacticraft-Planets:1.7-3.0.12.504:Dev"
  223. //compileOnly "micdoodle8.mods:GalacticraftCore:1.7-3.0.12.504:Dev"
  224. //compileOnly "micdoodle8.mods:MicdoodleCore:1.7-3.0.12.504:Dev"
  225. //compileOnly "minechem:Minechem:1.7.10-6.0.407:dev"
  226. //compileOnly "minetweaker:MineTweaker3:1.7.10-3.0.10:dev-full"
  227. //compileOnly "mods.railcraft:Railcraft_1.7.10:9.12.3.0:dev"
  228. //compileOnly "mrtjp:ForgeRelocation:0.0.1.4:dev"
  229. //compileOnly "mrtjp:MrTJPCore:1.1.0.34:dev"
  230. //compileOnly "mrtjp:ProjectRed:1.7.10-4.7.0pre11.52:dev"
  231. //compileOnly "net.bdew:bdlib:1.9.4.110-mc1.7.10:dev"
  232. //compileOnly "net.bdew:gendustry:1.6.4-133-mc1.7.10:dev"
  233. //compileOnly "net.machinemuse:ModularPowersuits:1.7.10-0.11.1.114" // Hack
  234. //compileOnly "net.machinemuse:Numina:0.4.1.105" // Hack
  235. //compileOnly "net.sengir.forestry:forestry_1.7.10:4.2.16.64:dev"
  236. //compileOnly "openblocks:OpenBlocks:1.7.10-1.6-1.7.10:deobf"
  237. //compileOnly "openmods:OpenModsLib:1.7.10-0.10:deobf"
  238. //compileOnly "pneumaticCraft:PneumaticCraft:1.7.10-1.12.7-153:userdev"
  239. //compileOnly "powercrystals:MineFactoryReloaded:[1.7.10]2.8.2B1-201:dev"
  240. //compileOnly "qmunity:QmunityLib:0.2.118:deobf"
  241. //compileOnly "santa:hairy-spice:0.1:dev"
  242. //compileOnly "team.chisel.ctmlib:CTMLib:MC1.7.10-1.4.1.5:deobf"
  243. //compileOnly "team.chisel:Chisel:2.9.5.12:deobf"
  244. //compileOnly "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev"
  245. //compileOnly "ttftcuts.atg:ATG:1.7.10-0.12.0:DEV"
  246. //compileOnly "twilightforest:twilightforest:1.7.10-2.3.8dev:dev"
  247. //compileOnly "vazkii.botania:Botania:r1.8-250:deobf"
  248. //compileOnly 'com.miglayout:miglayout-swing:4.2' // Needed for dev opis because it doesn't know how to specify dependencies properly
  249. //compileOnly 'net.sf.opencsv:opencsv:2.3' // Needed for dev opis because it doesn't know how to specify dependencies properly
  250. //compileOnly 'org.apache.commons:commons-math3:3.2' // Needed for dev opis because it doesn't know how to specify dependencies properly
  251. //compileOnly 'org.jfree:jcommon:1.0.21' // Needed for dev opis because it doesn't know how to specify dependencies properly
  252. //compileOnly 'org.jfree:jfreechart:1.0.17' // Needed for dev opis because it doesn't know how to specify dependencies properly
  253. }
  254. runClient {
  255. jvmArgs "-Xmx4096m", "-Xms1024m"
  256. }
  257. runServer {
  258. jvmArgs "-Xmx4096m", "-Xms1024m"
  259. }
  260. task buildInfo {
  261. def matcher = "v6.[0-9]*"
  262. def cmdTag = "git describe --match ${matcher} --abbrev=0 --exact-match --dirty"
  263. def procTag = cmdTag.execute()
  264. procTag.waitFor()
  265. if (procTag.exitValue() == 0) {
  266. ext.isRelease = true
  267. ext.tag = "${procTag.text.trim().substring(1)}" // Full Release
  268. ext.version = ext.tag
  269. } else {
  270. ext.isRelease = false
  271. def cmdLat = "git describe --match ${matcher} --dirty"
  272. def procLat = cmdLat.execute()
  273. procLat.waitFor()
  274. if (procLat.exitValue() == 0) {
  275. ext.tag = procLat.text.trim().substring(1)
  276. } else {
  277. def cmdDes = "git describe --dirty"
  278. def procDes = cmdDes.execute()
  279. procDes.waitFor()
  280. if (procDes.exitValue() == 0) {
  281. ext.tag = "DEV-${procDes.text.trim()}"
  282. } else {
  283. ext.tag = "NOGIT" // No tags at all?!
  284. }
  285. }
  286. if (System.getenv().VERSION_FALLBACK != null) {
  287. ext.version = System.getenv().VERSION_FALLBACK
  288. } else {
  289. ext.version = ext.tag
  290. }
  291. }
  292. }
  293. if (System.getenv().ARTIFACT_VERSION == null) {
  294. version = "${project.buildInfo.version}"
  295. } else {
  296. version = "${System.getenv().ARTIFACT_VERSION}"
  297. }
  298. processResources {
  299. inputs.property "version", project.buildInfo.tag
  300. inputs.property "mcversion", project.minecraft.version
  301. from(sourceSets.main.resources.srcDirs) {
  302. include 'mcmod.info'
  303. expand 'version':project.buildInfo.tag, 'mcversion':project.minecraft.version
  304. }
  305. from(sourceSets.main.resources.srcDirs) {
  306. exclude 'mcmod.info'
  307. }
  308. }
  309. task wrapper(type: Wrapper) {
  310. gradleVersion = '3.5.1'
  311. }
  312. jar {
  313. manifest {
  314. attributes 'FMLAT': 'gregtech_at.cfg'
  315. }
  316. // For future use:
  317. //configurations.shade.each { dep ->
  318. // from(project.zipTree(dep)) {
  319. // exclude 'META-INF', 'META-INF/**'
  320. // }
  321. //}
  322. }
  323. task sourceJar(type: Jar) {
  324. manifest {}
  325. classifier = 'sources'
  326. from sourceSets.main.allSource
  327. include 'gregapi/**'
  328. }
  329. task devJar(type: Jar) {
  330. manifest {
  331. attributes 'FMLAT': 'gregtech_at.cfg'
  332. }
  333. // For future use:
  334. //configurations.shade.each { dep ->
  335. // from(project.zipTree(dep)) {
  336. // exclude 'META-INF', 'META-INF/**'
  337. // }
  338. //}
  339. classifier = 'dev'
  340. from sourceSets.main.output
  341. }
  342. task coreJar(type: Jar) {
  343. dependsOn jar
  344. manifest {
  345. attributes 'FMLAT': 'gregtech_at.cfg'
  346. }
  347. classifier = 'core'
  348. from sourceSets.main.output
  349. exclude('gregtech/**')
  350. }
  351. reobf {
  352. reobf(coreJar) {
  353. spec -> spec.classpath = sourceSets.main.compileClasspath
  354. }
  355. }
  356. artifacts {
  357. archives devJar, sourceJar, coreJar
  358. }
  359. if (!hasProperty("mavenUsername")) {
  360. ext.mavenUsername="${System.getenv().MAVEN_USERNAME}"
  361. }
  362. if (!hasProperty("mavenPassword")) {
  363. ext.mavenPassword="${System.getenv().MAVEN_PASSWORD}"
  364. }
  365. if (!hasProperty("mavenURL")) {
  366. ext.mavenURL="${System.getenv().MAVEN_URL}"
  367. }
  368. if ( !project.buildInfo.tag.contains("-dirty") && (System.getenv().ONLY_RELEASES!="true" || project.buildInfo.isRelease) ) {
  369. uploadArchives {
  370. repositories {
  371. mavenDeployer {
  372. uniqueVersion = false
  373. repository(url: mavenURL) {
  374. authentication(userName: mavenUsername, password: mavenPassword)
  375. }
  376. }
  377. }
  378. }
  379. }