123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- import org.apache.tools.ant.taskdefs.condition.Os
- plugins {
- id 'java-library'
- id 'biz.aQute.bnd.builder' version '6.2.0'
- id 'com.vanniktech.maven.publish' version '0.19.0'
- id 'com.github.johnrengelman.shadow' version '7.1.2'
- }
- repositories {
- mavenCentral()
- flatDir {
- dirs "${project(':demo').projectDir}/libs"
- }
- }
- compileJava {
- sourceCompatibility = '11'
- targetCompatibility = '11'
- }
- dependencies {
- testImplementation('junit:junit:4.13.2')
- api 'io.github.palexdev:virtualizedfx:11.2.6'
- }
- javafx {
- configuration = 'compileOnly'
- }
- javadoc {
- excludes = ['**/*.html', 'META-INF/**']
- options.use = true
- options.splitIndex = true
- options.encoding = 'UTF-8'
- options.author = true
- options.version = true
- options.windowTitle = "$project.name $project.version API"
- options.docTitle = "$project.name $project.version API"
- options.links = ['https://docs.oracle.com/en/java/javase/11/docs/api',
- 'https://openjfx.io/javadoc/17']
- }
- task javadocJar(type: Jar, dependsOn: javadoc) {
- archiveClassifier.set('javadoc')
- from javadoc.destinationDir
- }
- task sourcesJarBuild(type: Jar, dependsOn: classes) {
- archiveClassifier.set('sources')
- from sourceSets.main.allSource
- }
- artifacts {
- archives javadocJar
- archives sourcesJarBuild
- archives jar
- }
- jar {
- manifest {
- attributes(
- 'Bundle-Name': project.name,
- 'Bundle-Description': "Material controls for JavaFX",
- 'Bundle-SymbolicName': 'io.github.palexdev',
- 'Export-Package': 'io.github.palexdev.materialfx.*, io.github.palexdev.materialfx.demo.*'
- )
- }
- }
- shadowJar {
- mergeServiceFiles()
- dependencies {
- include(dependency('io.github.palexdev:virtualizedfx:11.2.6'))
- }
- }
- task copyJar(type: Copy) {
- from jar
- if (Os.isFamily(Os.FAMILY_WINDOWS)) {
- into System.getenv("APPDATA") + '/Scene Builder/Library'
- } else if (Os.isFamily(Os.FAMILY_MAC)) {
- into System.getProperty("user.home") + '/Library/Application Support' + '/Scene Builder/Library'
- } else if (Os.isFamily(Os.FAMILY_UNIX)) {
- into System.getProperty("user.home") + '/.scenebuilder/Library'
- }
- }
- task removeBnd(type: Delete) {
- delete fileTree(project.buildDir) {
- include '**/*.bnd'
- }
- }
- build {
- dependsOn shadowJar, copyJar, removeBnd
- }
- mavenPublish {
- sonatypeHost = "S01"
- }
|