Vaerys_Dawn

build.gradle

Dec 5th, 2020 (edited)
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.49 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. plugins {
  12. id 'com.github.johnrengelman.shadow' version '5.2.0'
  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.  
  19. version = '1.0'
  20. group = 'com.dawnfelstar.alchemicalbees' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
  21. archivesBaseName = 'alchemicalbees'
  22.  
  23. sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
  24.  
  25. println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
  26. minecraft {
  27. // The mappings can be changed at any time, and must be in the following format.
  28. // snapshot_YYYYMMDD Snapshot are built nightly.
  29. // stable_# Stables are built at the discretion of the MCP team.
  30. // Use non-default mappings at your own risk. they may not always work.
  31. // Simply re-run your setup task after changing the mappings to update your workspace.
  32. mappings channel: 'snapshot', version: '20200514-1.16.3'
  33. // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
  34.  
  35. // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
  36.  
  37. // Default run configurations.
  38. // These can be tweaked, removed, or duplicated as needed.
  39. runs {
  40. client {
  41. workingDirectory project.file('run')
  42.  
  43. // Recommended logging data for a userdev environment
  44. property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
  45.  
  46. // Recommended logging level for the console
  47. property 'forge.logging.console.level', 'debug'
  48.  
  49. mods {
  50. alchemicalbees {
  51. source sourceSets.main
  52. }
  53. }
  54. }
  55.  
  56. server {
  57. workingDirectory project.file('run')
  58.  
  59. // Recommended logging data for a userdev environment
  60. property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
  61.  
  62. // Recommended logging level for the console
  63. property 'forge.logging.console.level', 'debug'
  64.  
  65. mods {
  66. alchemicalbees {
  67. source sourceSets.main
  68. }
  69. }
  70. }
  71.  
  72. data {
  73. workingDirectory project.file('run')
  74.  
  75. // Recommended logging data for a userdev environment
  76. property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
  77.  
  78. // Recommended logging level for the console
  79. property 'forge.logging.console.level', 'debug'
  80.  
  81. // Specify the alchemicalbees for data generation, where to output the resulting resource, and where to look for existing resources.
  82. args '--mod', 'alchemicalbees', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
  83.  
  84. mods {
  85. alchemicalbees {
  86. source sourceSets.main
  87. }
  88. }
  89. }
  90. }
  91. }
  92.  
  93. // Include resources generated by data generators.
  94. sourceSets.main.resources { srcDir 'src/generated/resources' }
  95.  
  96.  
  97.  
  98. configurations {
  99. shade
  100. }
  101.  
  102. shadowJar {
  103. configurations = [project.configurations.shade]
  104. relocate 'com.tterrag.registrate', 'com.mymod.repack.registrate'
  105. }
  106.  
  107. repositories {
  108. maven { // Registrate
  109. url "http://maven.tterrag.com/"
  110. }
  111. mavenLocal()
  112. }
  113.  
  114. dependencies {
  115. // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
  116. // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
  117. // The userdev artifact is a special name and will get all sorts of transformations applied to it.
  118. minecraft 'net.minecraftforge:forge:1.16.4-35.1.7'
  119.  
  120. def registrate = "com.tterrag.registrate:Registrate:MC1.6.2-1.0.0-beta.19"
  121. implementation fg.deobf(registrate)
  122. shade registrate
  123.  
  124. // You may put jars on which you depend on in ./libs or you may define them like so..
  125. // compile "some.group:artifact:version:classifier"
  126. // compile "some.group:artifact:version"
  127.  
  128. // Real examples
  129. // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
  130. // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
  131.  
  132. // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
  133. // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  134.  
  135. // These dependencies get remapped to your current MCP mappings
  136. // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
  137.  
  138. // For more info...
  139. // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
  140. // http://www.gradle.org/docs/current/userguide/dependency_management.html
  141.  
  142. }
  143.  
  144. // Example for how to get properties into the manifest for reading by the runtime..
  145. jar {
  146. manifest {
  147. attributes([
  148. "Specification-Title": "alchemicalbees",
  149. "Specification-Vendor": "dawnfelstar",
  150. "Specification-Version": "1", // We are version 1 of ourselves
  151. "Implementation-Title": project.name,
  152. "Implementation-Version": "${version}",
  153. "Implementation-Vendor" :"dawnfelstar",
  154. "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
  155. ])
  156. }
  157. }
  158.  
  159. // Example configuration to allow publishing using the maven-publish task
  160. // This is the preferred method to reobfuscate your jar file
  161. jar.finalizedBy('reobfJar')
  162. // 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
  163. //publish.dependsOn('reobfJar')
  164.  
  165. publishing {
  166. publications {
  167. mavenJava(MavenPublication) {
  168. artifact jar
  169. }
  170. }
  171. repositories {
  172. maven {
  173. url "file:///${project.projectDir}/mcmodsrepo"
  174. }
  175. }
  176. }
Advertisement
Add Comment
Please, Sign In to add comment