开发者

ANT returning properties from an externally called build

I'm currently trying to refactor a couple of our ANT scripts and what I'd like to do is try and centralise some of the common targets they use into some kind of shared area.

The target I'm trying to work on just now is configuration. Both our scripts currently have the same code which loads in external properties and sets up our classes.

What I've tried to do is move this target into another build script called configuration.xml and call this through <ant antfile="configuration.xml"> fr开发者_开发技巧om each script.

What's happening though is the target is running but I can't work out how I can get the values being set to return to the parent build script. Is there anyway I can do that?

Another approach I thought of was to create some kind of "base" script that the other two could inherit from. I don't think that's ideal in the long term but it's an option I thought I could try. Again though I can't find anything online to say ANT can do this.


Depends on what version of Ant you're using as to what methods you have available, but there is the <import file="your-include.xml"/> option.

Here's an example of some imports, if it helps.

http://subversion.assembla.com/svn/cfdistro/trunk/cfdistro/src/cfdistro/scm.xml

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜