forked from openvinotoolkit/openvino_contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
70 lines (65 loc) · 1.82 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
plugins {
id 'java-library'
}
import org.gradle.internal.os.OperatingSystem
println 'Operating system: ' + OperatingSystem.current()
def nativesCPP;
def openvinoVersion = "2022.1"
if (OperatingSystem.current().isMacOsX()) {
nativesCPP = 'macosx-x86_64'
} else if (OperatingSystem.current().isLinux()) {
nativesCPP = 'linux-x86_64'
} else if (OperatingSystem.current().isWindows()) {
nativesCPP = 'windows-x86_64'
} else {
logger.warn('Unknown operating system!')
}
project.version = "${openvinoVersion}-${nativesCPP}"
def native_resources = [
System.getenv('INTEL_OPENVINO_DIR') + "/runtime/lib/intel64", // UNIX
System.getenv('INTEL_OPENVINO_DIR') + "/runtime/lib/intel64/Release", // Mac
System.getenv('INTEL_OPENVINO_DIR') + "/runtime/bin/intel64/Release", // Windows
System.getenv('TBB_DIR') + "/../lib/",
]
def resources_list = ""
native_resources.each {
def tree = fileTree(it) {
include '*'
}
tree.visit { FileVisitDetails details ->
if (!details.file.isDirectory()) {
resources_list += details.file.name + "\n"
}
}
}
file('native').mkdirs()
file('native/resources_list.txt').text = "${resources_list}"
sourceSets {
main {
java {
srcDirs = ["org"]
}
resources {
srcDirs = native_resources
srcDir 'native'
}
}
test {
java {
srcDirs = ["."]
include "tests/compatibility/*.java", "tests/*.java"
}
}
}
repositories{
mavenCentral()
}
dependencies {
testImplementation "junit:junit:4.13.1"
testImplementation "org.hamcrest:hamcrest-core:1.3"
}
test {
systemProperty 'MODELS_PATH', System.getProperty('MODELS_PATH')
systemProperty 'device', System.getProperty('device')
}
test.onlyIf { project.hasProperty('run_tests') }