Guest User

build.gradle

a guest
Aug 31st, 2022
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.71 KB | None | 0 0
  1. buildscript {
  2. repositories {
  3. // These repositories are only for Gradle plugins, put any other repositories in the repository block further below
  4. maven { url = 'https://maven.minecraftforge.net' }
  5. maven { url = 'https://maven.parchmentmc.org' }
  6. mavenCentral()
  7. }
  8. dependencies {
  9. classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
  10. classpath 'org.parchmentmc:librarian:1.+'
  11. }
  12. }
  13. apply plugin: 'net.minecraftforge.gradle'
  14. apply plugin: 'org.parchmentmc.librarian.forgegradle'
  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 = '0.11.0-1.18.2'
  20. group = 'io.github.cjcj55.chrispymod' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
  21. archivesBaseName = 'chrispymod'
  22.  
  23. // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
  24. java.toolchain.languageVersion = JavaLanguageVersion.of(17)
  25.  
  26. println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
  27. minecraft {
  28. // The mappings can be changed at any time and must be in the following format.
  29. // Channel: Version:
  30. // snapshot YYYYMMDD Snapshot are built nightly.
  31. // stable # Stables are built at the discretion of the MCP team.
  32. // official MCVersion Official field/method names from Mojang mapping files
  33. //
  34. // You must be aware of the Mojang license when using the 'official' mappings.
  35. // See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
  36. //
  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 channel: 'parchment', version: '2022.08.21-1.18.2'
  40.  
  41. // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default.
  42.  
  43. // Default run configurations.
  44. // These can be tweaked, removed, or duplicated as needed.
  45. runs {
  46. client {
  47. workingDirectory project.file('run')
  48.  
  49. // Recommended logging data for a userdev environment
  50. // The markers can be added/remove as needed separated by commas.
  51. // "SCAN": For mods scan.
  52. // "REGISTRIES": For firing of registry events.
  53. // "REGISTRYDUMP": For getting the contents of all registries.
  54. property 'forge.logging.markers', 'REGISTRIES'
  55.  
  56. // Recommended logging level for the console
  57. // You can set various levels here.
  58. // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
  59. property 'forge.logging.console.level', 'debug'
  60.  
  61. mods {
  62. chrispymod {
  63. source sourceSets.main
  64. }
  65. }
  66. }
  67.  
  68. server {
  69. workingDirectory project.file('run')
  70.  
  71. // Recommended logging data for a userdev environment
  72. // The markers can be added/remove as needed separated by commas.
  73. // "SCAN": For mods scan.
  74. // "REGISTRIES": For firing of registry events.
  75. // "REGISTRYDUMP": For getting the contents of all registries.
  76. property 'forge.logging.markers', 'REGISTRIES'
  77.  
  78. // Recommended logging level for the console
  79. // You can set various levels here.
  80. // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
  81. property 'forge.logging.console.level', 'debug'
  82.  
  83. mods {
  84. chrispymod {
  85. source sourceSets.main
  86. }
  87. }
  88. }
  89.  
  90. data {
  91. workingDirectory project.file('run')
  92.  
  93. // Recommended logging data for a userdev environment
  94. // The markers can be added/remove as needed separated by commas.
  95. // "SCAN": For mods scan.
  96. // "REGISTRIES": For firing of registry events.
  97. // "REGISTRYDUMP": For getting the contents of all registries.
  98. property 'forge.logging.markers', 'REGISTRIES'
  99.  
  100. // Recommended logging level for the console
  101. // You can set various levels here.
  102. // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
  103. property 'forge.logging.console.level', 'debug'
  104.  
  105. // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
  106. args '--mod', 'chrispymod', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
  107.  
  108. mods {
  109. chrispymod {
  110. source sourceSets.main
  111. }
  112. }
  113. }
  114. }
  115. }
  116.  
  117. // Include resources generated by data generators.
  118. sourceSets.main.resources { srcDir 'src/generated/resources' }
  119.  
  120. repositories {
  121. maven {
  122. // location of the maven that hosts JEI files
  123. name = "Progwml6 maven"
  124. url = "https://dvs1.progwml6.com/files/maven/"
  125. }
  126. maven {
  127. // location of a maven mirror for JEI files, as a fallback
  128. name = "ModMaven"
  129. url = "https://modmaven.dev"
  130. }
  131. maven { url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/' }
  132. }
  133.  
  134. dependencies {
  135. // Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed
  136. // that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied.
  137. // The userdev artifact is a special name and will get all sorts of transformations applied to it.
  138. minecraft 'net.minecraftforge:forge:1.18.2-40.1.0'
  139.  
  140. // compile against the JEI API but do not include it at runtime
  141. compileOnly fg.deobf("mezz.jei:jei-1.18.2:9.7.1.255:api")
  142. // at runtime, use the full JEI jar
  143. runtimeOnly fg.deobf("mezz.jei:jei-1.18.2:9.7.1.225")
  144.  
  145. implementation fg.deobf('software.bernie.geckolib:geckolib-forge-1.18:3.0.36')
  146.  
  147. // For more info...
  148. // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
  149. // http://www.gradle.org/docs/current/userguide/dependency_management.html
  150. }
  151.  
  152. // Example for how to get properties into the manifest for reading at runtime.
  153. jar {
  154. manifest {
  155. attributes([
  156. "Specification-Title" : "chrispymod",
  157. "Specification-Vendor" : "chrispymodsareus",
  158. "Specification-Version" : "1", // We are version 1 of ourselves
  159. "Implementation-Title" : project.name,
  160. "Implementation-Version" : project.jar.archiveVersion,
  161. "Implementation-Vendor" : "chrispymodsareus",
  162. "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
  163. ])
  164. }
  165. }
  166.  
  167. // Example configuration to allow publishing using the maven-publish plugin
  168. // This is the preferred method to reobfuscate your jar file
  169. jar.finalizedBy('reobfJar')
  170. // 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
  171. // publish.dependsOn('reobfJar')
  172.  
  173. publishing {
  174. publications {
  175. mavenJava(MavenPublication) {
  176. artifact jar
  177. }
  178. }
  179. repositories {
  180. maven {
  181. url "file://${project.projectDir}/mcmodsrepo"
  182. }
  183. }
  184. }
  185.  
Advertisement
Add Comment
Please, Sign In to add comment