forked from SORMAS-Foundation/SORMAS-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
126 lines (99 loc) · 4.67 KB
/
build.xml
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
<?xml version="1.0"?>
<!DOCTYPE project>
<project name="sormas-base" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant" default="install">
<property file="build.properties" />
<property name="deploy.path" value="${glassfish.domain.root}/autodeploy" />
<property name="deploy.serverlibs.path" value="${glassfish.domain.root}/lib" />
<property name="collect.root.path" value="../deploy" />
<property name="collect.serverlibs.path" value="${collect.root.path}/serverlibs" />
<property environment="env" />
<target name="clean" unless="clean.skip" description="Clean application">
<artifact:mvn fork="true" mavenhome="${env.M2_HOME}" failonerror="true">
<sysproperty key="maven.multiModuleProjectDirectory" value="${basedir}" />
<arg value="clean" />
</artifact:mvn>
</target>
<target name="install" description="Compile main source tree java files and install" unless="shared.installed">
<artifact:mvn dir="${basedir}" fork="true" mavenhome="${env.M2_HOME}" failonerror="true">
<sysproperty key="maven.multiModuleProjectDirectory" value="${basedir}" />
<arg value="install" />
<arg value="-Dmaven.test.skip=true" />
</artifact:mvn>
<property name="shared.installed" value="true" />
</target>
<target name="install-with-app" description="Compile main source tree java files and install, include android app" unless="shared.installed">
<artifact:mvn dir="${basedir}" fork="true" mavenhome="${env.M2_HOME}" failonerror="true">
<sysproperty key="maven.multiModuleProjectDirectory" value="${basedir}" />
<arg value="install" />
<arg value="-Pwith-app" />
<arg value="-Dmaven.test.skip=true" />
</artifact:mvn>
<property name="shared.installed" value="true" />
</target>
<target name="generate-api-doc" description="Call the generators">
<artifact:mvn pom="../sormas-api/pom.xml" fork="true" mavenhome="${env.M2_HOME}" failonerror="true">
<sysproperty key="maven.multiModuleProjectDirectory" value="../sormas-api" />
<arg value="test" />
<arg value="-Dtest=*Generator" />
</artifact:mvn>
</target>
<target name="deploy-serverlibs" description="Gather server jars">
<artifact:pom id="serverlibsPom" file="../sormas-serverlibs/pom.xml">
</artifact:pom>
<echo>The following invalid POM warning can be ignored</echo>
<artifact:dependencies filesetId="serverlibsid" pomRefId="serverlibsPom" useScope="compile" versionsId="dependency.versions" />
<delete failonerror="false">
<fileset dir="${deploy.serverlibs.path}">
<include name="*.jar" />
</fileset>
</delete>
<copy todir="${deploy.serverlibs.path}" preservelastmodified="true" verbose="true">
<fileset refid="serverlibsid" />
<mapper type="flatten" />
</copy>
</target>
<target name="collect-setup" description="Collects setup/update scripts and config files">
<delete failonerror="false" includeemptydirs="true">
<fileset dir="${collect.root.path}" casesensitive="false">
<exclude name="*.md" />
<include name="*.*" />
</fileset>
</delete>
<copy todir="${collect.root.path}">
<fileset dir="setup">
<include name="**/**" />
</fileset>
</copy>
</target>
<target name="collect-serverlibs" description="serverlibs für server setup bereitstellen">
<artifact:pom id="serverlibsPom" file="../sormas-serverlibs/pom.xml">
</artifact:pom>
<artifact:dependencies filesetId="serverlibsid" pomRefId="serverlibsPom" useScope="compile" versionsId="dependency.versions" />
<delete failonerror="false">
<fileset dir="${collect.serverlibs.path}">
<include name="*.jar" />
</fileset>
</delete>
<copy todir="${collect.serverlibs.path}" preservelastmodified="true" verbose="true">
<fileset refid="serverlibsid" />
<mapper type="flatten" />
</copy>
</target>
<target name="collect-artifacts" description="Collects artifacts">
<ant dir="../sormas-ear" target="3-collect" />
<ant dir="../sormas-ui" target="3-collect" />
<ant dir="../sormas-rest" target="3-collect" />
<ant dir="../sormas-app" target="3-collect" />
<ant dir="../sormas-keycloak-service-provider" target="3-collect" />
</target>
<target name="collect-all" description="collects all serverlibs, bundles and so on for the setup-script.">
<echo>Collecting serverlibs</echo>
<antcall target="collect-serverlibs" />
<echo>Collecting config und scripts</echo>
<antcall target="collect-setup" />
<echo>Collecting SORMAS artifacts</echo>
<antcall target="collect-artifacts" />
</target>
<path id="maven-ant-tasks.classpath" path="${basedir}/../sormas-base/antlib/maven-ant-tasks-2.1.4-SNAPSHOT_PATCHED.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" />
</project>