forked from openspim/micromanager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
157 lines (130 loc) · 5.68 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
<!-- Build all components of Micro-Manager -->
<!-- Run 'ant -p' for usage -->
<project name="mm" basedir="." default="build">
<include file="buildscripts/buildprops.xml"/>
<import file="buildscripts/version.xml"/>
<fail message="Micro-Manager Ant build files are currently designed for Windows only">
<condition><not><os family="winnt"/></not></condition>
</fail>
<macrodef name="run-all-java-projects">
<attribute name="target"/>
<sequential>
<subant target="@{target}">
<filelist dir="${mm.basedir}">
<!-- Note: Order matters -->
<file name="MMCoreJ_wrap/build.xml"/>
<file name="mmstudio/build.xml"/>
<file name="acqEngine/build.xml"/>
<file name="plugins/build.xml"/>
<file name="autofocus/build.xml"/>
</filelist>
</subant>
</sequential>
</macrodef>
<target name="build-buildtools">
<ant antfile="buildscripts/AntExtensions/build.xml" useNativeBasedir="true" target="jar"/>
</target>
<target name="build-cpp" description="Build all C++ components">
<mm-msbuild project="micromanager.sln" target="Build" failonerror="${mm.build.failonerror}"
logbasename="msbuild-micromanager${mm.build.logsuffix}"/>
</target>
<target name="build-java" depends="build-buildtools"
description="Build all Java components (will NOT trigger build-cpp; requires MMCoreJ_wrap DLL)">
<run-all-java-projects target="jar"/>
</target>
<target name="build" depends="set-version,build-cpp,build-java" description="Build all components"/>
<target name="stage-deviceadapters">
<copy todir="${mm.dll.installdir}">
<fileset dir="${mm.cpp.outdir}" includes="mmgr_dal_*.dll"/>
</copy>
<ant antfile="DeviceAdapters/build.xml" useNativeBasedir="true" target="install"/>
</target>
<target name="stage-only" description="Gather files to be installed (will NOT trigger build)">
<antcall target="stage-deviceadapters"/>
<run-all-java-projects target="install-only"/>
<!-- MMCoreJ DLL -->
<!-- XXX Should be staged by MMCoreJ_wrap/build.xml -->
<copy todir="${mm.dll.installdir}">
<filelist dir="${mm.cpp.outdir}" files="MMCoreJ_wrap.dll"/>
</copy>
<!-- MMCorePy files -->
<!-- For staging purposes, MMCorePy is optional -->
<copy todir="${mm.installdir}" failonerror="${mm.build.failonerror}">
<filelist dir="${mm.cpp.outdir}" files="_MMCorePy.pyd"/>
<filelist dir="${mm.swig.pysrcdir}" files="MMCorePy.py"/>
</copy>
<!-- Files to distribute as is -->
<copy todir="${mm.installdir}">
<fileset dir="${mm.bindistdir}" includes="**"/>
<fileset dir="${mm.platform.bindistdir}" includes="**"/>
<fileset dir="${mm.common.bindistdir}" includes="**"/>
</copy>
<!-- XXX Remaining files to copy; should put elsewhere -->
<copy todir="${mm.installdir}" file="${mm.thirdpartypublic}/JavaLauncher/ImageJ.exe"/>
<copy todir="${mm.installdir}" file="${mm.java.lib.imagej}"/>
<copy todir="${mm.java.installdir}">
<!-- XXX Should limit to the Jars that are actually
used. Use Ivy? -->
<fileset dir="${mm.java.libs}" includes="*.jar" excludes="ij.jar"/>
</copy>
<mkdir dir="${mm.scripts.installdir}"/>
<copy todir="${mm.scripts.installdir}">
<fileset dir="${mm.scripts.srcdir}" includes="*.bsh"/>
</copy>
<!-- Java runtime -->
<copy todir="${mm.installdir}/jre">
<fileset dir="${mm.java.runtime}"/>
</copy>
</target>
<target name="stage" depends="build-buildtools,set-version,build-cpp,build-java,stage-only"
description="Gather files to be installed (will trigger build)"/>
<target name="run" description="Run the staged application (will NOT trigger build or stage)">
<exec dir="${mm.installdir}" executable="${mm.installdir}/ImageJ.exe"/>
</target>
<target name="run-nolauncher" description="Run the staged application without using the ImageJ launcher">
<java classname="ij.ImageJ"
classpath="${mm.installdir}/ij.jar"
fork="yes" maxmemory="1000M"
dir="${mm.installdir}"/>
</target>
<target name="package" description="Create installer from staged files (will NOT trigger build or stage)">
<!-- Default name, if not set -->
<property name="mm.installer.basename" value="MMSetup_${mm.architecture.bits}bit"/>
<property name="mm.installer" value="${mm.installer.basename}.exe"/>
<mkdir dir="${mm.distdir}"/>
<delete file="${mm.distdir}/${mm.installer}"/>
<exec dir="${mm.basedir}" executable="${mm.basedir}/../3rdparty/Inno_Setup_5/iscc.exe"
failonerror="true">
<arg value="/O${mm.distdir}"/>
<arg value="/F${mm.installer.basename}"/>
<arg file="${mm.basedir}/buildscripts/installer-${mm.architecture}.iss"/>
</exec>
</target>
<target name="package-symbols" description="Create a ZIP archive of the PDB files (will NOT trigger build)">
<!-- Default name, if not set -->
<property name="mm.symbols.basename"
value="MMDebugSymbols_${mm.architecture}"/>
<property name="mm.symbols" value="${mm.symbols.basename}.zip"/>
<mkdir dir="${mm.symbolsdir}"/>
<zip destfile="${mm.symbolsdir}/${mm.symbols}"
basedir="${mm.cpp.outdir}"
includes="*.pdb"/>
</target>
<target name="clean-java" description="Clean only the Java components">
<run-all-java-projects target="clean"/>
</target>
<target name="clean" depends="clean-java" description="Delete build intermediate and output files">
<delete dir="${mm.cpp.outdir}"/>
<delete dir="${mm.cpp.intdir}"/>
</target>
<target name="clean-all" description="Delete build files for all configurations and architectures">
<delete dir="${mm.outdir}"/>
<delete dir="${mm.intdir}"/>
</target>
<target name="unstage" description="Delete staged files">
<delete dir="${mm.installdir}"/>
</target>
<target name="unstage-all" description="Delete staged files for all configurations and architectures">
<delete dir="${mm.stagedir}"/>
</target>
</project>