forked from pillarone/risk-analytics-graph-form-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
77 lines (65 loc) · 3.6 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
<project name="RiskAnalyticsGraphFormEditor" default="cruise">
<property file="application.properties" />
<property name="build.prod.dir" value="${user.home}/.grails/${app.grails.version}/projects/${app.name}" />
<property name="plugin.dir" value="${build.prod.dir}/plugins" />
<property name="webapp.lib.dir" value="web-app/lib" />
<property name="resources.prod.dir" value="src/java" />
<property file="${user.home}/cert.properties" />
<mkdir dir="${plugin.dir}" />
<get src="https://raw.githubusercontent.com/pillarone/risk-analytics-core/master/scripts/build.xml"
dest="_build.xml" skipexisting="true" ignoreerrors="true" />
<copy tofile="_build.xml" overwrite="true" failonerror="false">
<fileset dir="${plugin.dir}" includes="risk-analytics-core*/scripts/build.xml" />
</copy>
<import file="_build.xml" />
<target name="-trusted-cert-available">
<!-- try to use a trusted certificate reading cert.properties from the user.home directory -->
<available property="file.exists" file="${user.home}/cert.properties" />
</target>
<target name="-self-signed-cert" unless="-trusted-cert-available">
<!-- if no trusted certificate has been found use the self signed certificate available in the project root -->
<!-- <echo message="No trusted certificate found. user.home is ${user.home}."/> -->
<property name="signjar.alias" value="pillarone" />
<property name="signjar.keystore" value="pillarone.keystore" />
<property name="signjar.storepass" value="nopasswd" />
<property name="signjar.keypass" value="nopasswd" />
</target>
<target name="_beforeReleasePlugin" depends="jar-client" />
<target name="jar-client" depends="-self-signed-cert" description="--> Create clientside jar files">
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath location="./lib-build/ant-contrib-1.0b3.jar" />
</taskdef>
<echo message="${signjar.keystore}" />
<mkdir dir="${webapp.lib.dir}" />
<delete dir="${webapp.lib.dir}">
<include name="${app.name}*.jar" />
</delete>
<jar jarfile="${webapp.lib.dir}/${app.name}-client.jar">
<fileset dir="${classes.prod.dir}" includes="org/pillarone/riskanalytics/graph/formeditor/client/**" />
<fileset dir="${classes.prod.dir}"
includes="org/pillarone/riskanalytics/application/environment/shared/**" />
<fileset dir="${resources.prod.dir}" includes="*.png" />
</jar>
<foreach param="jarFile" target="updateManifestForClientJars">
<path>
<fileset dir="${webapp.lib.dir}">
<include name="*.jar" />
</fileset>
</path>
</foreach>
<!-- has to be replaced with a trusted certificate issued for the builder of the jar files -->
<!-- this is a self signed certificate and won't work with a strict security policy -->
<signjar alias="${signjar.alias}" storetype="PKCS12" keystore="${signjar.keystore}"
storepass="${signjar.storepass}" keypass="${signjar.keypass}" lazy="false" tsaurl="http://tsa.starfieldtech.com/">
<fileset dir="${webapp.lib.dir}" includes="*.jar" />
</signjar>
</target>
<target name="updateManifestForClientJars">
<jar update="true" file="${jarFile}">
<manifest>
<attribute name="Codebase" value="*" />
<attribute name="Permissions" value="all-permissions" />
</manifest>
</jar>
</target>
</project>