ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nolan Ring" <nr...@nortelnetworks.com>
Subject include/exclude question
Date Thu, 14 Jun 2001 20:06:31 GMT

I'm sure this has been covered elsewhere -- but I couldn't find it .

I want to compile the vast majority of the .java files under ${srcdir} --
there are a total of 500+ files in a directory hierarchy that
is 3 or 4 directories deep and includes roughly 20 subdirectories.

In at least one case, however, I want to compile only a single file in one
of the subdirectories, despite the fact that the subdirectory
itself includes many files and directories.

The only way I've figured to do this so far is to to define a separate javac
task that includes the individual file I want build; and then to
define another javac task that excludes the entire directory.  I'm sure
there's a better way to do this!

Can someone help me out??

Thanks much.

Nolan

Snippet of build.xml file:

<target name="gprs" depends="voip" >
   <javac srcdir="${SAsrc}/gprs/src/Java"
          destdir="${SAoutput}/gprs/Java"
          deprecation="off"
          failonerror="false">
          <include name="**/asn1/gsm32005v310/Gsm32005v310.java" />
   </javac>

   <javac srcdir="${SAsrc}/gprs/src/Java"
          destdir="${SAoutput}/gprs/Java"
          deprecation="off"
          failonerror="false">
      <exclude name="**/*archive*/**/*"/>
      <exclude name="**/*test*/*"/>
      <exclude name="**/*Test*/*"/>
      <exclude name="**/gsm3gpp_JNI/**"/>
      <exclude name="**/oi/ggsn_asn1/**/*"/>
      <exclude name="**/asn1/gsm32005v310/**/" />
      <include name="**/*.java" />
   </javac>
</target>

Mime
View raw message