ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Ellsworth <sc...@alodar.com>
Subject Why does this not created a munged file as requested?
Date Fri, 13 Sep 2002 01:07:00 GMT
I am trying to turn an Apple/Next property list into one with a certain  
tag replaced and eol's turned to unix.  These may be several levels  
deep, so I want to do a regex replace rather than something that tries  
to parse the properties.

I start with a file that looks like this:

{\r
{\r
stuff\r
stuff\n
stuff\r\n
       _generate = "";\r\n
stuff\r\n
}\r
{\r
       _xenerate = "";\r
       _generate = "true";\n
       _generate = "false";\r
stuff\n
stuff\n
}\r
}\r

and I want one that looks like:

{\r
{\r
stuff\r
stuff\r
stuff\r
       _generate = "";\r
stuff\r
       _generate = "";\r
}\r
{\r
       _generate = "true";\r
       _generate = "true";\r
stuff\r
stuff\r
}\r
}\r

(In other words, copy the file and turn all of the _xenerate keys into  
_generate keys, turn all of the _generate = false key-value pairs into  
_generate = true key-value pairs, and make the line endings unix.)

It seems to me that the following code _should_ do it:

     <copy file="${plist.source}" tofile="${plist.source.generated}">
       <filterset begintoken="" endtoken="">
         <filter token="\"_xenerate\"" value="\"_generate\""/>
         <filter token="\"_generate\" = \"false\";" value="\"_generate\"  
= \"true\";"/>
       </filterset>
     </copy>
     <fixcrlf srcdir="${project.work.dir}" eol="cr"  
includes="${plist.generated}" />

but instead, it complains that

file:/Users/work/Documents/coding/isis/source/genetrove/persistence/ 
cluster_genetrove/build-intercalate.xml:29: Element type "filter" must  
be followed by either attribute specifications, ">" or "/>".
         at  
org.apache.tools.ant.helper.ProjectHelperImpl.parse(ProjectHelperImpl.ja 
va:170)
         at  
org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:1 
17)
         at org.apache.tools.ant.Main.runBuild(Main.java:597)
         at org.apache.tools.ant.Main.start(Main.java:196)
         at org.apache.tools.ant.Main.main(Main.java:235)

So, what is the best way to do this?

Scott


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message