Changeset 34 for trunk


Ignore:
Timestamp:
Oct 25, 2011, 2:02:29 PM (13 years ago)
Author:
fmguler
Message:

Removed the old net.fmg packages, added versioning to manifest.

Location:
trunk/fmgVen
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/fmgVen/build.xml

    r11 r34  
    7272 
    7373    --> 
     74     
     75    <!-- we use extra ant tasks such as propertyregex and if --> 
     76    <taskdef  classpath="etc/lib/ant-contrib-1.0b2.jar" resource="net/sf/antcontrib/antcontrib.properties"/> 
     77     
     78    <!--put version info i.e. SVN revision, date ve and Hudson build number (if exists) to the manifest. Important: svn must be in the path to get the revision info. You can test this by writing svn in the command line. --> 
     79    <target name="put-version-info">         
     80     
     81        <!-- get the BUILD_NUMBER value from environment or parameters (comes from hudson) and put it to build.number property, put -none- if it doesn't exist--> 
     82        <property environment="env" />         
     83        <if> 
     84            <isset property="env.BUILD_NUMBER" /> 
     85            <then> 
     86                <property name="build.number" value="${env.BUILD_NUMBER}" /> 
     87            </then> 
     88            <elseif> 
     89                <isset property="BUILD_NUMBER" /> 
     90                <then> 
     91                    <property name="build.number" value="${BUILD_NUMBER}" /> 
     92                </then> 
     93            </elseif> 
     94            <else> 
     95                <property name="build.number" value="-none-" /> 
     96            </else> 
     97        </if> 
     98     
     99        <!-- get the info from svn and put it to svninfoprop property --> 
     100        <exec executable="svn" outputproperty="svninfoprop"> 
     101            <arg line="info"/> 
     102        </exec> 
     103 
     104        <!-- get the revision number --> 
     105        <propertyregex property="revision.number" input="${svninfoprop}" select="\1"> 
     106            <regexp pattern="Revision: ([0-9]*)"/> 
     107        </propertyregex> 
     108        <!-- get the last commit date --> 
     109        <propertyregex property="revision.date" input="${svninfoprop}" select="\1"> 
     110            <regexp pattern="Last Changed Date: (.*)\+"/> 
     111        </propertyregex> 
     112         
     113        <!-- copy manifest.mf template to build folder --> 
     114        <copy file="etc/manifest-template.mf" tofile="build/manifest.mf" /> 
     115 
     116        <!-- write the values to build/manifest.mf --> 
     117        <replaceregexp file="build/manifest.mf" encoding="UTF-8"> 
     118            <regexp pattern="Revision:([0-9]*)"/> 
     119            <substitution expression="Revision: ${revision.number}"/> 
     120        </replaceregexp> 
     121        <replaceregexp file="build/manifest.mf" encoding="UTF-8"> 
     122            <regexp pattern="Date:(.*)"/> 
     123            <substitution expression="Date: ${revision.date}"/> 
     124        </replaceregexp> 
     125        <condition property="build.number" value="${build.number}" else="-none-"> 
     126            <isset property="build.number"/> 
     127        </condition> 
     128        <replaceregexp file="build/manifest.mf" encoding="UTF-8"> 
     129            <regexp pattern="Build:(.*)"/> 
     130            <substitution expression="Build: ${build.number}"/> 
     131        </replaceregexp> 
     132         
     133        <echo message="Revision: ${revision.number} Date: ${revision.date} Build: ${build.number}"/> 
     134    </target> 
     135     
     136    <target name="-pre-jar"> 
     137        <!-- put the version info --> 
     138        <antcall target="put-version-info"/> 
     139    </target>  
    74140</project> 
  • trunk/fmgVen/nbproject/project.properties

    r26 r34  
    5353javadoc.windowtitle= 
    5454meta.inf.dir=${src.dir}/META-INF 
     55mkdist.disabled=true 
    5556platform.active=JDK_1.4 
    5657run.classpath=\ 
     
    6970test.src.dir=test 
    7071project.license=ven-apache20 
     72manifest.available=true 
     73manifest.file=build/manifest.mf 
Note: See TracChangeset for help on using the changeset viewer.