-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.gradle
111 lines (88 loc) · 2.64 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
plugins {
id 'java-library'
id 'jacoco'
id 'com.adarshr.test-logger' version '2.0.0'
}
apply from: 'common.gradle'
allprojects {
group 'org.roc-streaming.roctoolkit'
version tagVersion
}
repositories {
mavenCentral()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
implementation project(":commons")
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.2'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.6.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.2'
testImplementation 'org.awaitility:awaitility:3.1.6'
}
ext {
targetLibraryPath = "${project.rootDir}/libs"
}
compileJava {
options.headerOutputDirectory = file(project(":roc_jni").projectDir.absolutePath + "/src/main/export")
}
tasks.register('copyNativeDebugDeps') {
dependsOn ":roc_jni:assembleDebug"
doLast {
copyNativeLibs(project(":roc_jni").buildDir.absolutePath + "/debug", targetLibraryPath)
}
}
tasks.register('copyNativeReleaseDeps') {
dependsOn ":roc_jni:assembleRelease"
doLast {
copyNativeLibs(project(":roc_jni").buildDir.absolutePath + "/release", targetLibraryPath)
}
}
jar.dependsOn copyNativeReleaseDeps
copyNativeDebugDeps.mustRunAfter jar
project(":roc_jni").afterEvaluate {
tasks.test.enabled = !project(":roc_jni").extensions.cmake.target.isCrossCompiling.get()
}
test {
dependsOn copyNativeDebugDeps
systemProperty "java.library.path", targetLibraryPath
useJUnitPlatform {
includeEngines 'junit-jupiter'
}
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test
reports {
xml.required = true
}
}
testlogger {
theme 'mocha'
showStandardStreams = false
slowThreshold 5000
}
javadoc {
options.overview = "${project.rootDir}/docs/javadoc/overview.html"
options.memberLevel = System.getProperty("visibility") == "private" ? JavadocMemberLevel.PRIVATE : JavadocMemberLevel.PUBLIC
}
task clangFormat {
description = 'Formats all .h and .cpp files using clang-format'
doLast {
def hFiles = fileTree(dir: 'roc_jni', include: '**/*.h')
def cppFiles = fileTree(dir: 'roc_jni', include: '**/*.cpp')
def excludedFiles = fileTree(dir: 'roc_jni', include: '**/org_rocstreaming_roctoolkit_*')
hFiles = hFiles.minus(excludedFiles)
cppFiles = cppFiles.minus(excludedFiles)
hFiles.each { file ->
exec {
commandLine 'clang-format', '-i', file
}
}
cppFiles.each { file ->
exec {
commandLine 'clang-format', '-i', file
}
}
}
}