Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. // Stock setup partially grabbed from the internet, partially modified to fit with Hiroku and CraftSteamG's help. Magic.
  2.  
  3. // Taken from the internet. vvv
  4. buildscript {
  5. repositories {
  6. jcenter()
  7. maven { url = "http://files.minecraftforge.net/maven" }
  8. }
  9. dependencies {
  10. classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
  11. classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.4'
  12. }
  13. }
  14.  
  15. // Taken from the internet. vvv
  16. apply plugin: 'net.minecraftforge.gradle.forge'
  17. apply plugin: 'com.github.johnrengelman.shadow'
  18.  
  19. // Sets the version number shown in the file name.
  20. version = "1.0.0"
  21.  
  22. // Taken from the internet. vvv
  23. sourceCompatibility = targetCompatibility = "1.8"
  24. compileJava
  25. {
  26. sourceCompatibility = targetCompatibility = "1.8"
  27. }
  28.  
  29. // Enables use of the section character (§) instead of long tags. Thanks, Hiroku!
  30. //noinspection GroovyAssignabilityCheck
  31. tasks.withType(JavaCompile)
  32. {
  33. task ->
  34. task.options.encoding = 'UTF-8'
  35. task.options.fork = true
  36. }
  37.  
  38. // Basic info for what we're compiling against and how we're doing it, I think?
  39. minecraft
  40. {
  41. version = project.forgeVersion
  42. mappings = project.mcpVersion
  43. runDir = 'run'
  44. //useDepAts = true
  45. //makeObfSourceJar = false
  46. }
  47.  
  48. // Taken from the internet. vvv
  49. repositories {
  50. mavenCentral()
  51. maven {
  52. name = 'sponge'
  53. url = 'https://repo.spongepowered.org/maven'
  54. }
  55. }
  56.  
  57. // Allows Sponge and Pixelmon stuff to load up correctly.
  58. dependencies
  59. {
  60. // Grab and include Sponge.
  61. compile 'org.spongepowered:spongeforge:1.12.2-2838-7.1.8:dev'
  62. shadow fileTree(dir: 'libs', include: 'GooeyLibs-1.0.0.jar')
  63.  
  64. compile 'net.luckperms:api:5.0'
  65.  
  66. // Automatically grabs libraries from the libs folder and adds them to the project. Thanks, CraftSteamG!
  67. provided fileTree(dir: 'libs', include: '*.jar')
  68. }
  69.  
  70. configurations {
  71. provided
  72. compile.extendsFrom provided
  73. }
  74.  
  75. shadowJar {
  76. baseName = archivesBaseName
  77. classifier = null
  78. version = version + "-shadow"
  79. configurations = [project.configurations.shadow]
  80. minimize()
  81. exclude "META-INF/fml_cache_class_versions.json"
  82. //configurations = [project.configurations.compile]
  83. }
  84.  
  85. reobf {
  86. shadowJar {} // Reobfuscate the shadowed JAR
  87. }
  88.  
  89. processResources {
  90. // this will ensure that this task is redone when the versions change.
  91. inputs.property "version", project.version
  92. inputs.property "mcversion", project.minecraft.version
  93.  
  94. // replace stuff in mcmod.info, nothing else
  95. from(sourceSets.main.resources.srcDirs) {
  96. include "mcmod.info"
  97.  
  98. // replace version and mcversion
  99. expand "version": project.version, "mcversion": project.minecraft.version
  100. }
  101.  
  102. // copy everything else, thats not the mcmod.info
  103. from(sourceSets.main.resources.srcDirs) {
  104. exclude "mcmod.info"
  105. }
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement