-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
245 lines (233 loc) · 8.79 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<!-- This is an ant makefile, type "ant" to run it -->
<project name="jnisat" default="build" xmlns:if="ant:if">
<target name="clean" description="removes all build artifacts">
<delete includeEmptyDirs="true" dir="build" />
<delete file="org.jnisat.jar" />
</target>
<target name="compile">
<mkdir dir="build" />
<javac srcdir="src" destdir="build" includeantruntime="false" nativeheaderdir="build" target="9" source="9">
<classpath>
<pathelement path="build/" />
</classpath>
<!--<compilerarg value="-Xlint:deprecation" />-->
</javac>
</target>
<target name="build" depends="compile" description="builds the org.jnisat.jar file">
<jar destfile="org.jnisat.jar" includes="" compress="true">
<fileset dir="build" includes="**/*.class" />
<fileset dir="" includes="lib/**/*.so" />
<fileset dir="" includes="lib/**/*.dll" />
<fileset dir="" includes="lib/**/*.dylib" />
<fileset file="LICENSE" />
<fileset file="README.md" />
<manifest>
<attribute name="Main-Class" value="org.jnisat.Validate" />
<attribute name="Class-Path" value="." />
</manifest>
</jar>
</target>
<target name="libdir" depends="compile">
<java classname="org.jnisat.LibDetect" classpath="build" outputproperty="jnisat.libdir" failonerror="true">
<arg value="libdir" />
</java>
<mkdir dir="build/${jnisat.libdir}" />
<condition property="jnisat.win32">
<equals arg1="${jnisat.libdir}" arg2="win32" />
</condition>
<condition property="jnisat.win64">
<equals arg1="${jnisat.libdir}" arg2="win64" />
</condition>
<condition property="jnisat.osx64">
<equals arg1="${jnisat.libdir}" arg2="osx64" />
</condition>
</target>
<target name="jpicosat" depends="libdir" description="compiles the jpicosat adapter">
<java classname="org.jnisat.LibDetect" classpath="build" outputproperty="jnisat.jpicosat" failonerror="true">
<arg value="libname" />
<arg value="jpicosat" />
</java>
<exec executable="gcc" os="Linux" dir="build" failonerror="true">
<arg value="-Wall" />
<arg value="-O3" />
<arg value="-fPIC" />
<arg value="-shared" />
<arg value="-s" />
<arg value="-I${java.home}/include/" />
<arg value="-I${java.home}/include/linux/" />
<arg value="-I." />
<arg value="../src/org/jnisat/JPicoSat.c" />
<arg value="-lpicosat" />
<arg value="-o" />
<arg value="${jnisat.jpicosat}" />
</exec>
<move file="build/${jnisat.jpicosat}" todir="lib/${jnisat.libdir}" />
</target>
<target name="minisat.src">
<condition property="minisat.src">
<available file="build/minisat-master" type="dir" />
</condition>
</target>
<target name="getminisat" depends="minisat.src" unless="minisat.src">
<mkdir dir="build" />
<exec executable="curl" dir="build" failonerror="true">
<arg value="-L" />
<arg value="https://github.com/niklasso/minisat/archive/master.zip" />
<arg value="-o" />
<arg value="minisat-master.zip" />
</exec>
<exec executable="unzip" dir="build" failonerror="true">
<arg value="minisat-master.zip" />
</exec>
<exec executable="patch" dir="build/minisat-master" failonerror="true">
<arg value="-p0" />
<arg value="-i" />
<arg value="../../src/minisat.patch" />
</exec>
</target>
<target name="jminisat" depends="libdir" description="compiles the jminisat adapter">
<java classname="org.jnisat.LibDetect" classpath="build" outputproperty="jnisat.jminisat" failonerror="true">
<arg value="libname" />
<arg value="jminisat" />
</java>
<exec executable="g++" os="Linux" dir="build" failonerror="true">
<arg value="-Wall" />
<arg value="-O3" />
<arg value="-fPIC" />
<arg value="-shared" />
<arg value="-s" />
<arg value="-I${java.home}/include/" />
<arg value="-I${java.home}/include/linux/" />
<arg value="-I." />
<arg value="../src/org/jnisat/JMiniSat.cpp" />
<arg value="-lminisat" />
<arg value="-o" />
<arg value="${jnisat.jminisat}" />
</exec>
<antcall if:set="jnisat.osx64" target="getminisat" />
<exec executable="g++" os="Mac OS X" dir="build" failonerror="true">
<arg value="-Wall" />
<arg value="-O3" />
<arg value="-fPIC" />
<arg value="-shared" />
<arg value="-s" />
<arg value="-I${java.home}/include/" />
<arg value="-I${java.home}/include/darwin/" />
<arg value="-Iminisat-master/" />
<arg value="-I." />
<arg value="../src/org/jnisat/JMiniSat.cpp" />
<arg value="-lminisat" />
<arg value="-o" />
<arg value="${jnisat.jminisat}" />
</exec>
<antcall if:set="jnisat.win64" target="getminisat" />
<exec executable="i686-pc-mingw32-g++" if:set="jnisat.win32" dir="build" failonerror="true">
<arg value="-D __STDC_LIMIT_MACROS" />
<arg value="-D __STDC_FORMAT_MACROS" />
<arg value="-D NDEBUG" />
<arg value="-Wall" />
<arg value="-O3" />
<arg value="-shared" />
<arg value="-static-libgcc" />
<arg value="-static-libstdc++" />
<arg value="-s" />
<arg value="-I${java.home}/include/" />
<arg value="-I${java.home}/include/win32/" />
<arg value="-Iminisat-master/" />
<arg value="-I." />
<arg value="../src/org/jnisat/JMiniSat.cpp" />
<arg value="minisat-master/minisat/utils/System.cc" />
<arg value="minisat-master/minisat/core/Solver.cc" />
<arg value="minisat-master/minisat/simp/SimpSolver.cc" />
<arg value="-o" />
<arg value="${jnisat.jminisat}" />
<arg value="-Wl,--kill-at" />
</exec>
<exec executable="x86_64-w64-mingw32-g++" if:set="jnisat.win64" dir="build" failonerror="true">
<arg value="-D __USE_MINGW_ANSI_STDIO" />
<arg value="-D __STDC_LIMIT_MACROS" />
<arg value="-D __STDC_FORMAT_MACROS" />
<arg value="-D NDEBUG" />
<arg value="-Wall" />
<arg value="-O3" />
<arg value="-shared" />
<arg value="-static-libgcc" />
<arg value="-static-libstdc++" />
<arg value="-s" />
<arg value="-I${java.home}/include/" />
<arg value="-I${java.home}/include/win32/" />
<arg value="-Iminisat-master/" />
<arg value="-I." />
<arg value="../src/org/jnisat/JMiniSat.cpp" />
<arg value="minisat-master/minisat/utils/System.cc" />
<arg value="minisat-master/minisat/core/Solver.cc" />
<arg value="minisat-master/minisat/simp/SimpSolver.cc" />
<arg value="-o" />
<arg value="${jnisat.jminisat}" />
<arg value="-Wl,--kill-at" />
</exec>
<move file="build/${jnisat.jminisat}" todir="lib/${jnisat.libdir}" />
</target>
<target name="cominisatps" depends="libdir" description="compiles the COMiniSatPS solver">
<java classname="org.jnisat.LibDetect" classpath="build" outputproperty="jnisat.cominisatps" failonerror="true">
<arg value="libname" />
<arg value="cominisatps" />
</java>
<exec executable="g++" os="Linux" dir="build" failonerror="true">
<arg value="-Wall" />
<arg value="-Wno-parentheses" />
<arg value="-Wno-unused-label" />
<arg value="-Wno-unused-function" />
<arg value="-D __STDC_LIMIT_MACROS" />
<arg value="-D __STDC_FORMAT_MACROS" />
<arg value="-O3" />
<arg value="-fPIC" />
<arg value="-shared" />
<arg value="-s" />
<arg value="-I${java.home}/include/" />
<arg value="-I${java.home}/include/linux/" />
<arg value="-I." />
<arg value="-I../solvers/COMiniSatPS" />
<arg value="../src/org/jnisat/COMiniSatPS.cpp" />
<arg value="../solvers/COMiniSatPS/utils/System.cc" />
<arg value="../solvers/COMiniSatPS/core/Solver.cc" />
<arg value="../solvers/COMiniSatPS/simp/SimpSolver.cc" />
<arg value="-o" />
<arg value="${jnisat.cominisatps}" />
</exec>
<exec executable="g++" os="Mac OS X" dir="build" failonerror="true">
<arg value="-Wall" />
<arg value="-Wno-parentheses" />
<arg value="-Wno-unused-label" />
<arg value="-Wno-unused-function" />
<arg value="-D __STDC_LIMIT_MACROS" />
<arg value="-D __STDC_FORMAT_MACROS" />
<arg value="-O3" />
<arg value="-fPIC" />
<arg value="-shared" />
<arg value="-I${java.home}/include/" />
<arg value="-I${java.home}/include/darwin/" />
<arg value="-I." />
<arg value="-I../solvers/COMiniSatPS" />
<arg value="../src/org/jnisat/COMiniSatPS.cpp" />
<arg value="../solvers/COMiniSatPS/utils/System.cc" />
<arg value="../solvers/COMiniSatPS/core/Solver.cc" />
<arg value="../solvers/COMiniSatPS/simp/SimpSolver.cc" />
<arg value="-o" />
<arg value="${jnisat.cominisatps}" />
</exec>
<move file="build/${jnisat.cominisatps}" todir="lib/${jnisat.libdir}" />
</target>
<target name="detect" depends="build">
<echo message="ant os.arch: ${os.arch}" />
<echo message="ant os.name: ${os.name}" />
<echo message="ant java.home: ${java.home}" />
<java classname="org.jnisat.LibDetect" classpath="org.jnisat.jar" fork="true" failonerror="true"/>
</target>
<target name="validate" depends="detect" description="runs the validation program">
<java jar="org.jnisat.jar" fork="true" failonerror="true">
<jvmarg value="-ea" />
</java>
</target>
<target name="travis" depends="validate" />
</project>