This is what I do...

        <exec dir=".."
                  executable="svnversion"
              outputproperty="svn.committed.max"
              errorproperty="svnversion.error">
              <arg line="-n"/>
        </exec>

Then later...


       </woapplication>
        
        <chmod 
file="${dest.dir}${file.separator}${build.app.name}.woa${file.separator}${build.app.name}"
 perm="755"/>

        <!-- 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>
    </target>

On Jul 12, 2011, at 10:50 AM, Andrew Kinnie wrote:

> I am trying to add an svn commit number to the front page of my basically 
> headless push app.  However, I am apparently doing something stupid and 
> missing something obvious.
> 
> I added this to the top of the build.xml script for the app (after the 
> project tag):
> 
>       <!-- Write current build and revision #s into Properties file. -->
>       <target name="updateBuildNumber">
> 
>       <exec executable="svnversion" dir="" outputproperty="svn.revision" />
>       <echo>Revision: ${svn.revision}</echo>
>       <replaceregexp file="Resources/Properties"
>               match="RevisionNumber=(.*)"
>               replace="RevisionNumber=${svn.revision}" />
>               <property environment="env" />
>               <echo>Build Number: ${env.BUILD_NUMBER}</echo>
>               <replaceregexp file="Resources/Properties"
>               match="BuildNumber=(.*)"
>               replace="BuildNumber=${env.BUILD_NUMBER}" />
>       </target>
> 
> I added this to my Properties file for the app (At the top):
> 
> RevisionNumber=x
> BuildNumber=x
> 
> However, the script is not substituting, and I am not getting anything other 
> than "x" with the following code in my Main.java class
> 
>       public String revisionNumber = 
> ERXProperties.stringForKey("RevisionNumber");
>       public String buildNumber = ERXProperties.stringForKey("BuildNumber");
> 
>       public String revisionNumber(){
>               System.out.println("buildNumber is " + buildNumber + " and 
> revisionNumber is " + revisionNumber);
>               return revisionNumber;
>       }
> 
> What blindingly obvious thing am I missing?
> 
> Andrew
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net
> 
> This email sent to [email protected]

-- 
Chuck Hill             Senior Consultant / VP Development

Come to WOWODC this July for unparalleled WO learning opportunities and real 
peer to peer problem solving!  Network, socialize, and enjoy a great 
cosmopolitan city.  See you there!  http://www.wocommunity.org/wowodc11/

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to