FurPuro

Untitled

Oct 5th, 2024
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.10 KB | None | 0 0
  1. import org.jetbrains.kotlin.gradle.dsl.JvmTarget
  2. import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
  3.  
  4. plugins {
  5. kotlin("jvm") version "2.0.20"
  6. id("fabric-loom") version "1.7.1"
  7. id("maven-publish")
  8. }
  9.  
  10. version = project.property("mod_version") as String
  11. group = project.property("maven_group") as String
  12.  
  13. base {
  14. archivesName.set(project.property("archives_base_name") as String)
  15. }
  16.  
  17. val targetJavaVersion = 17
  18. java {
  19. toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
  20. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  21. // if it is present.
  22. // If you remove this line, sources will not be generated.
  23. withSourcesJar()
  24. }
  25.  
  26. loom {
  27. splitEnvironmentSourceSets()
  28.  
  29. mods {
  30. register("mysticrealms") {
  31. sourceSet("main")
  32. sourceSet("client")
  33. }
  34. }
  35. }
  36.  
  37. repositories {
  38. maven {
  39. name = "0mods mavenReleases"
  40. url = uri("https://maven.0mods.team/releases")
  41. }
  42. mavenCentral()
  43. }
  44.  
  45. dependencies {
  46. // To change the versions see the gradle.properties file
  47. minecraft("com.mojang:minecraft:${project.property("minecraft_version")}")
  48. mappings(loom.officialMojangMappings())
  49. modImplementation("net.fabricmc:fabric-loader:${project.property("loader_version")}")
  50. modImplementation("net.fabricmc:fabric-language-kotlin:${project.property("kotlin_loader_version")}")
  51. modImplementation("net.fabricmc.fabric-api:fabric-api:${project.property("fabric_version")}")
  52.  
  53. /*implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.0")
  54. implementation("org.jetbrains.kotlin:kotlin-reflect:1.9.0")
  55. implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.5.1")
  56. implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1")
  57. implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
  58. implementation("org.joml:joml:1.10.5") // Добавляем JOML
  59. implementation("org.jetbrains.kotlin:kotlin-stdlib-common:1.9.0") // Добавляем stdlib-common*/
  60. implementation("ru.hollowhorizon:HollowCore-fabric-1.19.2:2.0.9:dev")
  61. }
  62.  
  63. tasks.processResources {
  64. inputs.property("version", project.version)
  65. inputs.property("minecraft_version", project.property("minecraft_version"))
  66. inputs.property("loader_version", project.property("loader_version"))
  67. filteringCharset = "UTF-8"
  68.  
  69. filesMatching("fabric.mod.json") {
  70. expand(
  71. "version" to project.version,
  72. "minecraft_version" to project.property("minecraft_version"),
  73. "loader_version" to project.property("loader_version"),
  74. "kotlin_loader_version" to project.property("kotlin_loader_version")
  75. )
  76. }
  77. }
  78.  
  79. tasks.withType<JavaCompile>().configureEach {
  80. // ensure that the encoding is set to UTF-8, no matter what the system default is
  81. // this fixes some edge cases with special characters not displaying correctly
  82. // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
  83. // If Javadoc is generated, this must be specified in that task too.
  84. options.encoding = "UTF-8"
  85. options.release.set(targetJavaVersion)
  86. }
  87.  
  88. tasks.withType<KotlinCompile>().configureEach {
  89. compilerOptions.jvmTarget.set(JvmTarget.fromTarget(targetJavaVersion.toString()))
  90. }
  91.  
  92. tasks.jar {
  93. from("LICENSE") {
  94. rename { "${it}_${project.base.archivesName}" }
  95. }
  96. }
  97.  
  98. // configure the maven publication
  99. publishing {
  100. publications {
  101. create<MavenPublication>("mavenJava") {
  102. artifactId = project.property("archives_base_name") as String
  103. from(components["java"])
  104. }
  105. }
  106.  
  107. // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
  108. repositories {
  109. // Add repositories to publish to here.
  110. // Notice: This block does NOT have the same function as the block in the top level.
  111. // The repositories here will be used for publishing your artifact, not for
  112. // retrieving dependencies.
  113. }
  114. }
  115.  
Add Comment
Please, Sign In to add comment