forked from TAK-Product-Center/Server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
134 lines (112 loc) · 4.36 KB
/
build.gradle
File metadata and controls
134 lines (112 loc) · 4.36 KB
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
import groovy.xml.MarkupBuilder
import java.nio.file.Files
import java.nio.file.Paths
apply plugin: 'application'
mainClassName = 'com.bbn.marti.UserManager'
apply plugin: 'com.github.johnrengelman.shadow'
jar {
enabled = false
}
shadowJar {
baseName = 'UserManager'
classifier = 'all'
version = version
}
sourceSets {
main {
java {
srcDirs = ['src/main/java']
}
resources {
srcDirs = ['src/main/resources']
}
}
integrationTest {
java {
srcDir 'src/integrationTest/java'
}
resources {
srcDir 'src/integrationTest/resources'
}
}
}
task integrationTest(type: Test) {
group = "Verification"
description = "Executes integration test using the takcl framework"
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
def tmpDir = "$buildDir/tmp/integrationTest/"
def fallbackTmpDir = tmpDir
def modelServerDir = project.parent.project(':takserver-package').buildDir.toPath().resolve('takArtifacts')
def certToolDir = project.parent.project(':takserver-package').buildDir.toPath().resolve('takArtifacts/certs')
def jarName = 'takserver.war'
def configFilepath = Paths.get(tmpDir).resolve("TAKCLConfig.xml").toAbsolutePath()
def certificateDirectory = tmpDir + 'TEST_CERTS/'
def configurationString =
"""<?xml version="1.0" encoding="UTF-8"?>
<TAKCLConfiguration xmlns="http://bbn.com/marti/takcl/config"
xmlns:common="http://bbn.com/marti/takcl/config/common">
<common:TemporaryDirectory>"${tmpDir}</common:TemporaryDirectory>"
<common:FallbackTemporaryDirectory>${fallbackTmpDir}/</common:FallbackTemporaryDirectory>
<common:RunnableTAKServerConfig
modelServerDir="${modelServerDir}"
jarName="${jarName}"
serverFarmDir="${tmpDir}TEST_FARM"
certificateDirectory="${certificateDirectory}"
certToolDirectory="${certToolDir}"
/>
<common:ConnectableTAKServerConfig
url="127.0.0.1"
truststoreJKSFilepath="${certificateDirectory}/truststore-root.jks"
truststorePass="atakatak"
clientKeystoreP12Filepath="${certificateDirectory}TAKCL.p12"
clientKeystorePass="atakatak"
/>
<common:TAKCLTestSourceGenerationConfig
javaSrcDir="src/"
javaTemplatePackage="com.bbn.marti.test.shared.data.templates"
javaGenerationPackage="com.bbn.marti.test.shared.data.generated"
/>
</TAKCLConfiguration>"""
doFirst {
new File(tmpDir).mkdirs()
Files.write(configFilepath, configurationString.getBytes())
}
systemProperty 'com.bbn.marti.takcl.config.filepath', configFilepath.toString()
systemProperty 'java.net.preferIPv4Stack', 'true'
systemProperty 'logging.level.com.bbn', 'TRACE'
systemProperty 'logging.level.tak', 'TRACE'
systemProperty 'logging.level.org.apache.ignite', 'INFO'
systemProperty 'com.bbn.marti.takcl.dbEnabled', 'false'
Object testProperties = System.properties
for (String key : testProperties.keySet()) {
if (key.startsWith("com.bbn.marti.takcl")) {
systemProperty key, testProperties.get(key)
}
}
dependsOn(':takserver-package:prePackage')
dependsOn('build')
}
dependencies {
compile project(':takserver-takcl-core')
compile group: 'ch.qos.logback', name: 'logback-classic', version: logback_version
compile group: 'org.slf4j', name: 'slf4j-api', version: slf4j_version
compile group: 'org.apache.ignite', name: 'ignite-slf4j', version: ignite_version
compile group: 'xerces', name: 'xercesImpl', version: xerces_version
// required to fix version conflict for h2 between ignite and spring boot
compile group: 'com.h2database', name: 'h2', version: h2_version
integrationTestCompile project(':takserver-takcl-core')
integrationTestCompile group: 'xerces', name: 'xercesImpl', version: xerces_version
// required to fix version conflict for h2 between ignite and spring boot
integrationTestCompile group: 'com.h2database', name: 'h2', version: h2_version
}
task copyJar (type: Copy, dependsOn: shadowJar) {
from file('build/libs')
include 'UserManager-' + version + '-all.jar'
into "$buildDir/cluster"
rename('UserManager-' + version + '-all.jar', 'UserManager.jar')
}
task setupCluster (type: Copy, dependsOn: copyJar) {}
clean {
delete '$buildDir/cluster'
}