There is a <different> selector which can help: - patched files are different from their unpatched version
So copy all source files into a new directory and patch the files. Then you can move the patched files (using the <different> selector and comparing the tmp-directory and the original dir) into a new one. Then delete the tmp-dir. Compiling and JARing should be more easily. But you have to ensure correct classpaths ... Another possibility would be writing a new selector: parameterized with a "compare-directory". Select a file, if a file with the same relative path exists in the compare-directory: <fileset dir="${src}"> <xSelector compdir="${comp}"/> </fileset> with files ${src}/org/apache/tools/ant/Ant.java ${src}/org/apache/tools/ant/taskdefs/Echo.java ${comp}/org/apache/tools/ant/taskdefs/Echo.java <--- same name, but patch file the Echo.java would be selected. You can do some name mapping, too (itīs your own selector :-): *.patch-->*.java Jan > -----Original Message----- > From: Kyle Adams [mailto:[EMAIL PROTECTED] > Sent: Wednesday, July 16, 2003 2:45 PM > To: [EMAIL PROTECTED] > Subject: RE: Copying based on fileset > > > Hmm... I need to explain better :-) > > *.java.patch are the diff files, not the patched java source > code. So I have a directory with these diff files, which are > intentionally named to match up with the files they need to > be applied to. > > Then I have the source directory of the third-party project > I'm patching, which has several hundred files, and I only > want to pull out the ones that need to be patched. > > Then the build script needs to apply the patches, re-compile > the patched files, and produce a patched jar. The patched > jar, in turn, will be placed on the classpath before the original jar. > > Everything else should be fairly easy - it's just figuring > out the best way to pull the source files that need to be > patched from the third party's source directory. Right now > I'm using an includesfile, which needs to be manually updated. > > Here's what I currently have: > > <copy todir="${build.dir}/patch" flatten="true" > includeEmptyDirs="false"> > <fileset dir="${diffs.dir}"/> > </copy> > <copy todir="${build.dir}/patch" flatten="true" > includeEmptyDirs="false"> > <fileset dir="${thirdParty.dev.dir}/src" > includesfile="${patchfile}"/> > </copy> > > Kyle > > > Doesn t that work? > > > > <!-- all 'maybe-old' files --> > > <copy todir="${new.dir}"> > > <fileset dir="${src.dir}" /> > > </copy> > > > > <!-- all patches --> > > <copy todir="${new.dir}"> > > <fileset dir="${patch.dir}"> > > <mapper type="glob" from="*.java.patch" to="*.java"/> > > </copy> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] >