camel-man
camel-man

Reputation: 327

Where should the fileset property be placed within the ant build file?

Here is an example of my beginning build file, I do not know where to put the fileset property. Right now I have a build.properties file that defines src as my directory with the current src. Ex(src= C:\workspace\project\src)

My fileset is defined like so

<?xml version="1.0" encoding="UTF-8"?>
<project name="Hello World Project" default="info">


   <fileset dir="${src}" 
    <include name="**/*.java"/>
   </fileset>

 <target name="info">
  <echo>packaging the .java files...</echo>
</target>

</project>

I don't really understand where the .java files are supposed to be put. this is only for my understanding and a demo. can I include them in a random folder?? Is the fileset located in the proper placement or should it be inside the target task?

Thanks

Upvotes: 0

Views: 952

Answers (1)

Mark O&#39;Connor
Mark O&#39;Connor

Reputation: 77961

When running your build file the following error is thrown.

$ ant -p
Buildfile: build.xml
build.xml:6: Element type "fileset" must be followed by either attribute specifications, ">" or "/>".

This not related to the placement of the fileset tag, but rather a message telling you your xml is not well formed.

Fix the XML as follows:

   <fileset dir="${src}">
    <include name="**/*.java"/>
   </fileset>

Note the missing ">" character.

Upvotes: 1

Related Questions