forked from openvinotoolkit/openvino_contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
146 lines (132 loc) · 3.47 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
buildscript {
repositories {
jcenter()
}
dependencies {
//Check for the latest version here: http://plugins.gradle.org/plugin/com.jfrog.artifactory
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4+"
}
}
plugins {
id 'java-library'
id 'maven-publish'
}
allprojects {
apply plugin: "com.jfrog.artifactory"
}
def native_resources = [
System.getenv('INTEL_OPENVINO_DIR') + "/runtime/lib/intel64", // UNIX
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/*.java"
}
}
}
repositories {
jcenter()
}
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') }
//
// Bintray publication:
// $ export ARTIFACTORY_USER=<USERNAME>
// $ export ARTIFACTORY_PASS=<TOKEN>
// $ export VERSION=<VERSION>
// $ gradle artifactoryPublish
//
version = System.getenv('VERSION')
artifactory {
contextUrl = "https://openvino.jfrog.io/artifactory"
publish {
repository {
repoKey = 'openvino-gradle-dev-local'
username = System.getenv('ARTIFACTORY_USER')
password = System.getenv('ARTIFACTORY_PASS')
maven = true
}
defaults {
publications('OpenVINOPublication')
}
publishBuildInfo = true
publishArtifacts = true
publishPom = true
}
resolve {
repository {
repoKey = 'openvino-gradle-dev'
username = System.getenv('ARTIFACTORY_USER')
password = System.getenv('ARTIFACTORY_PASS')
maven = true
}
}
}
def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
developer {
id "developer-id"
name "developer-name"
email "[email protected]"
}
}
scm {
url "https://github.com/openvinotoolkit/openvino_contrib"
}
}
publishing {
publications {
OpenVINOPublication(MavenPublication) {
from(components.java)
groupId 'org.intel'
artifactId 'openvino'
version project.version
pom.withXml {
def root = asNode()
root.appendNode('description', 'Java bindings for Intel OpenVINO')
root.appendNode('name', 'Intel OpenVINO')
root.appendNode('url', 'https://github.com/openvinotoolkit/openvino_contrib')
root.children().last() + pomConfig
}
}
}
}