Skip to content

Commit

Permalink
see ome#1750 - Build fixes for simplifying model creation / testing
Browse files Browse the repository at this point in the history
NB: This allows the following usage of `bin/omero db script`
{{{
   FILE=`omero db script "" "" ome | perl -pe 's/^Saving to (.*?)$/$1/'`
   psql omero -f $FILE
}}}

git-svn-id: file:///home/svn/omero/trunk@6744 05709c45-44f0-0310-885b-81a1db45b4a6
  • Loading branch information
joshmoore committed Apr 29, 2010
1 parent 87d43df commit 5b90cfe
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
5 changes: 3 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,6 @@ def execute(args):
except KeyboardInterrupt:
sys.stderr.write("\nCancelled by user\n")
sys.exit(2)
except SystemExit:
notification(""" Failed: %s """ % " ".join(args), 100)
except SystemExit, se:
notification(""" Failed: %s """ % " ".join(args), 100)
sys.exit(se.code)
13 changes: 5 additions & 8 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ java component.
<iterate buildpathref="OmeroWeb.buildpath" target="tools-dist"/>
<iterate buildpathref="licenses.buildpath" target="tools-dist"/>
<iterate buildpathref="tools.buildpath" target="dist"/>
<prepareDist/>
<antcall target="build-dist" inheritRefs="true" inheritAll="true"/>
</target>

<!-- includes C++ -->
<target name="build-all" description="Build everything and copy to dist" depends="init">
<iterate buildpathref="all.buildpath" target="dist"/>
<iterate buildpathref="tools.buildpath" target="build"/>
<iterate buildpathref="tools.buildpath" target="dist"/>
<prepareDist/>
<antcall target="build-dist" inheritRefs="true" inheritAll="true"/>
</target>

<target name="build-blitz" description="Build blitz and copy to dist/blitz" depends="init">
Expand All @@ -148,7 +148,7 @@ java component.
<iterate buildpathref="OmeroPy.buildpath" target="tools-dist"/>
<iterate buildpathref="OmeroFs.buildpath" target="tools-dist"/>
<iterate buildpathref="tools.buildpath" target="dist"/>
<prepareDist/>
<antcall target="build-dist" inheritRefs="true" inheritAll="true"/>
</target>

<target name="build-importer" description="Build importer and copy to dist/lib and dist/bin" depends="init">
Expand Down Expand Up @@ -536,9 +536,7 @@ java component.
Top-level helpers (shared helpers are in components/antlib/resources)
=====================================================================
-->
<target name="_dist" depends="init"><prepareDist/></target>
<macrodef name="prepareDist">
<sequential>
<target name="build-dist" depends="init" description="Copy all components to dist/; called at the end of build-* targets">
<copy file="${omero.home}/LICENSE.txt" todir="${dist.dir}/"/>
<copy todir="${dist.dir}/etc">
<fileset dir="${omero.home}/etc">
Expand Down Expand Up @@ -587,8 +585,7 @@ omero.version=${omero.version}
</jar>
</then>
</if>
</sequential>
</macrodef>
</target>

<target name="version">
<echo>${omero.version}</echo>
Expand Down
3 changes: 2 additions & 1 deletion components/blitz/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
<delete file="${basedir}/.sconsign.dblite"/>
</target>

<target name="compile" depends="generate" unless="skip.compile">
<target name="compile" depends="generate,_compile" unless="skip.compile"/>
<target name="_compile" description="Internal develop target which doesn't run codegen">
<if>
<uptodate targetfile="${target.dir}/blitz.jar">
<srcfiles dir="${basedir}" includes="**/*.java,**/*.ice,**/*.vm"/>
Expand Down
2 changes: 1 addition & 1 deletion components/dsl/ivy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<dependency org="slf4j" name="slf4j-log4j12" rev="${versions.slf4j}" conf="runtime->default"/>
<dependency org="slf4j" name="jul-to-slf4j" rev="${versions.slf4j}" conf="runtime->default"/>
<dependency org="log4j" name="log4j" rev="${versions.log4j}" conf="runtime->default"/>
<dependency org="perf4j" name="perf4j" rev="${versions.perf4j}" conf="runtime->default"/>
<dependency org="perf4j" name="perf4j" rev="${versions.perf4j}" conf="build,runtime->default"/>
<dependency org="commons-logging" name="commons-logging" rev="${versions.commons-logging}" conf="build,runtime->default"/>
<dependency org="commons-collections" name="commons-collections" rev="${versions.commons-collections}" conf="build,runtime->default"/>
<!-- build requirements -->
Expand Down
4 changes: 3 additions & 1 deletion components/model/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@
</copy>
</target>

<target name="generate-schema" depends="generate" description="Generates SQL based on Hibernate mappings">
<target name="generate-schema" depends="generate,_generate-schema" description="Generates SQL based on Hibernate mappings">
</target>

<target name="_generate-schema" depends="generate" description="Internal developer target which doesn't run codegen">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="omero.classpath" />
<hibernatetool destdir="${target.dir}/generated/ant">
<annotationconfiguration configurationfile="${resrc.dest}/hibernate.cfg.xml" propertyfile="${resrc.dest}/local.properties">
Expand Down
8 changes: 4 additions & 4 deletions components/tools/OmeroPy/src/omero/plugins/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def _create(self, sql_directory, db_vers, db_patch, password_hash, location = No
location = path().getcwd() / script

output = open(location, 'w')
print "Saving to " + location
self.ctx.out("Saving to " + location)

try:
output.write("""
Expand Down Expand Up @@ -151,11 +151,11 @@ def script(self, *args):
if len(db_patch) == 0:
db_patch = data2.properties.getProperty("omero.db.patch")
data.properties.setProperty("omero.db.version", db_vers)
self.ctx.out("Using %s for version" % db_vers)
self.ctx.err("Using %s for version" % db_vers)
data.properties.setProperty("omero.db.patch", db_patch)
self.ctx.out("Using %s for patch" % db_patch)
self.ctx.err("Using %s for patch" % db_patch)
root_pass = args.args[2]
self.ctx.out("Using password from commandline")
self.ctx.err("Using password from commandline")
except Exception, e:
self.ctx.dbg("While getting arguments:"+str(e))
self._lookup(data, data2, "version", map)
Expand Down

0 comments on commit 5b90cfe

Please sign in to comment.