111 lines
2.7 KiB
Groovy
Executable File
111 lines
2.7 KiB
Groovy
Executable File
import org.apache.tools.ant.taskdefs.condition.Os
|
|
|
|
plugins {
|
|
id 'java-library'
|
|
id 'biz.aQute.bnd.builder' version "$bnd"
|
|
id 'com.vanniktech.maven.publish' version "$mavenPublish"
|
|
id 'com.github.johnrengelman.shadow' version "$shadowJarPlugin"
|
|
}
|
|
|
|
// Cross-platform scripts
|
|
apply from: "$scriptsDir/updateJFXRes.gradle"
|
|
apply from: "$scriptsDir/processCSS.gradle"
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
|
|
flatDir {
|
|
dirs "${project(':demo').projectDir}/libs"
|
|
}
|
|
}
|
|
|
|
compileJava {
|
|
sourceCompatibility = "$jdk"
|
|
targetCompatibility = "$jdk"
|
|
}
|
|
|
|
dependencies {
|
|
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit"
|
|
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit"
|
|
|
|
api "io.github.palexdev:virtualizedfx:$vfx"
|
|
}
|
|
|
|
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']
|
|
}
|
|
|
|
tasks.register('javadocJar', Jar) {
|
|
dependsOn javadoc
|
|
archiveClassifier.set('javadoc')
|
|
from javadoc.destinationDir
|
|
}
|
|
|
|
tasks.register('sourcesJarBuild', 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:$vfx"))
|
|
}
|
|
}
|
|
|
|
tasks.register('copyJar', 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'
|
|
}
|
|
}
|
|
|
|
tasks.register('removeBnd', Delete) {
|
|
delete fileTree(project.buildDir) {
|
|
include '**/*.bnd'
|
|
}
|
|
}
|
|
|
|
build {
|
|
dependsOn shadowJar, copyJar, removeBnd
|
|
}
|
|
|
|
mavenPublish {
|
|
sonatypeHost = "S01"
|
|
} |