forked from nordic-institute/X-Road
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
138 lines (110 loc) · 4.46 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
plugins {
id 'com.github.johnrengelman.shadow' version '2.0.1'
}
apply plugin: 'application'
project.ext.schemaTargetDir = new File("$buildDir/generated-sources")
configurations {
xjc
}
sourceSets {
main {
java.srcDirs = ['src/main/java', 'build/generated-sources']
}
//testsuite {
// java {
// compileClasspath += main.output
// runtimeClasspath += main.output
// }
//}
}
dependencies {
compile project(':common-verifier')
compile project(':signer-protocol')
// Necessary since there are jars with no adequate Maven dependencies
compile fileTree(dir: '../libs', include: '*.jar')
testCompile project(':common-test')
testCompile project(':common-verifier').sourceSets.test.output
testCompile "com.typesafe.akka:akka-testkit_2.11:$akkaVersion"
testCompile 'com.github.stefanbirkner:system-rules:1.16.0'
testCompile 'org.powermock:powermock-module-junit4:1.6.5'
testCompile 'org.powermock:powermock-api-mockito:1.6.5'
xjc 'org.glassfish.jaxb:jaxb-xjc:2.2.11'
xjc 'org.glassfish.jaxb:jaxb-runtime:2.2.11'
//testsuiteCompile project(':common-test')
}
//configurations {
// testsuiteCompile.extendsFrom testCompile
// testsuiteRuntime.extendsFrom testRuntime
//}
mainClassName = 'ee.ria.xroad.signer.SignerMain'
shadowJar {
classifier = ''
append('reference.conf')
from rootProject.file("LICENSE.txt")
}
jar.enabled = false
build.dependsOn shadowJar
buildall.dependsOn shadowJar
task createDirs () {
doLast {
project.ext.schemaTargetDir.mkdirs()
}
}
task xjc () {
inputs.file file('src/main/resources/*.xsd')
outputs.dir project.ext.schemaTargetDir
doLast {
ant.taskdef(name: 'xjc', classname: 'com.sun.tools.xjc.XJCTask', classpath: configurations.xjc.asPath)
ant.xjc(
destdir: project.ext.schemaTargetDir,
package: 'ee.ria.xroad.common.conf.keyconf',
schema: 'src/main/resources/keyconf.xsd',
binding: '../common-util/src/main/resources/identifiers-bindings.xml'
)
}
}
// XXX For running several instances side-by-side, do not use the gradle task --
// gradle cannot handle parallel runs if each task invokes a long-running server process.
// Instead, use the .jar in the build/libs directory:
// java -Djava.library.path=/home/iks2/core/passwordstore -jar signer-1.0.jar
task runSignerMain(type: JavaExec) {
jvmArgs '-Dxroad.signer.key-configuration-file=src/test/resources/keyconf.xml',
'-Dxroad.signer.device-configuration-file=src/test/resources/devices.ini',
'-Dxroad.common.configuration-path=../common-util/src/test/resources/globalconf_good_v2',
'-Dxroad.common.temp-files-path=build/tmp/',
'-Dxroad.proxy.configuration-anchor-file=../common-util/src/test/resources/configuration-anchor1.xml',
'-Dlogback.configurationFile=src/test/resources/logback-signer.xml',
'-Djava.library.path=../passwordstore:../libs',
'-Dxroad.signer.moduleManagerImpl=ee.ria.xroad.signer.tokenmanager.module.HardwareModuleManagerImpl'
main = 'ee.ria.xroad.signer.SignerMain'
classpath = sourceSets.main.runtimeClasspath
classpath += files('../addons/hwtoken/build/libs/hwtoken-1.0.jar')
description = "Starts signer main program.\nNote: " +
"Be sure that appropriate libpkcs11wrapper.so is installed to the " +
"directory\n{JAVA_HOME}/jre/lib/i386 (analogous directory for 64-bit " +
"OS). Otherwise use\nnext property to detemine your library path:\n" +
"jvmArgs '-Djava.library.path=/foo/bar/iaik/bin/unix/linux-x86/release'";
}
//task runSignerTestsuite(type: Test){
// include '**/SignerTestSuite.class' // for doing only testsuite
// description = "Run Signer test suite."
// testClassesDir = project.sourceSets.testsuite.output.classesDir
// classpath = project.sourceSets.testsuite.runtimeClasspath
//}
xjc.dependsOn createDirs
compileJava.dependsOn xjc
task licenseFormatJava(type:nl.javadude.gradle.plugins.license.License) {
source = fileTree('src/main/java')
}
task licenseTestJava(type:nl.javadude.gradle.plugins.license.License) {
source = fileTree('src/main/java')
check = true
}
licenseFormatMain.enabled = false
licenseMain.enabled = false
licenseFormat.dependsOn licenseFormatJava
licenseTest.dependsOn licenseTestJava
idea.module {
excludeDirs -= file(buildDir)
buildDir.listFiles({ d, f -> f != 'generated-sources' } as FilenameFilter).each { excludeDirs += it }
}