Guest User

build.gradle ( new )

a guest
Feb 10th, 2025
6
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.21 KB | Source Code | 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://repo.spongepowered.org/repository/maven-public/' }
  5. maven {
  6. url "https://plugins.gradle.org/m2/"
  7. }
  8. mavenCentral()
  9. }
  10. dependencies {
  11. classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
  12. classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
  13. classpath 'org.parchmentmc:librarian:1.+'
  14. classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.0'
  15. classpath "org.jlleitschuh.gradle:ktlint-gradle:12.1.1"
  16.  
  17. // OPTIONAL Gradle plugin for Kotlin Serialization
  18. //classpath 'org.jetbrains.kotlin:kotlin-serialization:1.6.10'
  19.  
  20. }
  21. }
  22.  
  23. plugins {
  24. // Adds the Kotlin Gradle plugin
  25. id "org.jetbrains.kotlin.jvm" version "1.9.22"
  26. // OPTIONAL Kotlin Serialization plugin
  27. id 'org.jetbrains.kotlin.plugin.serialization' version '1.9.22'
  28.  
  29. id 'eclipse'
  30. id 'idea'
  31. id 'net.minecraftforge.gradle' version '[6.0,6.2)'
  32. id 'org.parchmentmc.librarian.forgegradle' version '1.+'
  33. }
  34.  
  35. apply plugin: "org.jlleitschuh.gradle.ktlint"
  36. apply plugin: 'net.minecraftforge.gradle'
  37. apply plugin: 'maven-publish'
  38. apply plugin: 'org.spongepowered.mixin'
  39. apply plugin: 'org.parchmentmc.librarian.forgegradle'
  40. apply plugin: "org.jetbrains.kotlin.jvm"
  41.  
  42.  
  43.  
  44. //group = mod_version
  45.  
  46. base {
  47. archivesName = mod_id //+ version
  48. }
  49.  
  50. java {
  51. toolchain.languageVersion = JavaLanguageVersion.of(17)
  52. }
  53.  
  54. minecraft {
  55.  
  56. mappings channel: 'parchment', version: '2023.09.03-1.20.1'
  57.  
  58. copyIdeResources = true
  59. runs {
  60. // applies to all the run configs below
  61. configureEach {
  62. workingDirectory project.file('run')
  63.  
  64. // Recommended logging data for a userdev environment
  65. // The markers can be added/remove as needed separated by commas.
  66. // "SCAN": For mods scan.
  67. // "REGISTRIES": For firing of registry events.
  68. // "REGISTRYDUMP": For getting the contents of all registries.
  69. property 'forge.logging.markers', 'REGISTRIES'
  70.  
  71.  
  72. // Recommended logging level for the console
  73. // You can set various levels here.
  74. // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
  75. property 'forge.logging.console.level', 'debug'
  76.  
  77. mods {
  78. "${mod_id}" {
  79. source sourceSets.main
  80. }
  81. }
  82. }
  83.  
  84. client {
  85. // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
  86. property 'forge.enabledGameTestNamespaces', mod_id
  87. }
  88.  
  89. server {
  90. property 'forge.enabledGameTestNamespaces', mod_id
  91. args '--nogui'
  92. }
  93.  
  94. // This run config launches GameTestServer and runs all registered gametests, then exits.
  95. // By default, the server will crash when no gametests are provided.
  96. // The gametest system is also enabled by default for other run configs under the /test command.
  97. gameTestServer {
  98. property 'forge.enabledGameTestNamespaces', mod_id
  99. }
  100.  
  101. data {
  102. // example of overriding the workingDirectory set in configureEach above
  103. workingDirectory project.file('run-data')
  104.  
  105. // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
  106. args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
  107. }
  108. }
  109. }
  110.  
  111. mixin {
  112. }
  113.  
  114. // Include resources generated by data generators.
  115. sourceSets.main.resources { srcDir 'src/generated/resources' }
  116.  
  117. repositories {
  118. mavenCentral()
  119.  
  120. maven { url 'https://modmaven.dev/' }
  121.  
  122.  
  123.  
  124. maven {
  125. url "https://cursemaven.com"
  126. content {
  127. includeGroup "curse.maven"
  128. }
  129. }
  130.  
  131.  
  132.  
  133. maven {
  134. name = "ParchmentMC"
  135. url = "https://maven.parchmentmc.org"
  136. }
  137.  
  138. maven {
  139. name = 'Kotlin for Forge'
  140. url = 'https://thedarkcolour.github.io/KotlinForForge/'
  141. }
  142.  
  143. maven {
  144. name = "Valkyrien Skies Internal"
  145. url = 'https://maven.valkyrienskies.org'
  146. }
  147.  
  148.  
  149. }
  150.  
  151. dependencies {
  152. minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
  153. //annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
  154. // cri
  155. //annotationProcessor(implementation("com.github.LlamaLad7:MixinExtras:0.1.1"))
  156.  
  157.  
  158.  
  159. implementation ("org.valkyrienskies.core:api:${vs_core_version}")
  160. implementation ("org.valkyrienskies.core:impl:${vs_core_version}")
  161. implementation ("org.valkyrienskies.core:api-game:${vs_core_version}")
  162. implementation ("org.valkyrienskies.core:util:${vs_core_version}")
  163. implementation fg.deobf("org.valkyrienskies:valkyrienskies-120-forge:${vs2_version}")
  164.  
  165.  
  166.  
  167. implementation "org.joml:joml:1.10.5"
  168. implementation "com.fasterxml.jackson.core:jackson-annotations:2.13.3"
  169. implementation 'thedarkcolour:kotlinforforge:4.10.0'
  170. implementation fg.deobf("curse.maven:cc-tweaked-282001:5379173")
  171.  
  172.  
  173. compileOnly fg.deobf("curse.maven:female-gender-forge-481655:4603538")
  174.  
  175.  
  176.  
  177. //RUNTIME
  178. runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge:${jei_version}")
  179. //runtimeOnly fg.deobf("curse.maven:rubidium-574856:4494903")
  180. //runtimeOnly fg.deobf("curse.maven:cc-tweaked-282001:4630521")
  181. //runtimeOnly fg.deobf("curse.maven:ctm-267602:3933537")
  182.  
  183.  
  184. //using lodestone for now until vsfx comes out
  185. //implementation fg.deobf("team.lodestar.lodestone:lodestone:${minecraft_version}-${lodestone_version}")
  186.  
  187. //for figuring out what is laggy
  188. //okay so this causes it to fnuuy itself
  189. //runtimeOnly("curse.maven:spark-361579:3824951")
  190.  
  191.  
  192. }
  193.  
  194. configurations {
  195. shade
  196. implementation.extendsFrom shade
  197. }
  198.  
  199. minecraft.runs.all {
  200. lazyToken('minecraft_classpath') {
  201. configurations.shade.copyRecursive().resolve().collect { it.absolutePath }.join(File.pathSeparator)
  202. }
  203. }
  204.  
  205.  
  206. // This block of code expands all declared replace properties in the specified resource targets.
  207. // A missing property will result in an error. Properties are expanded using ${} Groovy notation.
  208. // When "copyIdeResources" is enabled, this will also run before the game launches in IDE environments.
  209. // See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
  210. tasks.named('processResources', ProcessResources).configure {
  211. var replaceProperties = [
  212. minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range,
  213. forge_version: forge_version, forge_version_range: forge_version_range,
  214. loader_version_range: loader_version_range,
  215. mod_id: mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
  216. mod_authors: mod_authors, mod_description: mod_description,
  217. ]
  218.  
  219. inputs.properties replaceProperties
  220.  
  221. filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
  222. expand replaceProperties + [project: project]
  223. }}
  224.  
  225. // Example for how to get properties into the manifest for reading at runtime.
  226. tasks.named('jar', Jar).configure {
  227. manifest {
  228. attributes([
  229. "Specification-Title": mod_id,
  230. "Specification-Vendor": mod_authors,
  231. "Specification-Version": "1", // We are version 1 of ourselves
  232. "Implementation-Title": project.name,
  233. "Implementation-Version": project.jar.archiveVersion,
  234. "Implementation-Vendor": mod_authors,
  235. "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
  236. ])
  237. }
  238.  
  239. // This is the preferred method to reobfuscate your jar file
  240. //finalizedBy 'reobfJar'
  241. }
  242.  
  243. tasks.withType(JavaCompile).configureEach {
  244. options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
  245. }
Add Comment
Please, Sign In to add comment