Minecraft memory usage optimization mod. Please note that code contained herein is not a suggestion for Minecraft unless explicitly declared elsewhere, in writing, by the rightsholder(s).
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 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. buildscript {
  2. repositories {
  3. jcenter()
  4. maven { url = "http://files.minecraftforge.net/maven" }
  5. maven {
  6. url "https://plugins.gradle.org/m2/"
  7. }
  8. }
  9. dependencies {
  10. classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
  11. classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
  12. classpath "gradle.plugin.net.minecrell:licenser:0.3"
  13. }
  14. }
  15. apply plugin: 'net.minecraftforge.gradle.forge'
  16. apply plugin: 'com.github.johnrengelman.shadow'
  17. apply plugin: 'net.minecrell.licenser'
  18. version = "0.10.4-1.12.2"
  19. group= "pl.asie.foamfix" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
  20. archivesBaseName = "foamfix"
  21. sourceCompatibility = JavaVersion.VERSION_1_8
  22. targetCompatibility = JavaVersion.VERSION_1_8
  23. minecraft {
  24. version = "1.12.2-14.23.5.2772"
  25. runDir = "run"
  26. mappings = "snapshot_20180808"
  27. makeObfSourceJar = false
  28. replace '@VERSION@', project.version
  29. }
  30. repositories {
  31. mavenCentral()
  32. }
  33. license {
  34. sourceSets = [project.sourceSets.main]
  35. header = project.file("docs/licenses/COPYING")
  36. ignoreFailures = true
  37. exclude '**/*.lang'
  38. exclude '**/*.info'
  39. exclude '**/*.mcmeta'
  40. matching('**/pl/asie/foamfix/api/**') {
  41. header = project.file("docs/licenses/LICENSE-API")
  42. }
  43. matching('**/pl/asie/foamfix/common/WorldNuller.java') {
  44. header = project.file("docs/licenses/LICENSE-neptunepink")
  45. }
  46. }
  47. configurations {
  48. shadow
  49. compile.extendsFrom shadow
  50. }
  51. repositories {
  52. maven {
  53. name 'DVS1 Maven FS'
  54. url 'http://dvs1.progwml6.com/files/maven'
  55. }
  56. }
  57. dependencies {
  58. deobfCompile "mezz.jei:jei_1.12.2:4.8.5.147"
  59. compile "org.openjdk.jmh:jmh-generator-annprocess:1.20"
  60. }
  61. processResources {
  62. // this will ensure that this task is redone when the versions change.
  63. inputs.property "version", project.version
  64. inputs.property "mcversion", project.minecraft.version
  65. // replace stuff in mcmod.info, nothing else
  66. from(sourceSets.main.resources.srcDirs) {
  67. include 'mcmod.info'
  68. // replace version and mcversion
  69. expand 'version':project.version, 'mcversion':project.minecraft.version
  70. }
  71. // copy everything else, thats not the mcmod.info
  72. from(sourceSets.main.resources.srcDirs) {
  73. exclude 'mcmod.info'
  74. }
  75. }
  76. jar.dependsOn shadowJar
  77. jar.enabled = false
  78. shadowJar {
  79. archiveName = tasks.jar.archiveName
  80. configurations = [project.configurations.shadow]
  81. }
  82. reobfJar {
  83. setJar(tasks.shadowJar.archivePath)
  84. }
  85. reobfJar.dependsOn shadowJar
  86. task anarchyJar(type: Jar, dependsOn: classes) {
  87. from(sourceSets.main.output)
  88. exclude("META-INF/BenchmarkList")
  89. exclude("META-INF/CompilerHints")
  90. exclude("assets/foamfix/flamingo.png")
  91. exclude("pl/asie/foamfix/client/dolphin")
  92. exclude("pl/asie/foamfix/tests")
  93. manifest.attributes "Manifest-Version": "1.0"
  94. manifest.attributes "FMLCorePluginContainsFMLMod": "true"
  95. manifest.attributes "FMLCorePlugin": "pl.asie.foamfix.coremod.FoamFixCore"
  96. archiveName = (archiveName - ".jar") + "-anarchy.jar"
  97. }
  98. task lawfulJar(type: Jar, dependsOn: classes) {
  99. from(sourceSets.main.output)
  100. exclude("META-INF/BenchmarkList")
  101. exclude("META-INF/CompilerHints")
  102. exclude("assets/foamfix/flamingo.png")
  103. exclude("pl/asie/foamfix/client/dolphin")
  104. exclude("pl/asie/foamfix/tests")
  105. exclude("pl/asie/foamfix/coremod")
  106. exclude("pl/asie/patchy")
  107. archiveName = (archiveName - ".jar") + "-law.jar"
  108. }
  109. reobf {
  110. anarchyJar { mappingType = 'SEARGE' }
  111. lawfulJar { mappingType = 'SEARGE' }
  112. }
  113. assemble.dependsOn(anarchyJar, lawfulJar)
  114. task signLawfulJar(type: SignJar, dependsOn: lawfulJar) {
  115. onlyIf {
  116. project.hasProperty('keyStore')
  117. }
  118. keyStore = project.keyStore
  119. alias = project.keyStoreAlias
  120. storePass = project.keyStorePass
  121. keyPass = project.keyStoreKeyPass
  122. inputFile = lawfulJar.archivePath
  123. outputFile = lawfulJar.archivePath
  124. }
  125. task signAnarchyJar(type: SignJar, dependsOn: anarchyJar) {
  126. onlyIf {
  127. project.hasProperty('keyStore')
  128. }
  129. keyStore = project.keyStore
  130. alias = project.keyStoreAlias
  131. storePass = project.keyStorePass
  132. keyPass = project.keyStoreKeyPass
  133. inputFile = anarchyJar.archivePath
  134. outputFile = anarchyJar.archivePath
  135. }
  136. build.dependsOn(signLawfulJar, signAnarchyJar)