Re: Adding a revision number to Info.plist

From: Chuck Hill (chil..lobal-village.net)
Date: Sun Nov 30 2008 - 02:17:50 EST


On Nov 29, 2008, at 8:33 PM, Alan Zebchuk wrote:

> Does anyone know how to ad the latest svn revision number of a
> project to the Info.plist file when building a framework or
> application?
>
> I notice that it's being done on the nightly build site for Wonder
> frameworks. Is there an easy way to do this?
>
> Thanks,
>
> Alan

There is probably a better way...

         <property name="java.properties.file" value="$
{build.product.dir}/Contents/Resources/Properties"/>

...

     <!-- Query Subversion for meta-information (e.g. revision #) -->
     <target name="query.svn" depends="setProps"
unless="eclipse.running">
         <!-- This stopped working with Subversion 1.5, possibly
because it is getting an XML response.
              The result is that all of the properties are set to zero
instead of the actual value.
              As a work-around, we will run the svnversion command
externally
            <svn>
                <wcVersion path=".." prefix="svn." />
            </svn>
         -->
         <exec dir=".."
               command="svnversion"
               outputproperty="svn.committed.max"
               errorproperty="svnversion.error">
               <arg line="-n"/>
         </exec>
     </target>

...

         <!-- This is not set in Eclipse builds to speed things up so we
              create a default value here indicating
this. -->
         <property name="svn.committed.max" value="unknown eclipse
build" />

         <!-- Add the revision number, date, and time to the
Properties file -->
         <concat destfile="${java.properties.file}" append="true">
build.version=${svn.committed.max}
build.date=${DSTAMP}
build.time=${TSTAMP}
</concat>

-- 
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects



This archive was generated by hypermail 2.0.0 : Sun Nov 30 2008 - 02:18:39 EST