-
Notifications
You must be signed in to change notification settings - Fork 621
/
build.gradle
98 lines (85 loc) · 2.88 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
plugins {
id 'application'
id 'jacoco'
}
repositories {
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
api "commons-cli:commons-cli:${commons_cli_version}"
api "org.apache.logging.log4j:log4j-slf4j-impl:${log4j_slf4j_version}"
api project(":basicdataset")
api project(":model-zoo")
api project(":testing")
api("org.testng:testng:${testng_version}") {
exclude group: "junit", module: "junit"
}
if (System.getProperty("ai.djl.default_engine") == "PyTorch") {
runtimeOnly project(":pytorch:pytorch-engine")
runtimeOnly project(":pytorch:pytorch-model-zoo")
runtimeOnly "ai.djl.pytorch:pytorch-native-auto:${pytorch_version}-SNAPSHOT"
} else if (System.getProperty("ai.djl.default_engine") == "TensorFlow") {
runtimeOnly project(":tensorflow:tensorflow-engine")
runtimeOnly project(":tensorflow:tensorflow-native-auto")
} else {
runtimeOnly project(":mxnet:mxnet-engine")
runtimeOnly project(":mxnet:mxnet-model-zoo")
runtimeOnly "ai.djl.mxnet:mxnet-native-auto:${mxnet_version}-SNAPSHOT"
}
}
task copyDependencies(type: Copy) {
into "build/dependencies"
from configurations.runtime
}
application {
mainClassName = System.getProperty("main", "ai.djl.integration.IntegrationTest")
}
run {
environment("TF_CPP_MIN_LOG_LEVEL", "1") // turn off TensorFlow print out
systemProperties System.getProperties()
systemProperties.remove("user.dir")
systemProperty("file.encoding", "UTF-8")
}
jacocoTestReport {
group = "Reporting"
getSourceDirectories().from(files())
getClassDirectories().from(files())
javaProjects().findAll { p ->
![":mxnet:jnarator", ":tensorflow:engine", ":examples"].contains(p.getPath())
}.each { p ->
additionalSourceDirs files((Set<File>) p.sourceSets.main.allJava.srcDirs)
additionalClassDirs((FileCollection) p.sourceSets.main.output)
}
reports {
xml.enabled true
csv.enabled false
}
// Work-around to allow us to build list of executionData files in doFirst
onlyIf = {
true
}
}
task debugEnv(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
systemProperties System.getProperties()
systemProperties.remove("user.dir")
systemProperties.put("ai.djl.logging.level", "debug")
main = "ai.djl.integration.util.DebugEnvironment"
}
tasks.distTar.enabled = false
test.finalizedBy project.tasks.jacocoTestReport, project.tasks.jacocoTestCoverageVerification
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
if (["PyTorch", "TensorFlow"].contains(System.getProperty("ai.djl.default_engine"))) {
minimum = 0.6
} else {
minimum = 0.7
}
}
}
}
}