-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathbuild.gradle
79 lines (65 loc) · 2.7 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
plugins {
id 'java-library'
id 'org.bytedeco.gradle-javacpp-platform' version "1.5.8"
}
group 'ch.bildspur'
version '0.9.0'
sourceCompatibility = 1.8
repositories {
mavenCentral()
mavenLocal()
maven { url 'https://jitpack.io' }
// flatDir dirs: "${rootDir}/libs"
}
configurations {
jar.archiveFileName = outputName + '.jar'
processing
compile.extendsFrom processing
}
javadoc {
source = sourceSets.main.allJava
classpath = configurations.runtimeOnly
}
dependencies {
// compile
testImplementation group: 'junit', name: 'junit', version: '4.11'
testImplementation 'com.github.cansik:webcam-capture-processing:8f1ea8d38d'
// opencv (make sure you have updated the local maven repo: mvn -U compile)
implementation (group: 'org.bytedeco', name: 'javacv', version: "1.5.8"){
exclude group: 'org.bytedeco', module: 'librealsense2'
exclude group: 'org.bytedeco', module: 'librealsense2-platform'
}
implementation group: 'org.bytedeco', name: 'opencv-platform', version: "4.6.0-1.5.8"
implementation group: 'org.bytedeco', name: 'openblas-platform', version: "0.3.21-1.5.8"
implementation group: 'org.bytedeco', name: 'tesseract-platform', version: "5.2.0-1.5.8"
// cuda additions
if (project.hasProperty("cuda")) {
implementation group: 'org.bytedeco', name: 'opencv-platform-gpu', version: "4.6.0-1.5.8"
implementation group: 'org.bytedeco', name: 'cuda-platform-redist', version: "11.8-8.6-1.5.8"
}
// processing
implementation fileTree(include: ["core.jar", "jogl-all-main.jar", "gluegen-rt-main.jar"], dir: 'core-libs')
// processing group: 'org.processing', name: 'core', version: '3.3.7'
// processing group: 'org.jogamp.jogl', name: 'jogl-all-main', version: '2.3.2'
// processing group: 'org.jogamp.gluegen', name: 'gluegen-rt-main', version: '2.3.2'
}
task fatJar(type: Jar) {
archiveFileName = "$outputName-complete.jar"
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
dependsOn configurations.runtimeClasspath
// from {
// (configurations.runtime - configurations.processing).collect {
// it.isDirectory() ? it : zipTree(it)
// }
// }
from {
(configurations.runtimeClasspath - configurations.processing).filter( {! (it.name =~ /core.jar/ ||
it.name =~ /jogl-all-main.jar/ ||
it.name =~ /gluegen-rt-main.jar/)}).collect {
it.isDirectory() ? it : zipTree(it)
}
}
with jar
}
// add processing library support
apply from: "processing-library.gradle"