-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle
More file actions
136 lines (115 loc) · 3.16 KB
/
build.gradle
File metadata and controls
136 lines (115 loc) · 3.16 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
129
130
131
132
133
134
135
136
plugins {
id 'java-library'
id 'maven-publish'
}
repositories {
mavenCentral()
maven {
url "https://maven.scijava.org/content/repositories/releases"
}
maven {
url "https://maven.scijava.org/content/repositories/snapshots"
}
}
description = 'Support for parsing the BioImage Model Zoo spec in Java'
version = "0.2.1"
dependencies {
// These are included in QuPath distribution
implementation "org.slf4j:slf4j-api:2.0.4"
implementation 'org.yaml:snakeyaml:2.0'
implementation 'com.google.code.gson:gson:2.10'
testImplementation "org.junit.jupiter:junit-jupiter:5.9.1"
testImplementation 'ch.qos.logback:logback-classic:1.5.19'
}
processResources {
from ("${projectDir}/LICENSE") {
into 'licenses/'
}
}
/*
* Ensure Java 11 compatibility
*/
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
withSourcesJar()
withJavadocJar()
}
/*
* Set module info
*/
tasks.named('compileJava') {
// use the project's version or define one directly
options.javaModuleVersion = provider { project.version }
options.encoding = 'UTF-8'
}
/*
* Manifest info
*/
jar {
manifest {
attributes("Implementation-Title": project.name,
"Implementation-Version": archiveVersion)
}
}
/*
* Create javadocs for all modules/packages in one place.
* Use -PstrictJavadoc=true to fail on error with doclint (which is rather strict).
*/
tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
def strictJavadoc = findProperty('strictJavadoc')
if (!strictJavadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
/*
* Avoid 'Entry .gitkeep is a duplicate but no duplicate handling strategy has been set.'
* when using withSourcesJar()
*/
tasks.withType(org.gradle.jvm.tasks.Jar) {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
tasks.named('test') {
useJUnitPlatform()
}
test {
// Optional base directory containing models
def testModels = project.findProperty("models")
if (testModels)
systemProperty "models", testModels
// Optional parameter for how many subdirectories deep to look for models
def testDepth = project.findProperty("depth")
if (testDepth)
systemProperty "depth", depth
}
publishing {
repositories {
maven {
name = "SciJava"
def releasesRepoUrl = uri("https://maven.scijava.org/content/repositories/releases")
def snapshotsRepoUrl = uri("https://maven.scijava.org/content/repositories/snapshots")
// Use gradle -Prelease publish
url = project.hasProperty('release') ? releasesRepoUrl : snapshotsRepoUrl
credentials {
username = System.getenv("MAVEN_USER")
password = System.getenv("MAVEN_PASS")
}
}
}
publications {
mavenJava(MavenPublication) {
groupId = 'io.github.qupath'
from components.java
pom {
licenses {
license {
name = 'MIT License'
url = 'https://www.opensource.org/licenses/mit-license.php'
}
}
}
}
}
}