Advertisement
SkyCrafter0

build.gradle

May 9th, 2023
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.64 KB | None | 0 0
  1. plugins {
  2. id 'java'
  3. id 'eclipse'
  4. id 'maven-publish'
  5. id 'net.minecraftforge.gradle' version '5.1.+'
  6. id 'org.parchmentmc.librarian.forgegradle' version '1.+'
  7. id "com.github.johnrengelman.shadow" version "7.1.2"
  8. }
  9.  
  10. version = '1.0'
  11. group = 'com.skythecodemaster.skybot' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
  12. archivesBaseName = 'skybot'
  13.  
  14. // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
  15. java.toolchain.languageVersion = JavaLanguageVersion.of(17)
  16.  
  17. println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
  18. minecraft {
  19. mappings channel: 'parchment', version: '2022.08.14-1.19.2'
  20.  
  21. // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default.
  22.  
  23. // Default run configurations.
  24. // These can be tweaked, removed, or duplicated as needed.
  25. runs {
  26. client {
  27. workingDirectory project.file('run')
  28.  
  29. property 'forge.logging.markers', 'REGISTRIES'
  30.  
  31. property 'forge.logging.console.level', 'debug'
  32.  
  33. property 'forge.enabledGameTestNamespaces', 'skybot'
  34.  
  35. mods {
  36. skybot {
  37. source sourceSets.main
  38. }
  39. }
  40. }
  41.  
  42. server {
  43. workingDirectory project.file('run')
  44.  
  45. property 'forge.logging.markers', 'REGISTRIES'
  46.  
  47. property 'forge.logging.console.level', 'debug'
  48.  
  49. property 'forge.enabledGameTestNamespaces', 'skybot'
  50.  
  51. mods {
  52. skybot {
  53. source sourceSets.main
  54. }
  55. }
  56. }
  57.  
  58. gameTestServer {
  59. workingDirectory project.file('run')
  60.  
  61. property 'forge.logging.markers', 'REGISTRIES'
  62.  
  63. property 'forge.logging.console.level', 'debug'
  64.  
  65. property 'forge.enabledGameTestNamespaces', 'skybot'
  66.  
  67. mods {
  68. skybot {
  69. source sourceSets.main
  70. }
  71. }
  72. }
  73.  
  74. data {
  75. workingDirectory project.file('run')
  76.  
  77. property 'forge.logging.markers', 'REGISTRIES'
  78.  
  79. property 'forge.logging.console.level', 'debug'
  80.  
  81. args '--mod', 'skybot', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
  82.  
  83. mods {
  84. skybot {
  85. source sourceSets.main
  86. }
  87. }
  88. }
  89. }
  90. }
  91.  
  92. sourceSets.main.resources { srcDir 'src/generated/resources' }
  93.  
  94. repositories {
  95. mavenCentral()
  96. }
  97.  
  98. configurations {
  99. // shade { transitive = false }
  100. // implementation.extendsFrom shade
  101. }
  102.  
  103. dependencies {
  104. minecraft 'net.minecraftforge:forge:1.19.2-43.2.6'
  105. implementation group: 'org.java-websocket', name: 'Java-WebSocket', version: '1.5.3'
  106. //implementation fg.deobf 'org.java-websocket:Java-WebSocket:1.5.3'
  107. }
  108.  
  109. shadowJar {
  110. baseName = 'skybot'
  111. version = '1.0.0'
  112. dependencies {
  113. include(('org.java-websocket:Java-WebSocket:1.5.3'))
  114. // include(('net.minecraftforge:forge:1.19.2-43.2.6'))
  115. }
  116. manifest {
  117. attributes 'Main-Class': 'com.skythecodemaster.skybot'
  118. }
  119. configurations = [project.configurations.compileClasspath]
  120. }
  121.  
  122. jar {
  123. //from configurations.runtimeClasspath.filter { it.name.endsWith('jar') }.collect { zipTree(it) }
  124. //duplicatesStrategy = DuplicatesStrategy.INCLUDE
  125. manifest {
  126. attributes([
  127. "Main-Class" : "com.skythecodemaster.skybot",
  128. "Specification-Title" : "skybotmod",
  129. "Specification-Vendor" : "skythecodemaster",
  130. "Specification-Version" : "1", // We are version 1 of ourselves
  131. "Implementation-Title" : project.name,
  132. "Implementation-Version" : project.jar.archiveVersion,
  133. "Implementation-Vendor" : "skythecodemaster",
  134. "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
  135. ])
  136. }
  137. }
  138.  
  139. jar.finalizedBy('reobfJar')
  140.  
  141. publishing {
  142. publications {
  143. mavenJava(MavenPublication) {
  144. artifact jar
  145. }
  146. }
  147. repositories {
  148. maven {
  149. url "file://${project.projectDir}/mcmodsrepo"
  150. }
  151. }
  152. }
  153.  
  154. tasks.withType(JavaCompile).configureEach {
  155. options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
  156. }
  157.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement