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 10:36 dop. CEST #

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

Posted by Geertjan on červen 01, 2005 at 11:16 dop. CEST #

Thanks, Geertjan, it works like charm.

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

Post a Comment:
Comments are closed for this entry.
About

Roman Strobl

Search

Archives
« duben 2014
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