Industrial
Industrial

Reputation: 42758

Concat files in Apache ANT to variable?

I know that I can use ANT's concat to merge several files into one file. But what about merging files into a variable?

Can this be done?

Upvotes: 0

Views: 892

Answers (1)

matt
matt

Reputation: 79723

concat can be used as a resource collection, so you can use it in a loadresource:

<loadresource property="the.property">
  <concat>
    <file file="foo.txt" />
    <file file="another_file.txt />
    <string>You can put any resource in here, not just files!</string>
  </concat>
</loadresource>

Now the the.property property will contain the concatenation of all the resources inside the concat. (I'm assuming you mean an ant property when you say variable.)

Upvotes: 4

Related Questions