Bug 201143 - exported ant script does not apply include/exclude filter on init target's copy task
Summary: exported ant script does not apply include/exclude filter on init target's co...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.5 M7   Edit
Assignee: Platform-Ant-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-08-24 16:34 EDT by Ryan Fong CLA
Modified: 2009-06-01 08:32 EDT (History)
3 users (show)

See Also:


Attachments
example project files (1.60 KB, application/x-zip)
2007-08-24 16:34 EDT, Ryan Fong CLA
no flags Details
proposed patch (2.00 KB, patch)
2007-08-24 17:18 EDT, Ryan Fong CLA
no flags Details | Diff
proposed patch v2 (2.43 KB, patch)
2007-08-24 17:49 EDT, Ryan Fong CLA
Michael_Rennie: iplog+
Details | Diff
whole BuildFileCreator.java file (62.47 KB, text/x-java)
2007-08-27 12:08 EDT, Ryan Fong CLA
no flags Details
BuildFileCreator.java: Merged Ryan's fix into current source (62.79 KB, text/x-java)
2009-03-21 12:10 EDT, Richard . CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Fong CLA 2007-08-24 16:34:23 EDT
Created attachment 76953 [details]
example project files

Build ID: I20070621-1340

Steps To Reproduce:
* Create an Eclipse Java project.
* Specify an include and/or an exclude filter pattern.  For example, place an exclude filter of *.txt.
* Place a file ending in .txt in the project's source path.
* The Eclipse build will not include .txt when compiling into bin/.
* Export the project to ant using eclipse2ant 1.1.4.  Run the ant target either standalone or with Eclipse ant.  The bin/ includes the .txt file.

More information:
The init target's copy task fileset always includes the same exclude filter.  This does not match Eclipse treatment of the include/exclude filter and leads to a different build result.

    <target name="init">
        <mkdir dir="bin"/>
        <copy includeemptydirs="false" todir="bin">
            <fileset dir="${EXTERNAL.link}" excludes="**/*.launch, **/*.java"/>
        </copy>
    </target>
Comment 1 Ryan Fong CLA 2007-08-24 17:18:33 EDT
Created attachment 76955 [details]
proposed patch
Comment 2 Ryan Fong CLA 2007-08-24 17:49:22 EDT
Created attachment 76961 [details]
proposed patch v2

Added elements for the original exclude filters.

I haven't compiled this code since I don't have the full eclipse2ant environment, but I hope this saves some work and helps implement this patch quickly.
Comment 3 Richard . CLA 2007-08-25 05:12:44 EDT
Ryan, you are right. There is an inconsistence. Either Eclipse behaviour changed or I overlooked it. I think, formerly only this property influenced the resource copying:
Java -> Compiler -> Building -> Filtered Resources

I have not verified your patch yet. But thanks anyway.
Comment 4 Darin Swanson CLA 2007-08-25 15:46:53 EDT
Thanks Ryan
Comment 5 Ryan Fong CLA 2007-08-27 12:08:08 EDT
Created attachment 77046 [details]
whole BuildFileCreator.java file

Richard, here is the whole file since my patch file was unintelligible.  Thanks.
Comment 6 Richard . CLA 2007-08-28 15:18:10 EDT
Thanks, Ryan. Your fix works perfectly.
Comment 7 Ryan Fong CLA 2008-02-29 18:27:28 EST
Will this file be tagged for inclusion in the 3.4 release?
Comment 8 Richard . CLA 2009-03-21 12:10:22 EDT
Created attachment 129521 [details]
BuildFileCreator.java: Merged Ryan's fix into current source

If this helps I merged Ryan's fix into the current source.
Sorry, can't provide a patch.
Comment 9 Michael Rennie CLA 2009-03-23 11:26:47 EDT
applied patched version of BuildFileCreator to HEAD

Comment 10 Michael Rennie CLA 2009-03-23 11:27:02 EDT
verified
Comment 11 John Arthorne CLA 2009-06-01 08:32:49 EDT
Removing iplog+ from bug. This is used to indicate a contribution embedded in a comment.

http://wiki.eclipse.org/Development_Resources/Automatic_IP_Log