« listopad 2009
PoÚtStČtSoNe
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
      
Today

Navigation

Speaker Profile
Roumen's Weblog
Login
Sun Bloggers
Technorati Profile

Am I popular?

Today's Page Hits: 1192

Contacts

Name: Roman Strobl
E-mail: roman dot strobl
at sun dot com

NetBeans

Java Sites

Javalobby
The Server Side
Java Tips
Java Blogs
java.net
java.sun.com
java.cz

Blogs

NetBeans:
Geertjan
Brian Leonard
Gregg Sporar
Lukas Hasik
Ludovic Champenois
Vincent Brabant
Alexis Moussine-Pouchkine
Jullion-Ceccarelli
Tom Ball
Tim Boudreau
Jesse Glick
Petr Blaha
Ruth Kusterer
Jara Uhrik
xzajo
Jan Lahoda
James Branam
nbextras.org

Sun:
Kazem - bug cartoons ;-)
Tor Norbye
Romain Guy
James Gosling
Chief Gaming Officer
Bill Vass
Jim Grisanzio
Jonathan Schwartz

Planets:
Planet Netbeans
Planet Sun
Planet Eclipse

Other:
netbeans-blog.org
Joel Spolsky
Bruce Eckel

License info

Creative Commons License
This work is licensed under a Creative Commons License.

Recent Entries

Map of visits

Locations of visitors to this page
« NetBeans Quick Tip... | Main | More NetBeans Blogs... »
20050601 Středa červen 01, 2005
NetBeans Quick Tip #5 - EOL Sweeper

In the last tip I have shown you how to extend the build process. There are many possibilities how to use ant - take a look at the list of task categories in ant's manual.

Let's say I am working on Linux and I want my sources to always have Windows line endings. Why? So that BFU Windows users can view my source codes in Notepad :-) I can add a single line into the build script (e.g. into the post-compile target):

    <target name="-post-compile">
        <fixcrlf srcdir="${src.dir}" eol="crlf"/>     
    </target>

Whenever I build my project all line endings of my sources are fixed. Note that NetBeans preserves the line ending settings, so it's not necessary to do it everytime. If you don't want to do this during every build (when having too many classes) you can create your own target, which you will call on demand. It is automatically added into the context menu:

    <target name="EOL sweeper">
        <fixcrlf srcdir="src" eol="crlf"/>     
    </target>


EOL sweeper
Isn't ant wonderful?
Comments:

If you add a description attribute, your new target will not be in "Other Targets", but in the main target list (together with 'clean' and 'compile' and so on). You only have to change the first line of the target: <target name="EOL sweeper" description="bla">

Posted by Geertjan on červen 01, 2005 at 05:36 odp. CEST #

<target name="EOL sweeper" description="bla">

Posted by Geertjan on červen 01, 2005 at 06:16 odp. CEST #

Thanks, Geertjan, it works like charm.

Posted by Roman Strobl on červen 01, 2005 at 10:58 odp. CEST #

Post a Comment:

Comments are closed for this entry.


    Disclaimer: The contents of my blog represent my personal opinions which may differ from official views of my employer, Sun Microsystems.