build.gradle 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. import org.gradle.plugins.ide.idea.model.*
  2. // define the properties file
  3. ext.configFile = file "gradle.properties"
  4. configFile.withReader {
  5. // read config. it shall from now on be referenced as simply config or as project.config
  6. def prop = new Properties()
  7. prop.load(it)
  8. project.ext.config = new ConfigSlurper().parse prop
  9. }
  10. // For those who want the bleeding edge
  11. buildscript {
  12. repositories {
  13. jcenter()
  14. maven {
  15. name = "forge"
  16. url = "http://files.minecraftforge.net/maven"
  17. }
  18. }
  19. dependencies {
  20. classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
  21. }
  22. }
  23. apply plugin: 'java'
  24. apply plugin: 'idea'
  25. apply plugin: 'net.minecraftforge.gradle.forge'
  26. ///////////////////////////////////////////////////
  27. // IDE Settings
  28. ///////////////////////////////////////////////////
  29. idea {
  30. project {
  31. languageLevel = '1.8'
  32. }
  33. }
  34. ///////////////////////////////////////////////////
  35. // ForgeGradle
  36. ///////////////////////////////////////////////////
  37. version = (hasProperty("CIRevision") ? CIRevision : config.mod_version)
  38. group = config.group_name
  39. archivesBaseName = "${config.mod_id}-${config.minecraft_version}"
  40. sourceCompatibility = JavaVersion.VERSION_1_8
  41. targetCompatibility = JavaVersion.VERSION_1_8
  42. minecraft {
  43. version = config.minecraft_version + "-" + config.forge_version // grab latest forge
  44. runDir = "run"
  45. mappings = config.mcp_mappings
  46. makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
  47. replace '@mod_version@', version
  48. replace '@mod_id@', config.mod_id
  49. replace '@ci_build@', hasProperty("CIRevision") ? 'true' : 'false'
  50. }
  51. processResources
  52. {
  53. // this will ensure that this task is redone when the versions change.
  54. inputs.property "version", project.version
  55. inputs.property "mcversion", project.minecraft.version
  56. // replace stuff in mcmod.info, nothing else
  57. from(sourceSets.main.resources.srcDirs) {
  58. include '**/*.info'
  59. include '**/*.properties'
  60. // replace version and mcversion
  61. expand ([
  62. 'version':project.version,
  63. 'mcversion':project.minecraft.version,
  64. 'forge_version': config.forge_version,
  65. 'mod_version': config.mod_version,
  66. 'minecraft_version': config.minecraft_version
  67. ])
  68. }
  69. // copy everything else, thats not the mcmod.info
  70. from(sourceSets.main.resources.srcDirs) {
  71. exclude 'mcmod.info'
  72. }
  73. }
  74. jar {
  75. classifier = 'universal'
  76. manifest {
  77. attributes 'FMLAT': 'tf_at.cfg'
  78. }
  79. }
  80. repositories {
  81. maven {
  82. name 'progwm\'s maven' // JEI
  83. url 'http://dvs1.progwml6.com/files/maven'
  84. }
  85. maven {
  86. name 'tterrag\'s maven' // CTM
  87. url 'http://maven.tterrag.com/'
  88. }
  89. }
  90. dependencies {
  91. //Disabled until I can speak with azanor
  92. //deobfCompile files('libs/Thaumcraft-1.7.10-4.2.3.5.jar')
  93. deobfCompile "mezz.jei:jei_${minecraft_version}:${jei_version}"
  94. //TODO switch over to CTM when present (not CTMLib) http://maven.tterrag.com/index.php?dir=team%2Fchisel
  95. deobfCompile "team.chisel.ctm:CTM:${ctm_version}"
  96. }