forked from open-eid/libdigidocpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
executable file
·33 lines (33 loc) · 973 Bytes
/
build.gradle
File metadata and controls
executable file
·33 lines (33 loc) · 973 Bytes
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
plugins {
id 'java'
}
group = 'ee.ria'
java {
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_17
}
base {
archivesName = 'libdigidocpp'
}
jar {
manifest {
attributes 'Main-Class': 'ee.ria.libdigidocpp.libdigidocpp'
}
}
def digidocppJarPath = '/usr/share/digidocpp/digidocpp.jar'
def nativeLibDir = null
if (System.properties['os.name'].toLowerCase().contains('windows')) {
digidocppJarPath = 'C:\\Program Files\\libdigidocpp\\digidocpp.jar'
nativeLibDir = 'C:\\Program Files\\libdigidocpp'
} else if (System.properties['os.name'].toLowerCase().contains('mac')) {
digidocppJarPath = '/Library/Java/Extensions/digidocpp.jar'
}
dependencies {
implementation files(digidocppJarPath)
}
tasks.withType(JavaExec).configureEach {
if (nativeLibDir != null) {
environment 'PATH', "${nativeLibDir};" + System.getenv('PATH')
jvmArgs "-Djava.library.path=${nativeLibDir}"
}
}