Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.81 KB | None | 0 0
  1. buildscript {
  2. repositories {
  3. jcenter()
  4. maven { url = "http://files.minecraftforge.net/maven" }
  5. }
  6. dependencies {
  7. classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
  8. }
  9. }
  10.  
  11. plugins {
  12. id 'com.github.johnrengelman.shadow' version '1.2.3'
  13. }
  14.  
  15. apply plugin: 'net.minecraftforge.gradle.forge'
  16.  
  17. ext.configFile = file "build.properties"
  18.  
  19. configFile.withReader {
  20. def prop = new Properties()
  21. prop.load(it)
  22. project.ext.config = new ConfigSlurper().parse prop
  23. }
  24.  
  25. version = config.mod_version
  26. group = config.mod_group
  27. archivesBaseName = config.mod_name
  28.  
  29. if (System.getenv().BUILD_NUMBER)
  30. version = "${config.mod_version}.b${System.getenv().BUILD_NUMBER}"
  31.  
  32. sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
  33. compileJava {
  34. sourceCompatibility = targetCompatibility = '1.8'
  35. }
  36.  
  37. minecraft {
  38. version = "${config.mc_version}-${config.forge_version}"
  39. runDir = "run"
  40. // the mappings can be changed at any time, and must be in the following format.
  41. // snapshot_YYYYMMDD snapshot are built nightly.
  42. // stable_# stables are built at the discretion of the MCP team.
  43. // Use non-default mappings at your own risk. they may not always work.
  44. // simply re-run your setup task after changing the mappings to update your workspace.
  45. mappings = "snapshot_20170624"
  46. // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
  47.  
  48. }
  49.  
  50. dependencies {
  51. compile 'org.apache.httpcomponents:httpcore:4.4.6'
  52. compile 'org.apache.httpcomponents:httpcore-nio:4.4.6'
  53. compile 'org.apache.httpcomponents:httpclient:4.5.3'
  54. compile 'org.apache.httpcomponents:httpasyncclient:4.1.3'
  55. compile 'org.apache.httpcomponents:httpcore-nio:4.4.6'
  56. compile 'org.apache.httpcomponents:httpmime:4.5.3'
  57. compile 'org.json:json:20170516'
  58. compile 'com.mashape.unirest:unirest-java:1.4.9'
  59. compile 'commons-logging:commons-logging:1.2'
  60. compile 'org.bouncycastle:bcprov-jdk15on:1.57'
  61. }
  62.  
  63. shadowJar {
  64. dependencies {
  65. include(dependency('org.apache.httpcomponents:httpcore:4.4.6'))
  66. include(dependency('org.apache.httpcomponents:httpcore-nio:4.4.6'))
  67. include(dependency('org.apache.httpcomponents:httpclient:4.5.3'))
  68. include(dependency('org.apache.httpcomponents:httpasyncclient:4.1.3'))
  69. include(dependency('org.apache.httpcomponents:httpcore-nio:4.4.6'))
  70. include(dependency('org.apache.httpcomponents:httpmime:4.5.3'))
  71. include(dependency('org.json:json:20170516'))
  72. include(dependency('com.mashape.unirest:unirest-java:1.4.9'))
  73. include(dependency('commons-logging:commons-logging:1.2'))
  74. }
  75.  
  76. relocate 'org.apache.http', 'com.mattsmeets.lib.org.apache.http'
  77. relocate 'org.apache.commons.logging', 'com.mattsmeets.lib.org.apache.commons.logging'
  78. relocate 'org.json', 'com.mattsmeets.lib.org.json'
  79. relocate 'mozilla', 'com.mattsmeets.lib.mozilla'
  80. relocate 'com.mashape.unirest', 'com.mattsmeets.lib.com.mashape.unirest'
  81. relocate 'dummyThing', 'com.mattsmeets.lib.dummyThing'
  82.  
  83. classifier ''
  84. }
  85.  
  86. reobf {
  87. shadowJar {}
  88. }
  89.  
  90. processResources {
  91. // this will ensure that this task is redone when the versions change.
  92. inputs.property "version", project.version
  93. inputs.property "mcversion", project.minecraft.version
  94.  
  95. // replace stuff in mcmod.info, nothing else
  96. from(sourceSets.main.resources.srcDirs) {
  97. include 'mcmod.info'
  98. include '**/reference.properties'
  99.  
  100. // replace version and mcversion
  101. expand 'version':project.version, 'mcversion':project.minecraft.version
  102. }
  103.  
  104. // copy everything else except the mcmod.info
  105. from(sourceSets.main.resources.srcDirs) {
  106. exclude 'mcmod.info'
  107. exclude '**/reference.properties'
  108. }
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement