This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ant has no robust insert capability

 
James Ellis
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From what I have found, there really is no way in Ant's core tasks to insert several lines of text into a file without placing a token for each line you are going to insert. Is this correct or can anyone provide a way to do this?
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, how else would you know *where* to insert your lines???
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Other than a marker, the only way I can think of is to keep the file in parts and use Ant's file concatenator.

Or is it appender? I forget.
[ January 05, 2005: Message edited by: Tim Holloway ]
 
James Ellis
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ilja,

It would be nice if you could insert MULTIPLE lines where this token is. Currently you can only insert one line of text per token. Unless you know otherwise...
 
James Ellis
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ilja,

Just read your earlier post (same forum). Thanks so much. I'll post the solution here for anyone else interested.

I am creating an application using tomcat and mysql. Each customer will get a copy of tomcat with the java code and MySQL with the tables including their accounts/passwords stored in the tables. For each customer we will have a different .sql file to build the database and thus we'll have different sql statements to create accounts for these users.

So...I need to insert into the .sql file some SQL statements to create the accounts for this customer. So in the build.xml file I will have something like this:





and in the install_tables.sql file where I place the token



Ant will replace with the insert statements...on MULTIPLE lines.

The


is the key.


Thank you very much,
Jim
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic