-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
128 lines (108 loc) · 3.23 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
128 lines (108 loc) · 3.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
plugins {
id("java-library")
`maven-publish`
id("org.openjfx.javafxplugin") version "0.1.0"
}
base {
group = "io.github.qupath"
version = "0.4.1"
description = "Extra classes built on JavaFX that are used to help create the QuPath user interface. " +
"These don't depend on other QuPath modules, so can be reused elsewhere."
}
tasks.compileJava {
options.encoding = "UTF-8"
// Use the project's version or define one directly
options.javaModuleVersion = provider { version as String }
}
sourceSets {
create("controlsfx")
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
withSourcesJar()
withJavadocJar()
// Optional ControlsFX support
registerFeature("controlsfx") {
usingSourceSet(sourceSets["controlsfx"])
}
}
javafx {
version = "21"
modules = listOf(
"javafx.base",
"javafx.controls",
"javafx.graphics"
)
configurations = arrayOf(
"compileOnly",
"implementation",
"testImplementation"
)
}
tasks.test {
useJUnitPlatform()
}
/*
* Manifest info
*/
tasks.jar {
manifest {
attributes(mapOf("Implementation-Title" to project.name,
"Implementation-Version" to project.version,
"Automatic-Module-Name" to "io.github.qupath.fxtras"))
}
}
/*
* Use -PstrictJavadoc=true to fail on error with doclint (which is rather strict).
*/
tasks.javadoc {
val strictJavadoc = providers.gradleProperty("strictJavadoc").getOrElse("false")
if ("true" != strictJavadoc) {
(options as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet")
}
}
repositories {
mavenCentral()
}
val controlsfxImplementation by configurations.existing
val compileOnly by configurations.existing {
extendsFrom(controlsfxImplementation.get())
}
dependencies {
api("org.slf4j:slf4j-api:2.0.0")
// Optional ControlsFX support (used for notifications)
controlsfxImplementation("org.controlsfx:controlsfx:11.1.2")
testImplementation("org.junit.jupiter:junit-jupiter:6.0.3")
testImplementation("org.junit.platform:junit-platform-launcher")
testImplementation("ch.qos.logback:logback-classic:1.5.32")
}
publishing {
repositories {
maven {
name = "SciJava"
val releasesRepoUrl = uri("https://maven.scijava.org/content/repositories/releases")
val snapshotsRepoUrl = uri("https://maven.scijava.org/content/repositories/snapshots")
// Use gradle -Prelease publish
url = if (project.hasProperty("release")) releasesRepoUrl else snapshotsRepoUrl
credentials {
username = System.getenv("MAVEN_USER")
password = System.getenv("MAVEN_PASS")
}
}
}
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
pom {
licenses {
license {
name = "Apache License v2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0"
}
}
}
}
}
}