-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.xml
executable file
·155 lines (136 loc) · 5.7 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!--
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright (c) 2012-2014 ForgeRock AS. All rights reserved.
The contents of this file are subject to the terms
of the Common Development and Distribution License
(the License). You may not use this file except in
compliance with the License.
You can obtain a copy of the License at
http://forgerock.org/license/CDDLv1.0.html
See the License for the specific language governing
permission and limitations under the License.
When distributing Covered Code, include this CDDL
Header Notice in each file and include the License file
at http://forgerock.org/license/CDDLv1.0.html
If applicable, add the following below the CDDL Header,
with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [2012] [ForgeRock AS]"
"Portions Copyrighted [2024] [Wren Security]"
-->
<project default="usage">
<description>Wren:IDM AD Password Sync Module and Service for Windows</description>
<property name="appvers" value="1.1.0"/>
<target name="build" depends="clean,version,build32,build64,manageLicenseFileForInnoSetup">
<echo message="Dispatch to build distribution package"/>
<exec executable="C:/Program Files (x86)/Inno Setup 6/Compil32.exe" failonerror="true">
<arg value="/cc" />
<arg value="idmsync.iss" />
</exec>
</target>
<target name="manageLicenseFileForInnoSetup">
<!-- If the license.txt file is missing, the Inno Setup will fail -->
<!-- Duplicates the CDDL license file to license.txt for the license page -->
<echo message="Manage license for the Inno Setup" />
<copy file="legal-notices\CDDLv1.0.txt" tofile="legal-notices\license.txt" />
</target>
<target name="build32">
<echo message="Dispatch to compile of module C code (32bit)" />
<mkdir dir="out/32" />
<exec executable="make32.bat" failonerror="true"/>
<copy file="out/idmsync.dll" tofile="out/32/idmsync.dll" />
<copy file="out/idmsync.pdb" tofile="out/32/idmsync.pdb" />
<copy file="out/idmsyncdll.pdb" tofile="out/32/idmsyncdll.pdb" />
<copy file="out/idmsync.exe" tofile="out/32/idmsync.exe" />
<delete>
<fileset dir="out" includes="*.*"/>
</delete>
</target>
<target name="build64">
<echo message="Dispatch to compile of module C code (64bit)"/>
<mkdir dir="out/64" />
<exec executable="make64.bat" failonerror="true"/>
<copy file="out/idmsync.dll" tofile="out/64/idmsync.dll" />
<copy file="out/idmsync.pdb" tofile="out/64/idmsync.pdb" />
<copy file="out/idmsyncdll.pdb" tofile="out/64/idmsyncdll.pdb" />
<copy file="out/idmsync.exe" tofile="out/64/idmsync.exe" />
<delete>
<fileset dir="out" includes="*.*"/>
</delete>
</target>
<exec executable="git" outputproperty="git.revision">
<arg value="rev-parse" />
<arg value="--short" />
<arg value="HEAD" />
</exec>
<macrodef name="replacestring">
<attribute name="string"/>
<attribute name="searchPattern"/>
<attribute name="replacementPattern"/>
<attribute name="property"/>
<sequential>
<tokens id="id">
<concat>
<string value="@{string}"/>
<filterchain>
<tokenfilter>
<replaceregex pattern="@{searchPattern}"
replace="@{replacementPattern}"
flags="g"/>
</tokenfilter>
</filterchain>
</concat>
</tokens>
<property name="@{property}" value="${toString:id}"/>
</sequential>
</macrodef>
<replacestring string="${appvers}" searchPattern="\." replacementPattern=","
property="appversn"/>
<target name="version">
<copy file="include/version.h.template" tofile="include/version.h" >
<filterchain>
<replacetokens>
<token key="VERSION_S" value="${appvers}"/>
<token key="VERSION_N" value="${appversn},0"/>
<token key="GIT_REVISION" value="${git.revision}"/>
</replacetokens>
</filterchain>
</copy>
<copy file="idmsync.iss.template" tofile="idmsync.iss" >
<filterchain>
<replacetokens>
<token key="VERSION_S" value="${appvers}"/>
</replacetokens>
</filterchain>
</copy>
</target>
<target name="check">
<condition property="deldir">
<available file="out" type="dir"/>
</condition>
</target>
<target name="preclean">
<delete>
<fileset dir="." includes="idmsync.iss" />
<fileset dir="include" includes="version.h" />
</delete>
</target>
<target name="clean" depends="preclean,check" if="deldir">
<echo message="Dispatch to clean" />
<delete includeemptydirs="true">
<fileset dir="out" />
</delete>
</target>
<target name="usage">
<echo message=" "/>
<echo message=" Following targets are available:"/>
<echo message=" "/>
<echo message=" all : builds all modules (32 and 64 bit)"/>
<echo message=" clean : deletes all generated files"/>
<echo message=" "/>
<echo message=" To run a target, issue the following command:"/>
<echo message=" "/>
<echo message=" ant <target-name>"/>
<echo message=" "/>
</target>
</project>