Advertisement
Daniel_F

build.gradle

Sep 26th, 2020 (edited)
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.51 KB | None | 0 0
  1. buildscript {
  2. repositories {
  3. maven { url = 'https://files.minecraftforge.net/maven' }
  4. jcenter()
  5. mavenCentral()
  6. }
  7. dependencies {
  8. classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
  9. }
  10. }
  11. apply plugin: 'net.minecraftforge.gradle'
  12. // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
  13. apply plugin: 'eclipse'
  14. apply plugin: 'maven-publish'
  15.  
  16. version = '1.0'
  17. group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
  18. archivesBaseName = 'modid'
  19.  
  20. sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
  21. //Print out JVM information so that we know what version is running. Extreamly useful for people to know when helping you.
  22. println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
  23.  
  24. minecraft {
  25. // The mappings can be changed at any time, and must be in the following format.
  26. // snapshot_YYYYMMDD Snapshot are built nightly.
  27. // stable_# Stables are built at the discretion of the MCP team.
  28. // Use non-default mappings at your own risk. they may not always work.
  29. // Simply re-run your setup task after changing the mappings to update your workspace.
  30. mappings channel: 'snapshot', version: '20200514-1.15.1'
  31. // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
  32.  
  33. // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
  34.  
  35. // Default run configurations.
  36. // These can be tweaked, removed, or duplicated as needed.
  37. runs {
  38. client {
  39. workingDirectory project.file('run')
  40.  
  41. // Recommended logging data for a userdev environment
  42. property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
  43.  
  44. // Recommended logging level for the console
  45. property 'forge.logging.console.level', 'debug'
  46.  
  47. mods {
  48. examplemod {
  49. source sourceSets.main
  50. }
  51. }
  52. }
  53.  
  54. server {
  55. workingDirectory project.file('run')
  56.  
  57. // Recommended logging data for a userdev environment
  58. property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
  59.  
  60. // Recommended logging level for the console
  61. property 'forge.logging.console.level', 'debug'
  62.  
  63. mods {
  64. examplemod {
  65. source sourceSets.main
  66. }
  67. }
  68. }
  69.  
  70. data {
  71. workingDirectory project.file('run')
  72.  
  73. // Recommended logging data for a userdev environment
  74. property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
  75.  
  76. // Recommended logging level for the console
  77. property 'forge.logging.console.level', 'debug'
  78.  
  79. args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/')
  80.  
  81. mods {
  82. examplemod {
  83. source sourceSets.main
  84. }
  85. }
  86. }
  87. }
  88. }
  89.  
  90. repositories {
  91.  
  92. maven {
  93. name 'hellfirepvp maven'
  94. url 'https://maven.hellfiredev.net/'
  95. }
  96.  
  97. maven {
  98. name 'curios maven'
  99. url "https://maven.theillusivec4.top/"
  100. }
  101.  
  102. maven {
  103. name 'JEI maven'
  104. url = "https://dvs1.progwml6.com/files/maven"
  105. }
  106.  
  107. }
  108.  
  109. dependencies {
  110.  
  111. minecraft 'net.minecraftforge:forge:1.15.2-31.2.44'
  112.  
  113. compileOnly 'hellfirepvp.observerlib:observerlib:1.15.2-1.3.1.v7'
  114. runtimeOnly 'hellfirepvp.observerlib:observerlib:1.15.2-1.3.1.v7:deobf'
  115.  
  116. compileOnly 'top.theillusivec4.curios:curios:FORGE-1.15.2-2.0.2.4:api'
  117. runtimeOnly 'top.theillusivec4.curios:curios:FORGE-1.15.2-2.0.2.4:deobf'
  118.  
  119. compileOnly 'hellfirepvp.astralsorcery:astralsorcery:1.15.2-1.12.13.v242'
  120. runtimeOnly 'hellfirepvp.astralsorcery:astralsorcery:1.15.2-1.12.13.v242:deobf'
  121.  
  122. compileOnly fg.deobf('mezz.jei:jei-1.15.2:6.0.2.12')
  123. runtimeOnly fg.deobf('mezz.jei:jei-1.15.2:6.0.2.12')
  124.  
  125. }
  126.  
  127. // Example for how to get properties into the manifest for reading by the runtime..
  128. jar {
  129. manifest {
  130. attributes([
  131. "Specification-Title": "examplemod",
  132. "Specification-Vendor": "examplemodsareus",
  133. "Specification-Version": "1", // We are version 1 of ourselves
  134. "Implementation-Title": project.name,
  135. "Implementation-Version": "${version}",
  136. "Implementation-Vendor" :"examplemodsareus",
  137. "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
  138. ])
  139. }
  140. }
  141.  
  142. // Example configuration to allow publishing using the maven-publish task
  143. // This is the preferred method to reobfuscate your jar file
  144. jar.finalizedBy('reobfJar')
  145. // However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
  146. //publish.dependsOn('reobfJar')
  147.  
  148. publishing {
  149. publications {
  150. mavenJava(MavenPublication) {
  151. artifact jar
  152. }
  153. }
  154. repositories {
  155. maven {
  156. url "file:///${project.projectDir}/mcmodsrepo"
  157. }
  158. }
  159. }
  160.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement