build.gradle 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. plugins {
  2. id 'com.github.johnrengelman.shadow' version '6.1.0'
  3. id 'maven-publish'
  4. }
  5. dependencies {
  6. shadow("org.spongepowered:configurate-hocon:${rootProject.configurate_version}")
  7. testImplementation("org.junit.jupiter:junit-jupiter:${rootProject.junit_version}")
  8. testImplementation("org.assertj:assertj-core:${rootProject.assertj_version}")
  9. testImplementation("org.mockito:mockito-inline:${rootProject.mockito_version}")
  10. testImplementation("org.mockito:mockito-junit-jupiter:${rootProject.mockito_version}")
  11. testImplementation("com.google.jimfs:jimfs:${rootProject.jimfs_version}") {
  12. exclude group: 'com.google.guava', module: 'guava'
  13. }
  14. }
  15. java {
  16. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  17. // if it is present.
  18. withSourcesJar()
  19. }
  20. jar {
  21. from "LICENSE"
  22. }
  23. shadowJar {
  24. configurations = [project.configurations.shadow]
  25. archiveClassifier = "shadow"
  26. }
  27. remapJar {
  28. dependsOn(shadowJar)
  29. input.set(shadowJar.archiveFile)
  30. }
  31. test.enabled = false
  32. task testClient(type: Test) {
  33. systemProperty "fabric.dli.env", "client"
  34. }
  35. test.dependsOn testClient
  36. task testServer(type: Test) {
  37. systemProperty "fabric.dli.env", "server"
  38. }
  39. test.dependsOn testServer
  40. tasks.withType(Test) {
  41. group = "verification"
  42. useJUnitPlatform()
  43. }
  44. javadoc {
  45. options {
  46. title = "$modName ${project.version} API"
  47. source = "16"
  48. encoding = "UTF-8"
  49. charSet = "UTF-8"
  50. memberLevel = JavadocMemberLevel.PROTECTED
  51. links = [
  52. "https://docs.oracle.com/en/java/javase/16/docs/api/"
  53. ]
  54. // Disable the crazy super-strict doclint tool in Java 8
  55. addStringOption("Xdoclint:none", "-quiet")
  56. }
  57. failOnError false
  58. }
  59. task javadocJar(type: Jar) {
  60. dependsOn javadoc
  61. from javadoc.destinationDir
  62. archiveClassifier = "javadoc"
  63. }
  64. build.dependsOn javadocJar
  65. // configure the maven publication
  66. publishing {
  67. publications {
  68. mavenJava(MavenPublication) {
  69. artifactId rootProject.name
  70. artifact(remapJar) {
  71. builtBy remapJar
  72. }
  73. artifact(sourcesJar) {
  74. builtBy remapSourcesJar
  75. }
  76. artifact javadocJar
  77. }
  78. }
  79. }