Hi Mikael,

You are right, list of source files must be entered as nested elemets:

  <target name="compile">
    <javac sourcepath="" srcdir="." destdir="${build}"
      encoding="UTF-8"
      source="1.5" target="1.5" compiler="modern"
      debug="true" debuglevel="lines,source">
        <include name="${src.dir}/a/**/*.java" />
        <include name="${src.dir}/a2/**/*.java" />
        <exclude name="${src.dir}/b/**/*.java" />
    </javac>
  </target>

or as path elements:

  <path id="src.filter.ref">
    <pathelement path="${src.dir}/a" />
    <pathelement path="${src.dir}/a2" />
  </path>

  <target name="compile">
    <property name="src.filter.ref" refid="src.filter.ref"/>
    <javac srcdir="${src.filter.ref}" destdir="${build}"
      encoding="UTF-8"
      source="1.5" target="1.5" compiler="modern"
      debug="true" debuglevel="lines,source">
    </javac>
  </target>

Note the property command.

I could not figure out how to do the same thing with file sets.

Regards,
Ognjen


Mikael Petterson wrote:
Hi,

It is not filtering out the files that I don't want included in my
compile.
Any more ideas out there?

Br,

//mike
-----Original Message-----
From: Ognjen Blagojevic [mailto:[email protected]] Sent: den 25 augusti 2009 15:57
To: Ant Users List
Subject: Re: Best way to use fileset in javac

Mikael Petterson wrote:
Where do I add this to my javac target to make sure that no other files in my src tree is compiled.

Try to add it to "sourcepathref" parameter of the javac task.

Regards,
Ognjen

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected] For additional
commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to