zoukankan      html  css  js  c++  java
  • 前端部署ant+yuicompressor文件压缩+获取版本+SSH公布(部分代码)

    文件压缩:

    <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=版本号号

    然后再引进就能够了。


  • 相关阅读:
    python中的quopri模块
    使用ant来压缩js代码,这个很有用
    js 压缩工具 google closure compiler
    web中,canvas render 跟 webgl render 的区别
    越南unicode范围
    复杂度分析 数据结构
    svn bat批处理
    游戏 有限状态机参考:
    python list排序
    游戏 AOI相关
  • 原文地址:https://www.cnblogs.com/mqxnongmin/p/10791145.html
Copyright © 2011-2022 走看看