build.gradle 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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_junit_version}")
  11. testImplementation("io.github.hakky54:logcaptor:${rootProject.logcaptor_version}")
  12. testImplementation("com.google.jimfs:jimfs:${rootProject.jimfs_version}")
  13. }
  14. java {
  15. // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
  16. // if it is present.
  17. withSourcesJar()
  18. }
  19. jar {
  20. from "LICENSE"
  21. }
  22. shadowJar {
  23. configurations = [project.configurations.shadow]
  24. archiveClassifier = "shadow"
  25. }
  26. remapJar {
  27. dependsOn(shadowJar)
  28. input.set(shadowJar.archiveFile)
  29. }
  30. test {
  31. useJUnitPlatform()
  32. }
  33. javadoc {
  34. options {
  35. source = "8"
  36. encoding = "UTF-8"
  37. charSet = "UTF-8"
  38. memberLevel = JavadocMemberLevel.PROTECTED
  39. // Disable the crazy super-strict doclint tool in Java 8
  40. addStringOption("Xdoclint:none", "-quiet")
  41. }
  42. source = sourceSets.main.allJava
  43. failOnError false
  44. }
  45. task javadocJar(type: Jar) {
  46. dependsOn javadoc
  47. from javadoc.destinationDir
  48. archiveClassifier = "javadoc"
  49. }
  50. build.dependsOn javadocJar
  51. // configure the maven publication
  52. publishing {
  53. publications {
  54. mavenJava(MavenPublication) {
  55. artifact(remapJar) {
  56. builtBy remapJar
  57. }
  58. artifact(sourcesJar) {
  59. builtBy remapSourcesJar
  60. }
  61. artifact javadocJar
  62. }
  63. }
  64. }