[Laszlo-dev] Build version into canvas?

Benjamin Shine ben at laszlosystems.com
Sat Jun 24 15:28:18 EDT 2006


On Jun 24, 2006, at 11:03 AM, P T Withington wrote:

> That sounds like exactly what I want.  How can I get that value  
> into build.id from ant?  Is there an ant task that will run shell  
> commands?

I was doing this in the nightly build's build.xml for a while, but I  
switched to doing it in bash because I needed to be able to dictate  
the rev number from a script, not just use whatever the HEAD is. But  
something like this will do what you want. You will need subversion  
1.3.1 -- that is the first client which supports svn info --xml.  
Also, it would be a good idea to remove the repository.xml file after  
you get what you need from it.

     <target name="get-rev-number" unless="done.get-rev-number">
         <sequential>
             <!-- Get the current repository information -->
             <exec executable="svn" output="repository-info.xml">
                 <arg value="info" />
                 <arg value="--xml" />
                 <arg value="http://svn.openlaszlo.org/$ 
{build.project}/${build.branch}" />
             </exec>
             <property name="done.get-rev-number" value="true" />
         </sequential>
     </target>

     <target name="setup-names" depends="get-rev-number"  
unless="done.setup-names">
         <!-- Load repository information into properties -->
         <xmlproperty file="repository-info.xml"/>
         <property name="revision" value="${info.entry(revision)}" />
         <property name="build.name"
             value="build-${info.entry(path)}-${revision}" />
         <property name="path.tag"
             value="http://svn.openlaszlo.org/${build.project}/builds/ 
${build.name}"    />

         <!-- print a lot of diagnostic information -->
         <echo message="revision is ${revision}" />
         <echo message="build.name is ${build.name}" />
         <echo message="path.tag is ${path.tag}" />

         <property name="done.setup-names" value="true" />
     </target>


>
> I like your metadata idea.  I suppose what you really want to know  
> is if there are un-checked-in changes in the tree, but that would  
> be too slow in svn.

I think checking for local changes doesn't require network access. It  
*shouldn't* at least. Aha:
"With no args, print only locally modified items (no network access)."
So the slowness comes from our gigantor tree. It could be fast if you  
list the top-level directories you actually care about...

svn status lps WEB-INF| sed -e /.lzl$/d -e/.class$/d > localchanges.txt

then do something creative with localchanges.txt to make it visible  
in the canvas...
I'm liking this. Go Tucker!


benjamin shine
software engineer
ben at laszlosystems.com





More information about the Laszlo-dev mailing list