Skip to content

Commit

Permalink
Merge pull request #627 from joshmoore/build-improvements-pr577
Browse files Browse the repository at this point in the history
Various build and deploy fixes from the FS branch
  • Loading branch information
joshmoore committed Jan 22, 2013
2 parents 0c0b5be + 5d9bbe3 commit 926a80d
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
[submodule "components/bioformats"]
path = components/bioformats
url = git://github.com/openmicroscopy/bioformats.git
ignore = dirty
[submodule "docs/sphinx"]
path = docs/sphinx
url = git://github.com/openmicroscopy/ome-documentation.git
ignore = dirty
[submodule "components/tools/OmeroPy/scripts"]
path = components/tools/OmeroPy/scripts
url = git://github.com/ome/scripts.git
ignore = dirty
52 changes: 46 additions & 6 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,49 @@ def choose_omero_version():
sys.exit(1)


def handle_tools(args):
_ = os.path.sep.join
additions = []
mappings = {
"-top": _(["build.xml"]),
"-cpp": _(["components","tools","OmeroCpp","build.xml"]),
"-fs": _(["components","tools","OmeroFS","build.xml"]),
"-java": _(["components","tools","OmeroJava","build.xml"]),
"-py": _(["components","tools","OmeroPy","build.xml"]),
"-web": _(["components","tools","OmeroWeb","build.xml"]),
}
while len(args) > 0 and args[0] in mappings.keys()+["-perf"]:
if args[0] == "-perf":
args.pop(0)
A = "-listener net.sf.antcontrib.perf.AntPerformanceListener".split()
additions.extend(A)
elif args[0] in mappings.keys():
F = mappings[args.pop(0)]
A = ["-f", F]
additions.extend(A)
return additions + args


def handle_relative(args):
"""
If no other specific file has been requested,
then use whatever relative path is needed to
specify build.xml in the local directory.
Regardless, os.chdir is called to the top.
"""
additions = []
this = os.path.abspath(__file__)
this_dir = os.path.abspath(os.path.join(this, os.pardir))
cwd = os.path.abspath(os.getcwd())
os.chdir(this_dir)
if "-f" not in args:
build_xml = os.path.join(cwd, "build.xml")
if os.path.exists(build_xml):
additions.append("-f")
additions.append(build_xml)
return additions + args

if __name__ == "__main__":
#
# use java_omero which will specially configure the build system.
Expand All @@ -119,12 +162,9 @@ def choose_omero_version():
del os.environ['CLASSPATH']

try:
if len(args) > 0 and args[0] == "-perf":
args.pop(0)
A = "-listener net.sf.antcontrib.perf.AntPerformanceListener".split() + args
java_omero(A)
else:
java_omero(args)
args = handle_tools(args)
args = handle_relative(args)
java_omero(args)
notification(""" Finished: %s """ % " ".join(args), 0)
except KeyboardInterrupt:
sys.stderr.write("\nCancelled by user\n")
Expand Down
68 changes: 68 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,74 @@ omero.version=${omero.version}
<antcall target="webstart-sign" inheritAll="true" inheritRefs="true"/>
</target>

<target name="hot-blitz" depends="init">
<property name="targets" value="install"/>
<hotdeploy component="${blitz.comp}" targets="${targets}"/>
</target>

<target name="hot-common" depends="init">
<property name="targets" value="install"/>
<hotdeploy component="${common.comp}" targets="${targets}"/>
</target>

<target name="hot-model" depends="init">
<ant antfile="${dsl.comp}/build.xml" dir="${dsl.comp}" target="install" inheritAll="false"/>
<ant antfile="${model.comp}/build.xml" dir="${model.comp}" target="clean" inheritAll="false"/>
<property name="targets" value="install"/>
<hotdeploy component="${model.comp}" targets="${targets}"/>
</target>

<target name="hot-romio" depends="init">
<property name="targets" value="install"/>
<hotdeploy component="${romio.comp}" targets="${targets}"/>
</target>

<target name="hot-server" depends="init">
<property name="targets" value="install"/>
<hotdeploy component="${server.comp}" targets="${targets}"/>
</target>

<macrodef name="hotdeploy">
<attribute name="targets"/>
<attribute name="component"/>
<sequential>
<for list="@{targets}" param="target">
<sequential>
<ant antfile="@{component}/build.xml" dir="@{component}" target="@{target}" inheritAll="false"/>
</sequential>
</for>
<antcall target="copy-client" inheritRefs="true" inheritAll="true"/>
<antcall target="copy-server" inheritRefs="true" inheritAll="true"/>
<ice-admin>
<arg value="server"/>
<arg value="stop"/>
<arg value="Blitz-0"/>
</ice-admin>
<ice-admin>
<arg value="server"/>
<arg value="stop"/>
<arg value="Indexer-0"/>
</ice-admin>
<ice-admin>
<arg value="server"/>
<arg value="stop"/>
<arg value="PixelData-0"/>
</ice-admin>
</sequential>
</macrodef>

<macrodef name="ice-admin">
<element name="args" implicit="yes"/>
<sequential>
<exec executable="python" dir="${dist.dir}" failonerror="true">
<arg value="bin/omero"/>
<arg value="admin"/>
<arg value="ice"/>
<args/>
</exec>
</sequential>
</macrodef>

<macrodef name="gitdescribe">

<attribute name="regexp" default="^(v.)?(.*?)(-[0-9]+)?((-)g(.*?))?$"/>
Expand Down
1 change: 1 addition & 0 deletions components/antlib/resources/global.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<property name="common.comp" value="${components.dir}/common"/>
<property name="server.comp" value="${components.dir}/server"/>
<property name="nio.comp" value="${components.dir}/romio"/>
<property name="romio.comp" value="${components.dir}/romio"/>
<property name="render.comp" value="${components.dir}/rendering"/>
<property name="import.comp" value="${components.dir}/importer"/>
<property name="blitz.comp" value="${components.dir}/blitz"/>
Expand Down
5 changes: 5 additions & 0 deletions etc/grid/templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@
<option>-Xdebug</option>
<option>-Xrunjdwp:server=y,transport=dt_socket,address=8787,suspend=y</option>
</target>
<target name="blitz-gc">
<option>-verbose:gc</option>
<option>-XX:+PrintGCTimeStamps</option>
<option>-XX:+PrintGCDetails</option>
</target>
<target name="jprofiler">
<!-- In order to successfully startup with the "jprofiler" target,
you will need to have set DYLD_LIBRARY_PATH, LD_LIBRARY_PATH, or PATH
Expand Down

0 comments on commit 926a80d

Please sign in to comment.