ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ross Lloyd" <RLl...@novell.com>
Subject Hi,
Date Thu, 08 Feb 2001 16:03:59 GMT
Hi,

Is there any way I can create patternsets and then use them to create exclusion lists for
javac compilations.

ie
I have a source tree and two components of a project which I may need to rebuild independently.
 There are common components which points at creating a common.jar and then compiling the
other files for each project. e.g.

<patternset id="CommonFiles">
   <include name="com/cia/Auth/utils/*.java"/>
   <include name="com/nov/ncse/*.java"/>					
   <include name="com/nov/ncse/Access/*.java"/>						
</patternset>

<patternset id="UIDFiles">
   <include name="com/cia/UID/*.java"/>
</patternset>
	
<patternset id="AuthFiles">
   <include name="**"/>  <!-- Include everything in ${src} ―>
   <exclude patternset refid="UIDFiles"/> 
   <exclude patternset refid="Common"/>
</patternset>

and then for the Auth project
<!-- Auth Build -->
<target name="Auth.compile" depends="prepare.build.Auth">
   <!-- Compile the java code from ${src} into ${build} -->
   <javac srcdir="${src}" destdir="${build.Auth}"  verbose="on">
      <patternset refid="AuthFiles"/> 
      <classpath>
         <pathelement location="${dist}/CIA.jar"/>
         <pathelement path="${classpath}"/>
         <fileset dir="jars">
            <include name="**/*.jar"/>
         </fileset>
      </classpath>
   </javac>
</target>


The existing code is :-

<patternset id="CommonFiles">
   <include name="com/cia/Auth/utils/*.java"/>
   <include name="com/nov/ncse/*.java"/>						
   <include name="com/nov/ncse/Access/*.java"/>						
</patternset>

<patternset id="UIDFiles">
   <include name="com/cia/UID/*.java"/>
</patternset>
	
<patternset id="AuthFiles">
   <include name="**"/>
   <exclude name="com/cia/Auth/utils/*.java"/>                            
   <exclude name="com/nov/ncse/*.java"/>						
   <exclude name="com/nov/ncse/Access/*.java"/>						
   <exclude name="com/cia/UID/*.java"/> 
</patternset>
	
<!-- Auth Build -->
<target name="Auth.compile" depends="prepare.build.Auth">
   <!-- Compile the java code from ${src} into ${build} -->
   <javac srcdir="${src}" destdir="${build.Auth}"  verbose="on">
      <patternset refid="AuthFiles"/> 
      <classpath>
         <pathelement location="${dist}/CIA.jar"/>
         <pathelement path="${classpath}"/>
         <fileset dir="jars">
            <include name="**/*.jar"/>
         </fileset>
      </classpath>
   </javac>
</target>
		
<!-- UID Build -->
<target name="UID.compile" depends="prepare.build.UID">
   <!-- Compile the java code from ${src} into ${build} -->
   <javac srcdir="${src}" destdir="${build.UID}" verbose="on">
      <patternset refid="UIDFiles" />
      <classpath>
         <pathelement path="${classpath}"/>
         <fileset dir="jars">
            <include name="**/*.jar"/>
         </fileset>
         <pathelement location="${dist}/CIA.jar"/>
      </classpath>
   </javac>
</target>
	
<target name="Common.compile" depends="prepare.build.Common">
   <!-- Compile the java code from ${src} into ${build} -->
   <javac destdir="${build.Common}" srcdir="${src}" >
   <patternset refid="commonfiles" />
      <classpath>			
         <pathelement path="${classpath}"/>
         <fileset dir="jars">
            <include name="**/*.jar"/>
         </fileset>
      </classpath>
   </javac>
</target>




Mime
View raw message