build.gradle 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. import org.apache.tools.ant.taskdefs.condition.Os
  2. plugins {
  3. id 'java-library'
  4. id 'biz.aQute.bnd.builder' version '6.2.0'
  5. id 'com.vanniktech.maven.publish' version '0.19.0'
  6. id 'com.github.johnrengelman.shadow' version '7.1.2'
  7. }
  8. repositories {
  9. mavenCentral()
  10. flatDir {
  11. dirs "${project(':demo').projectDir}/libs"
  12. }
  13. }
  14. compileJava {
  15. sourceCompatibility = '11'
  16. targetCompatibility = '11'
  17. }
  18. dependencies {
  19. testImplementation('junit:junit:4.13.2')
  20. api 'io.github.palexdev:virtualizedfx:11.2.6'
  21. }
  22. javafx {
  23. configuration = 'compileOnly'
  24. }
  25. javadoc {
  26. excludes = ['**/*.html', 'META-INF/**']
  27. options.use = true
  28. options.splitIndex = true
  29. options.encoding = 'UTF-8'
  30. options.author = true
  31. options.version = true
  32. options.windowTitle = "$project.name $project.version API"
  33. options.docTitle = "$project.name $project.version API"
  34. options.links = ['https://docs.oracle.com/en/java/javase/11/docs/api',
  35. 'https://openjfx.io/javadoc/17']
  36. }
  37. task javadocJar(type: Jar, dependsOn: javadoc) {
  38. archiveClassifier.set('javadoc')
  39. from javadoc.destinationDir
  40. }
  41. task sourcesJarBuild(type: Jar, dependsOn: classes) {
  42. archiveClassifier.set('sources')
  43. from sourceSets.main.allSource
  44. }
  45. artifacts {
  46. archives javadocJar
  47. archives sourcesJarBuild
  48. archives jar
  49. }
  50. jar {
  51. manifest {
  52. attributes(
  53. 'Bundle-Name': project.name,
  54. 'Bundle-Description': "Material controls for JavaFX",
  55. 'Bundle-SymbolicName': 'io.github.palexdev',
  56. 'Export-Package': 'io.github.palexdev.materialfx.*, io.github.palexdev.materialfx.demo.*'
  57. )
  58. }
  59. }
  60. shadowJar {
  61. mergeServiceFiles()
  62. dependencies {
  63. include(dependency('io.github.palexdev:virtualizedfx:11.2.6'))
  64. }
  65. }
  66. task copyJar(type: Copy) {
  67. from jar
  68. if (Os.isFamily(Os.FAMILY_WINDOWS)) {
  69. into System.getenv("APPDATA") + '/Scene Builder/Library'
  70. } else if (Os.isFamily(Os.FAMILY_MAC)) {
  71. into System.getProperty("user.home") + '/Library/Application Support' + '/Scene Builder/Library'
  72. } else if (Os.isFamily(Os.FAMILY_UNIX)) {
  73. into System.getProperty("user.home") + '/.scenebuilder/Library'
  74. }
  75. }
  76. task removeBnd(type: Delete) {
  77. delete fileTree(project.buildDir) {
  78. include '**/*.bnd'
  79. }
  80. }
  81. build {
  82. dependsOn shadowJar, copyJar, removeBnd
  83. }
  84. mavenPublish {
  85. sonatypeHost = "S01"
  86. }