This repository has been archived by the owner on Dec 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
125 lines (99 loc) · 3.26 KB
/
build.gradle
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
plugins {
id 'java-library'
// To create a shadow/fat jar, including dependencies
id 'com.github.johnrengelman.shadow' version '7.0.0'
// To manage included native libraries
id 'org.bytedeco.gradle-javacpp-platform' version '1.5.4'
}
repositories {
// Use this only for local development!
// mavenLocal()
mavenCentral()
maven {
url "https://maven.scijava.org/content/repositories/releases"
}
maven {
url "https://maven.scijava.org/content/repositories/snapshots"
}
}
/*
* Optionally use OpenCV with CUDA.
* See https://github.com/bytedeco/javacpp-presets/tree/master/cuda for info (and licenses).
*/
def useCudaRedist = project.hasProperty('cuda-redist')
def useCuda = useCudaRedist || project.hasProperty('cuda')
ext.moduleName = 'qupath.extension.tensorflow'
description = 'QuPath extension to use TensorFlow'
version = "0.3.0"
dependencies {
def tensorflowVersion = "0.3.3"
def cudaVersion = "11.0-8.0-1.5.4" // Warning! This doesn't match version with QuPath v0.3.0 + opencv-platform-gpu
def qupathVersion = "0.3.0"
def platform = project.findProperty("platform")
if (platform) {
implementation "org.tensorflow:tensorflow-core-platform-${platform}:${tensorflowVersion}"
} else {
implementation "org.tensorflow:tensorflow-core-platform:${tensorflowVersion}"
}
if (useCuda) {
implementation "org.bytedeco:cuda-platform:${cudaVersion}"
if (useCudaRedist) {
implementation "org.bytedeco:cuda-platform-redist:${cudaVersion}"
}
}
shadow "io.github.qupath:qupath-gui-fx:${qupathVersion}"
shadow "org.slf4j:slf4j-api:1.7.30"
testImplementation "io.github.qupath:qupath-gui-fx:${qupathVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-api:5.7.2"
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
processResources {
from ("${projectDir}/LICENSE.txt") {
into 'licenses/'
}
doLast {
if (useCuda) {
logger.quiet("Requesting CUDA support - by downloading these archives you agree to the terms of the license " +
" agreements for NVIDIA software included in the archives.")
logger.quiet("See https://github.com/bytedeco/javacpp-presets/tree/master/cuda for more information.")
}
}
}
tasks.register("copyDependencies", Copy) {
description "Copy dependencies into the build directory for use elsewhere"
group "QuPath"
from configurations.default
into 'build/libs'
}
/*
* Ensure Java 11 compatibility
*/
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
if (project.properties['sources'])
withSourcesJar()
if (project.properties['javadocs'])
withJavadocJar()
}
/*
* Create javadocs for all modules/packages in one place.
* Use -PstrictJavadoc=true to fail on error with doclint (which is rather strict).
*/
def strictJavadoc = findProperty('strictJavadoc')
if (!strictJavadoc) {
tasks.withType(Javadoc) {
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()
}