Breaking strings into different lines in ant build.xml files
Asked Answered
P

1

6

I'd like to know how to shorten lines containing long string literals in my ant build.xml file. For example:

<target name="foo"
        description="I sure do have a lot to say.  Blah Blah.  This is getting awfully wide, etc."
        depends="A,B,C,D,E,F,G,H,I,...,ZZ">
  ...
</target>

Obviously, I could shorten the depends attribute value by creating a tree of dependencies, but that wouldn't work in other cases, such as the description. What's the right way to handle this?

Pravit answered 26/8, 2011 at 16:31 Comment(0)
T
8

Insert a newline:

<target name="foo"
        description="I sure do have a lot to say.  Blah Blah.  
                     This is getting awfully wide, etc."
        depends="A,B,C,D,E,F,
                 G,H,I,...,ZZ">
  ...
</target>
Trygve answered 26/8, 2011 at 16:35 Comment(2)
D'oh! Follow up question: What if it is a long string without white space?Pravit
JB, my concern isn't how it's displayed in my editor but for a line length limit in our code base. Thanks for all of your help.Pravit

© 2022 - 2024 — McMap. All rights reserved.