Changeset 7796


Ignore:
Timestamp:
Apr 9, 2020, 8:52:58 AM (22 months ago)
Author:
Nicklas Nordborg
Message:

References #2205: Update ant task that uses svn commands

Replaces SvnAnt with SvnKit.

The svn.revision and package.src targets in build.xml has been updated to issue svn commands via SvnKit instead of the custom actions that SvnAnt used to define.

The svn.diff and svn.update actions have been removed. If it turns out that they are needed it should not be difficult to add them again.

Location:
branches/3.16-stable
Files:
29 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.16-stable/.classpath

    r7750 r7796  
    1515  <classpathentry kind="lib" path="lib/dist/tar.jar"/>
    1616  <classpathentry kind="lib" path="lib/dist/commons-io-1.4.jar"/>
    17   <classpathentry kind="lib" path="lib/svn/svnant-1.4dev.jar"/>
    1817  <classpathentry kind="lib" path="lib/dist/jdom-2.0.6.jar"/>
    1918  <classpathentry kind="lib" path="lib/dist/jcommon-1.0.23.jar"/>
  • branches/3.16-stable/build.xml

    r7793 r7796  
    103103  </path>
    104104 
    105   <path id="lib.svn.classpath">
    106     <fileset dir="${lib}/svn">
     105  <path id="lib.svnkit.classpath">
     106    <fileset dir="${lib}/svnkit">
    107107      <include name="**/*.jar"/>
    108108    </fileset>
     
    138138    </classpath>
    139139  </taskdef>
    140  
    141   <typedef
    142     resource="org/tigris/subversion/svnant/svnantlib.xml"
    143     classpathref="lib.svn.classpath"
    144   />
    145140 
    146141  <!-- main targets -->
     
    323318      value into the base.build property; replaced by constant expression in source distributions"
    324319    >
    325     <svn>
    326       <status path="." lastChangedRevisionProperty="base.build" />
    327     </svn>
     320    <java
     321      classname="org.tmatesoft.svn.cli.SVN"
     322      classpathref="lib.svnkit.classpath"
     323      outputproperty="svn.info.out"
     324      >
     325      <arg value="info" />
     326      <arg value="." />
     327    </java>
     328    <loadresource property="base.build"
     329      description="Scan output from 'svn info' and keep only the line with 'Last Changed Rev:'"
     330      >
     331      <concat>${svn.info.out}</concat>
     332      <filterchain>
     333        <linecontains><contains value="Last Changed Rev" /></linecontains>
     334        <replaceregex pattern=".*?(\d+)" replace="\1" />
     335        <striplinebreaks/>
     336      </filterchain>
     337    </loadresource>
    328338    <echo message="Build #${base.build}" />
    329339  </target>
     
    12501260    <property name="tempdir" location="base-${base.version}${base.versionsuffix}-src" />
    12511261    <delete dir="${tempdir}" failonerror="false"/>
    1252     <svn>
    1253       <export srcPath="." destPath="${tempdir}" />
    1254     </svn>
     1262    <java
     1263      classname="org.tmatesoft.svn.cli.SVN"
     1264      classpathref="lib.svnkit.classpath"
     1265      >
     1266      <arg value="export" />
     1267      <arg value="-q" />  <!--quiet: or we get a list of all files that are copied -->
     1268      <arg value="." />
     1269      <arg path="${tempdir}" />
     1270    </java>
     1271   
    12551272    <replaceregexp
     1273      description="replacs the 'java' call in svn.revision with a static property"
    12561274      file="${tempdir}/build.xml"
    1257       match="&lt;svn&gt;.*&lt;status.*?&lt;/svn&gt;"
     1275      match="&lt;java.*org.tmatesoft.svn.cli.SVN.*?&lt;/loadresource&gt;"
    12581276      replace="&lt;property name=&#34;base.build&#34; value=&#34;${base.build}&#34; /&gt;"
    12591277      flags="s"
     
    12981316    <delete dir="${tempdir}" />
    12991317  </target>
    1300    
    1301   <target
    1302     name="svn.update"
    1303     description="Issues an 'svn update' command to check out the latest revision from subversion"
    1304     >
    1305     <svn>
    1306       <update dir="." />
    1307     </svn>
    1308   </target>
    1309  
    1310   <target
    1311     name="svn.diff"
    1312     depends="svn.revision"
    1313     description="Issues an 'svn diff' command to generate a patch with local changes"
    1314     >
    1315     <echo>NOTE! New files must be added to svn with 'svn add' or they will not be added to the patch.</echo>
    1316     <property name="patchfile" value="patch-${base.build}.diff" />
    1317     <pathconvert property="patchdir" dirsep="/" >
    1318       <path location="." />
    1319     </pathconvert>
    1320     <svn>
    1321       <diff oldpath="." outfile="${patchfile}"/>
    1322     </svn>
    1323     <replaceregexp file="${patchfile}" match="${patchdir}/" replace="" flags="g" />
    1324     <echo>Generated patch file: ${patchfile}</echo>
    1325   </target>
    1326    
     1318
    13271319</project>
Note: See TracChangeset for help on using the changeset viewer.