You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Alexis Votta <al...@gmail.com> on 2007/10/05 15:20:02 UTC

How to include multiple source directories in "compile" target

I have a compile target like the following.

  <property file="build.properties"/>

  <target name="compile">
    <mkdir dir="${build.classes.dir}"/>
    <javac srcdir="${src.dir}" destdir="${build.classes.dir}"
    source="${java.source}" target="{javac.target}">
      <compilerarg line="${javac.compilerargs}"/>
    </javac>
  </target>

In 'build.properties' file, src.dir is defined to be:-

src.dir = src/java

The problem with this will include all sources under src/java. I want
to do something like this:-

Compile all sources in (1) "src/java/com/company/deals" (2)
"src/java/com/company/transact/"

There are many other folders under "src/java/com/company" which I do
not want to compile for this target. So, please suggest how this can
be done. Any help would be highly appreciated.

- Alexis

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: How to include multiple source directories in "compile" target

Posted by Bourzeix, Hervé <He...@Genesys.com>.
Here is copy paste from my build file;

 

                  <javac verbose="${build.verbose}" destdir="${build.dir}" source="${_build.source.version}" target="${_build.target.version}" debug="${build.javac.debugmode}" debuglevel="${build.javac.debuglevel}" optimize="${build.javac.optimize}" compiler="${build.javac.compiler}" deprecation="${build.javac.deprecation}" listfiles="${build.verbose}" nowarn="true">

                        <classpath refid="build.classpath" />

                        <src path="${src.dir}" />

                        <src path="${test.dir}" />

                        <include name="**/*.java" />

                  </javac>

 

From: Sumit.Srivastava@ubs.com [mailto:Sumit.Srivastava@ubs.com] 
Sent: Friday, October 05, 2007 3:34 PM
To: user@ant.apache.org
Subject: RE: How to include multiple source directories in "compile" target

 

Hi, 
Define two more properties like  

src.java.company.transact = src/java/com/company/transact/ 
src.java.company.deals = src/java/com/company/deals 

And include in the target as 

   <javac srcdir="${src.dir}; 
                ${src.java.company.transact}; 
                ${src.java.company.deals};" 
         destdir="${build.classes.dir}" 
    source="${java.source}" target="{javac.target}"> 
      <compilerarg line="${javac.compilerargs}"/> 





Warm Regards, 
Sumit Srivastava 
Voice : (203) 719 - 5894 
Email :Sumit.Srivastava@ubs.com 
Chat  :srivassb 

To go far, explore first what is near.. 

-----Original Message----- 
From: Alexis Votta [mailto:alexisvotta@gmail.com <ma...@gmail.com> ] 
Sent: Friday, October 05, 2007 9:20 AM 
To: user@ant.apache.org 
Subject: How to include multiple source directories in "compile" target 

I have a compile target like the following. 

  <property file="build.properties"/> 

  <target name="compile"> 
    <mkdir dir="${build.classes.dir}"/> 
    <javac srcdir="${src.dir}" destdir="${build.classes.dir}" 
    source="${java.source}" target="{javac.target}"> 
      <compilerarg line="${javac.compilerargs}"/> 
    </javac> 
  </target> 

In 'build.properties' file, src.dir is defined to be:- 

src.dir = src/java 

The problem with this will include all sources under src/java. I want to do something like this:- 

Compile all sources in (1) "src/java/com/company/deals" (2) "src/java/com/company/transact/" 

There are many other folders under "src/java/com/company" which I do not want to compile for this target. So, please suggest how this can be done. Any help would be highly appreciated.

- Alexis 

--------------------------------------------------------------------- 
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org 


RE: How to include multiple source directories in "compile" target

Posted by Su...@ubs.com.
Hi,
Define two more properties like  

src.java.company.transact = src/java/com/company/transact/
src.java.company.deals = src/java/com/company/deals

And include in the target as 

   <javac srcdir="${src.dir};
		${src.java.company.transact};
		${src.java.company.deals};"
	 destdir="${build.classes.dir}"
    source="${java.source}" target="{javac.target}">
      <compilerarg line="${javac.compilerargs}"/>




Warm Regards,
Sumit Srivastava
Voice : (203) 719 - 5894
Email :Sumit.Srivastava@ubs.com
Chat  :srivassb

To go far, explore first what is near..

-----Original Message-----
From: Alexis Votta [mailto:alexisvotta@gmail.com] 
Sent: Friday, October 05, 2007 9:20 AM
To: user@ant.apache.org
Subject: How to include multiple source directories in "compile" target

I have a compile target like the following.

  <property file="build.properties"/>

  <target name="compile">
    <mkdir dir="${build.classes.dir}"/>
    <javac srcdir="${src.dir}" destdir="${build.classes.dir}"
    source="${java.source}" target="{javac.target}">
      <compilerarg line="${javac.compilerargs}"/>
    </javac>
  </target>

In 'build.properties' file, src.dir is defined to be:-

src.dir = src/java

The problem with this will include all sources under src/java. I want to
do something like this:-

Compile all sources in (1) "src/java/com/company/deals" (2)
"src/java/com/company/transact/"

There are many other folders under "src/java/com/company" which I do not
want to compile for this target. So, please suggest how this can be
done. Any help would be highly appreciated.

- Alexis

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional
commands, e-mail: user-help@ant.apache.org