文件压缩:
<apply executable="java" parallel="false" failonerror="true" dest="../../release/publish/ecshop" append="false" force="true">
<fileset dir="../../release/publish/ecshop">
</fileset>
<arg line="-jar" />
<arg path="${compressor}" />
<arg line="--charset utf8" />
<srcfile />
<arg line="-o" />
<mapper type="glob" from="*.js" to="*.js" />
<targetfile />
</apply>
SSH发
<scp todir="${username_c}:${password_c}@${host_c}://usr/rete" trust="true">
<fileset dir='../../release/${version}/test/2儿童/'>
<exclude name="${conf}" />
<exclude name="${Runtime}" />
<exclude name="${nbproject}" />
</fileset>
</scp>
通过SVN info获取SVN版本号号通过调用cmd命令行,获取SVN版本号。存放到buildRevision文件里,然后再引进buildRevision这个文件。
读取版本号号的值。
<echo level="info" message="正在获取指定文件夹的版本号号..." />
<exec dir = "${svnurl}" executable = "svn.exe" output = "buildRevision">
<arg line = "info" />
<redirector>
<outputfilterchain>
<linecontainsregexp>
<regexp pattern="^Revision:"/>
</linecontainsregexp>
<tokenfilter>
<replaceregex pattern="Revision\:\s*" flags="s" replace="Revision="/>
</tokenfilter>
</outputfilterchain>
</redirector>
</exec>
<property file="buildRevision" />
<property file="buildRevision_Inherit" />
<echo message="获取成功。版本号号是${Revision}"/>
<echo level="info" message="正在生成公布指定文件夹..." />
当中
<redirector>
<outputfilterchain>
<linecontainsregexp>
<regexp pattern="^Revision:"/>
</linecontainsregexp>
<tokenfilter>
<replaceregex pattern="Revision\:\s*" flags="s" replace="Revision="/>
</tokenfilter>
</outputfilterchain>
</redirector>
这个的意思是过滤掉SVNINFO命令行中其它。仅仅留下Revision=版本号号
然后再引进就能够了。