Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.94 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. classpath 'de.sebastianboegl.gradle.plugins:shadow-log4j-transformer:1.0.0'
  9. }
  10. }
  11.  
  12. plugins {
  13.  
  14. id "com.github.johnrengelman.shadow" version "1.2.4"
  15. }
  16.  
  17. apply plugin: 'net.minecraftforge.gradle.forge'
  18. //Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
  19.  
  20.  
  21. version = "1.0"
  22. group = "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
  23. archivesBaseName = "modid"
  24.  
  25. sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
  26. compileJava {
  27. sourceCompatibility = targetCompatibility = '1.8'
  28. }
  29.  
  30. minecraft {
  31. version = "1.12.2-14.23.5.2768"
  32. runDir = "run"
  33.  
  34. // the mappings can be changed at any time, and must be in the following format.
  35. // snapshot_YYYYMMDD snapshot are built nightly.
  36. // stable_# stables are built at the discretion of the MCP team.
  37. // Use non-default mappings at your own risk. they may not always work.
  38. // simply re-run your setup task after changing the mappings to update your workspace.
  39. mappings = "snapshot_20171003"
  40. // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
  41. }
  42.  
  43. configurations {
  44. compile.extendsFrom shadow
  45. }
  46.  
  47. jar.enabled = false
  48.  
  49. build.dependsOn shadowJar
  50.  
  51. dependencies {
  52. // you may put jars on which you depend on in ./libs
  53. // or you may define them like so..
  54. //compile "some.group:artifact:version:classifier"
  55. //compile "some.group:artifact:version"
  56.  
  57. // real examples
  58. //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
  59. //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
  60.  
  61. // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
  62. //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  63.  
  64. // the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
  65. // except that these dependencies get remapped to your current MCP mappings
  66. //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  67. //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  68.  
  69. // for more info...
  70. // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
  71. // http://www.gradle.org/docs/current/userguide/dependency_management.html
  72.  
  73. shadow 'org.apache.httpcomponents:httpcore:4.4.5'
  74. shadow 'org.apache.httpcomponents:httpmime:4.5.2'
  75. shadow 'org.apache.httpcomponents:httpclient:4.5.2'
  76. shadow 'commons-logging:commons-logging:1.2'
  77. shadow 'org.apache.logging.log4j:log4j-jcl:2.9.1'
  78. shadow 'org.apache.logging.log4j:log4j-api:2.9.1'
  79. shadow 'org.apache.logging.log4j:log4j-core:2.9.1'
  80.  
  81. }
  82.  
  83. processResources {
  84. // this will ensure that this task is redone when the versions change.
  85. inputs.property "version", project.version
  86. inputs.property "mcversion", project.minecraft.version
  87.  
  88. // replace stuff in mcmod.info, nothing else
  89. from(sourceSets.main.resources.srcDirs) {
  90. include 'mcmod.info'
  91.  
  92. // replace version and mcversion
  93. expand 'version':project.version, 'mcversion':project.minecraft.version
  94. }
  95.  
  96. // copy everything else except the mcmod.info
  97. from(sourceSets.main.resources.srcDirs) {
  98. exclude 'mcmod.info'
  99. }
  100. }
  101.  
  102. shadowJar {
  103.  
  104. transform(de.sebastianboegl.gradle.plugins.shadow.transformers.Log4j2PluginsFileTransformer)
  105.  
  106. classifier = null
  107. configurations = [project.configurations.compile]
  108. relocate 'org.apache', 'fake.libs'
  109. }
  110.  
  111. reobf {
  112. shadowJar {} // Reobfuscate the shadowed JAR
  113. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement