开发者

Is this possible using ant?

I have a requirement where in i have to create a file, which will contain the source directory name, target directory name where it would be deployed, and list of file (.jars) that i need to deploy.

I was thinking of having a properties file where i would specify multiple lines of following type

[Src dirctory name] [destination directory]

Then i would read each line from above file and list all the files in [src directory name] and would like to have following in my final properties file.

appversion @appversion@ (value would com using ant filter开发者_如何学Pythons)

[some static stuff]

SrcDir [absolute path of Src directory1]  
DestDir [destination directory as is]  
file 555 [file1.jar]  
file 555 [file2.jar]  
SrcDir [absolute path of Src directory2]  
DestDir [destination directory as is]  
file 555 [file1.jar]  
file 555 [file2.jar]  
.  
.  
.  
SrcDir [absolute path of Src directory n]  
DestDir [destination directory as is]  
file 555 [file1.jar]  
file 555 [file2.jar]  

Can i do something like

appversion @appversion@ (value would com using ant filters)

[some static stuff]

@finallist@

where final list would be generated as above? or is there a better way of doing the same. I know we can do it using script but just wanted to know if we can do it easily using ant?

Can you please help me? I was thinking of using ant filters but an not able to create the structure of above type. Can you please help me?

Thanks, Almas


You could achieve this by using a series of the echo task to append text to the end of the file.

<echo message="${text.to.append}" file="${prop.file}" append="true"/>

or

<echo file="${prop.file}" append="true">
multiple lines of text to append to file here
....
</echo>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜