build.gradle 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. import java.util.stream.Collectors
  2. buildscript {
  3. repositories {
  4. maven { url = 'https://files.minecraftforge.net/maven' }
  5. jcenter()
  6. mavenCentral()
  7. maven {url='https://dist.creeper.host/Sponge/maven'}
  8. }
  9. dependencies {
  10. classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
  11. classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
  12. }
  13. }
  14. apply plugin: 'net.minecraftforge.gradle'
  15. // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
  16. apply plugin: 'eclipse'
  17. apply plugin: 'maven-publish'
  18. version = "${mod_version}"
  19. group = "malte0811.${modid}" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
  20. archivesBaseName = "${modid}"
  21. def mixinConfigs = ["predicates", "fastmap", "nopropertymap"].stream()
  22. .map({s -> archivesBaseName+"."+s+".mixin.json"})
  23. .collect(Collectors.toList())
  24. def mixinConfigArg = mixinConfigs.stream()
  25. .map({s -> "-mixin.config="+s})
  26. .collect(Collectors.toList())
  27. def mixinConfigManifestEntry = mixinConfigs.join(",");
  28. sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
  29. minecraft {
  30. // The mappings can be changed at any time, and must be in the following format.
  31. // snapshot_YYYYMMDD Snapshot are built nightly.
  32. // stable_# Stables are built at the discretion of the MCP team.
  33. // Use non-default mappings at your own risk. they may not always work.
  34. // Simply re-run your setup task after changing the mappings to update your workspace.
  35. mappings channel: "snapshot", version: "${mapping}-${mcp_version}"
  36. // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
  37. //accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
  38. // Default run configurations.
  39. // These can be tweaked, removed, or duplicated as needed.
  40. runs {
  41. client {
  42. workingDirectory project.file('run')
  43. args mixinConfigArg
  44. property 'mixin.env.disableRefMap', 'true'
  45. property 'mixin.debug.export', 'true'
  46. // Recommended logging level for the console
  47. property 'forge.logging.console.level', 'debug'
  48. mods {
  49. examplemod {
  50. source sourceSets.main
  51. }
  52. }
  53. }
  54. server {
  55. workingDirectory project.file('run')
  56. args mixinConfigArg
  57. arg "-nogui"
  58. property 'mixin.env.disableRefMap', 'true'
  59. // Recommended logging level for the console
  60. property 'forge.logging.console.level', 'debug'
  61. mods {
  62. examplemod {
  63. source sourceSets.main
  64. }
  65. }
  66. }
  67. }
  68. }
  69. def customGradle = rootProject.file('custom.gradle');
  70. if (customGradle.exists()) {
  71. apply from: customGradle;
  72. }
  73. repositories{
  74. maven {
  75. // location of the maven that hosts JEI files
  76. name = "Progwml6 maven"
  77. url = "https://dvs1.progwml6.com/files/maven/"
  78. }
  79. maven {
  80. // location of a maven mirror for JEI files, as a fallback
  81. name = "ModMaven"
  82. url = "https://modmaven.k-4u.nl"
  83. }
  84. maven {
  85. name = "BlameJared"
  86. url = "https://maven.blamejared.com/"
  87. }
  88. jcenter()
  89. mavenCentral()
  90. }
  91. dependencies {
  92. minecraft "net.minecraftforge:forge:${mc_version}-${forge_version}"
  93. runtimeOnly fg.deobf("mezz.jei:jei-1.16.3:7.6.0.49")
  94. }
  95. // Example for how to get properties into the manifest for reading by the runtime..
  96. jar {
  97. manifest {
  98. attributes([
  99. "Specification-Title": "${modid}",
  100. "Specification-Version": "1", // We are version 1 of ourselves
  101. "Implementation-Title": project.name,
  102. "Implementation-Version": "${version}",
  103. "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
  104. "MixinConfigs": mixinConfigManifestEntry
  105. ])
  106. }
  107. }
  108. apply plugin: 'org.spongepowered.mixin'
  109. mixin {
  110. add sourceSets.main, "${modid}.refmap.json"
  111. }