IntelliJ Java IDE
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant - compile task and source directory setup Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "Ant - compile task and source directory setup" Watch "Ant - compile task and source directory setup" New topic
Author

Ant - compile task and source directory setup

Bruce Nguyen
Greenhorn

Joined: Apr 28, 2004
Posts: 2
Hi All,
I am creating my project directory structure. So here it is:
myproject
-src
- com
- packagename
- ClassName.java

And here is my build.xml:

<project basedir="." default="all" name="myproject">

<target name="init">
<property location="classes" name="classes.dir"/>
<property location="src" name="src.dir"/>
</target>

<target depends="init" name="compile">
<mkdir dir="${classes.dir}"/>
<javac debug="true" deprecation="true" destdir="${classes.dir}" srcdir="${src.dir}">
</javac>
</target>

<target depends="init" name="clean">
<delete dir="${classes.dir}"/>
</target>

<target depends="init, compile" name="all"/>

</project>

What happened after I ran the compile task was that Ant created the classes structure as follow:

myproject
-classes
-src
- com
- packagename
- ClassName.class

I don't understand why the src directory was created under the classes directory?
It would be appreciated if someone could provide me the explanation of the above problem.
Thanks,
Bruce
 
IntelliJ Java IDE
 
subject: Ant - compile task and source directory setup
 
Threads others viewed
Build problem when including third party jars in classpath using ant
Warning Message When I Ran My ANT build.xml File
ant classpath problem
Class files generated in web-inf directory as well as in base directory
What's this?
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture