-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
111 lines (92 loc) · 4.75 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
<project name="ulc-plugin" default="create-plugin">
<property environment="env" />
<property name="GRAILS_HOME" value="${env.GRAILS_HOME}" />
<import file="${GRAILS_HOME}/src/grails/grails-macros.xml" />
<property file="application.properties" />
<property file="${user.home}/cert.properties" />
<property name="webapp.lib.dir" value="web-app/lib" />
<condition property="grails" value="${GRAILS_HOME}/bin/grails.bat">
<os family="windows" />
</condition>
<property name="grails" value="${GRAILS_HOME}/bin/grails" />
<condition property="GRAILS_JVM_OPTS" value="${env.GRAILS_JVM_OPTS}">
<isset property="env.GRAILS_JVM_OPTS" />
</condition>
<property name="GRAILS_JVM_OPTS" value="-Xmx1024m -XX:MaxPermSize=512m -Duser.language='en'" />
<property name="release.repository" value="pillarone"/>
<tstamp>
<format property="build-timestamp" pattern="dd.MM.yyyy HH:mm" />
</tstamp>
<target name="init">
<echo message="GRAILS_HOME: ${GRAILS_HOME}" />
<echo message="app.name: ${app.name}" />
<echo message="user.language: ${user.language}, user.country: ${user.country}" />
</target>
<target name="clean" depends="init" description="--> Cleans a Grails application">
<exec executable="${grails}" failonerror="true" resolveexecutable="true">
<arg value="clean" />
<arg value="--non-interactive" />
<env key="GRAILS_HOME" value="${GRAILS_HOME}" />
<env key="JAVA_OPTS" value="${GRAILS_JVM_OPTS}" />
</exec>
</target>
<target name="compile" depends="init" description="--> Compiles a Grails application">
<exec executable="${grails}" failonerror="true" resolveexecutable="true">
<arg value="compile" />
<arg value="--non-interactive" />
<env key="GRAILS_HOME" value="${GRAILS_HOME}" />
<env key="JAVA_OPTS" value="${GRAILS_JVM_OPTS}" />
</exec>
</target>
<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">
<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" />
<property name="signjar.keystoretype" value="JKS" />
<!--<property name="signjar.keystoretype" value="PKCS12" />-->
</target>
<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>
<foreach param="jarFile" target="updateManifestForClientJars">
<path>
<fileset dir="${webapp.lib.dir}">
<include name="*.jar" />
</fileset>
</path>
</foreach>
<echo message="${signjar.keystore}" />
<signjar alias="${signjar.alias}" storetype="${signjar.keystoretype}" keystore="${signjar.keystore}" storepass="${signjar.storepass}"
keypass="${signjar.keypass}" lazy="false" tsaurl="http://tsa.starfieldtech.com/">
<fileset dir="${webapp.lib.dir}" includes="*.jar" />
<sysproperty key="http.proxyHost" value="${signjar.proxyHost}"/>
<sysproperty key="http.proxyPort" value="${signjar.proxyPort}"/>
</signjar>
</target>
<target name="updateManifestForClientJars" >
<jar update="true" file="${jarFile}">
<manifest>
<attribute name="Codebase" value="*" />
<attribute name="Permissions" value="all-permissions" />
<attribute name="Application-Name" value="AllianzART" />
</manifest>
</jar>
</target>
<target name="release-plugin" depends="clean, compile, jar-client"
description="Releases the plugin in the configured repository.">
<exec executable="${grails}" failonerror="true" resolveexecutable="true">
<arg value="--non-interactive" />
<arg value="publish-plugin" />
<arg value="--repository=${release.repository}" />
<arg value="--no-overwrite" />
<env key="GRAILS_HOME" value="${GRAILS_HOME}" />
<env key="JAVA_OPTS" value="${GRAILS_JVM_OPTS}" />
</exec>
</target>
</project>