JAVA_build_ant_mapper
ant里面mapper的详细用法
ant里面mapper标签是和fileset配合使用的,目的就是把fileset取出的文件名转成指定的样式。其实看懂官方文档后,感觉真心没啥好写的。但是还是写一下把。
1.<mapper type="identity"/>
就是啥都不干。fileset是啥样子,返回就是啥样子。
2.<mapper type="flatten"/>
大概意思是只返回文件名,而去掉路径,比如
D:\and\adt-bundle-windows-x86\sdk\tools\adb_has_moved.txt 这样输出就是 adb_has_moved.txt
3.<mapper type="glob" from="*.java" to="~*.java.bak"/>
大概的意思就是加前缀和后缀
D:\and\adt-bundle-windows-x86\sdk\tools\adb_has_moved.java 这样输出就是 ~D:\and\adt-bundle-windows-x86\sdk\tools\adb_has_moved.java.bak
4.<chainedmapper>
这个标签非常贱,看名字就知道,意思是把多个不同的mapper标签联合起来执行,以达到更全的处理方案。

<mapper>
<chainedmapper>
<flattenmapper/>
<globmapper from="a*.java" to="*.java.bak" casesensitive="no"/>
</chainedmapper>
</mapper>

假设输入为D:\and\adt-bundle-windows-x86\sdk\tools\adb_has_moved.java,这个时候输出为adb_has_moved.java.bak
注意若是这个里面不写chainedmapper的话,返回的结果包含mapper里面所有的mapper返回结果的和。
因为这个里面把flatten和glob两个标签联合起来用了。
5. <mapper type="regexp" from="^(.*)\.java$$" to="\1.java.bak"/>
这个就是正则表达式了。正则表达式仅仅会抓去出相匹配的字符串,而没有替换功能,注意。
6.<mapper type="package" from="*Test.java" to="*"/>
D:\and\adt-bundle-windows-x86\sdk\tools\adb_has_moved.java > D.and.adt-bundle-windows-x86.sdk.tools.adb_has_moved
7<cutdirsmapper dirs="5"/>
这个的作用就是把文件目录去掉一部分
D:\and\adt-bundle-windows-x86\sdk\tools\adb_has_moved.java > \adb_has_moved.java
原文转自:http://www.cnblogs.com/100fighting/p/3171131.html
JAVA_build_ant_mapper的更多相关文章
随机推荐
- the smallest positive number
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any rema ...
- 【转】Linux 中断学习之小试牛刀篇
原文网址:http://www.linuxidc.com/Linux/2011-02/32129.htm 前言 在前面分析了中断的基本原理后,就可以写一个内核中断程序来体验以下,也可以借此程序继续深入 ...
- Solr4.4.0部署到tomcat上
主要步骤如下: 1.下载solr-4.4.0.tgz 2.解压缩solr-4.4.0.tgz,命令tar -xzvf solr-4.4.0.tgz 3.压缩后进入到solr-4.4.0目录,将 exa ...
- wpf在异步中给前台赋值
wpf,新建异步方法: Thread newThread = new Thread(new ParameterizedThreadStart(GetResult)); newThread.Start( ...
- cURL中的超时设置
访问HTTP方式很多,可以使用curl, socket, file_get_contents() 等方法. 在访问http时,需要考虑超时的问题. CURL访问HTTP: CURL 是常用的访问HTT ...
- [深入React] 3.JSX的神秘面纱
<div> <List /> </div> 会被编译为: React.createElement("div",null, React.creat ...
- [RxJS] Refactoring CombineLatest to WithLatestFrom
This lesson shows why it’s preferable to using withLatestFrom instead of combineLatest in certain sc ...
- Excel02-快速无误输入多个零
第一步:设置单元格格式-->小数位数为0,货币符号为¥ 第二步:在单元格输入数据:1**5回车即显示为¥100,000 **N 表示后面有N个零,会自动加入我们设置的货币符号¥ 这对我们在输入巨 ...
- mysql 数据库 备份 还原
参考资料: http://blog.51yip.com/mysql/139.html
- Ngnix安装
一.pcre安装 yum install pcre 或 https://sourceforge.net/projects/pcre/files/pcre/8.37/ 手动下载后上传至linux 1.y ...