Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Breaking strings into different lines in ant build.xml files

Tags:

xml

ant

build.xml

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?

like image 735
Ellen Spertus Avatar asked Aug 26 '11 16:08

Ellen Spertus


People also ask

What is Basedir in build xml?

The 'basedir' is the base directory from which any relative directories used within the Ant build file are referenced from. If this is omitted the parent directory of the build file will be used.

How do I build an Ant build xml?

Create Ant build file In the Project tool window, select the directory, where the build file should be created. Right-click the directory and from the context menu, select New | File ( Alt+Insert ). In the New File dialog, specify the name of the new file with the xml extension, for example, build. xml.

Can you write a build xml?

xml usually is an ant build script. It contains information necessary to build the project to produce the desired output, be it Javadocs, a compiled project, or a JAR file. I believe Eclipse has ant built-in, so it should be possible to execute the build. xml by choosing "Run As..." and "Ant Build".


1 Answers

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>
like image 81
JB Nizet Avatar answered Sep 20 '22 04:09

JB Nizet