风动还是旗动?仁者心动。 文字只不过是指月的手指,而不是月亮本身,能透过指月的手指看到月亮本身才是文字的目的所在。

ant学习-The Prefix Attribute

上一篇 / 下一篇  2007-01-31 10:24:56 / 个人分类:ant学习

51Testing软件测试网__#Fm7N4NWO

The Prefix Attribute
3Mh`mr:P0The Problem: I have to access some properties (from a file), which are already defined in my build file. To be able to access the properties I can use the prefix attribute of the property task.

6q/T]Q N9?%c8u0

.I}3M/ba3]s gC0framework.properties :51Testing软件测试网.p/Y/J+s}S |C

\9{m3l$I*oDg]k0#Release information about the framework
-Zx6Xi/Is/n0#Thu Oct 14 16:25:12 CEST 2004
3jb Y4Yc0build.number=11551Testing软件测试网 t @3~ja/_
release.version=0.4
R8\{ b0G7u2yzS0release.name=framework51Testing软件测试网/A{/Yz9s&o:e$?

51Testing软件测试网 O|,Q;d sP

51Testing软件测试网FDS@6GEk
Ant Example Target :51Testing软件测试网,F cunY$C@ iF

51Testing软件测试网8H$hvY/^ ?/E

<target name="read.properties">   
Z-b([.Ab6P0  <!-- Read the properties from the release of the framework -->51Testing软件测试网G#}9D I_"I
  <property file="framework.properties" prefix="framework"/>
'b&[!e X/u2X8Za0  <echo message="${framework.build.number}"/>
niN.c0N/KuU1o VP1^0  <echo message="${framework.release.version}"/>
7x GjWumrI0  <echo message="${framework.release.name}"/>   
)` j9QW Y0</target>   51Testing软件测试网k"]Z^aK0c7c

I!O B5TrMXeM0

2we?'Xn'j3@y0Output:

+?l*aVL V_ d0

(c}ESf[9t-D0Buildfile: C:\build.xml51Testing软件测试网^3HT]E4@!c*`
read.properties:51Testing软件测试网'^p5Z(g,\U&s
  [echo] 11551Testing软件测试网ikq-Caz%Y,mgX
  [echo] 0.4
)KI)SF3Q0  [echo] framework
.K`-Yt*d,u(R]N0BUILD SUCCESSFUL51Testing软件测试网Oi8[KmPB
Total time: 3 seconds
Y$\ K2F8TC0

:a qK@.~u M[0

TAG: ant学习

 

评分:0

我来说两句

日历

« 2024-03-28  
     12
3456789
10111213141516
17181920212223
24252627282930
31      

数据统计

  • 访问量: 25412
  • 日志数: 36
  • 建立时间: 2006-12-19
  • 更新时间: 2007-07-09

RSS订阅

Open Toolbar