build.gradle 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. artifactId rootProject.name
  56. artifact(remapJar) {
  57. builtBy remapJar
  58. }
  59. artifact(sourcesJar) {
  60. builtBy remapSourcesJar
  61. }
  62. artifact javadocJar
  63. }
  64. }
  65. }