Difference between revisions of "Ant/Ant buildfile refactorings"

From Eclipsepedia

< Ant
Jump to: navigation, search
m (Contacts)
 
(4 intermediate revisions by 3 users not shown)
Line 63: Line 63:
 
</source>
 
</source>
  
  converted to
+
...converted to...
  
 
<source lang="xml">
 
<source lang="xml">
Line 76: Line 76:
  
 
7. Pull up / push down
 
7. Pull up / push down
- In Java code this means moving between a class and it`s parent. Here it would  
+
- In Java code this means moving between a class and its parent. Here it would move between the actual buildfile and an <import>ed one. Could also be done with Drag&Drop in the Outline View (drag target on <import>) or Package Explorer. A somewhat related DND bug is {{bug|257209}}.
move between the actual buildfile and an <import>ed one. Could also be done  
+
with Drag&Drop in the Outline View (drag target on <import>) or Package  
+
Explorer.
+
  
 
----
 
----
Line 85: Line 82:
 
== Current status ==
 
== Current status ==
 
Tuesday, May 26, 2009 Start work on requirements. Ideas - there are very good, but we need more detailed requirements for putting up al details ;) <br/>
 
Tuesday, May 26, 2009 Start work on requirements. Ideas - there are very good, but we need more detailed requirements for putting up al details ;) <br/>
Tuesday, May 26, 2009 Start work on usecases. With usecases I`ll check if I complete idea or not.  
+
Tuesday, May 26, 2009 Start work on usecases. With usecases I`ll check if I complete idea or not.
 +
<br/>
 +
Wednesday, June 10, 2009 Finish with docs, let`s go coding!
 +
<br/>
 +
Sunday, August 23, 2009 Pause development because of official finish date of GSoC. I`m planning continue work on these ideas in the future (likely start in a week).
 +
 
 +
----
 +
At present finished:
 +
<br/>
 +
Rename: fixed existing bugs, added new functionality. Ready for check in.
 +
<br/>
 +
Extract task to presetdef: finished with limitation. Currently not fully ready for check in (of should be disabled before check in)
 +
<br/>
 +
 
 +
----
 +
Latest version of patch is available as attachment to [https://bugs.eclipse.org/bugs/show_bug.cgi?id=89938 origin bug].
  
 
==For future period==
 
==For future period==
Line 98: Line 110:
 
<br/>
 
<br/>
 
irc: st_shadow_by , chanels #gsoc & #eclipse-soc on freenode.net
 
irc: st_shadow_by , chanels #gsoc & #eclipse-soc on freenode.net
 +
 +
[[Category:Ant]]

Latest revision as of 12:36, 27 January 2011

Ant buildfile refactorings
Possible mentors: Darin Swanson
Related Project: Platform Ant
Description: Ant buildfiles can become large and complex and would benefit from refactoring. Currently there is no support beyond renaming within a buildfile to allow the developer to efficiently refactor Ant buildfiles. The goals would be to implement an infrastructure to support refactorings in Ant buildfiles, participate in other components refactorings and provide a starter set of Ant buildfile refactorings.
Further information

Contents

[edit] Abstract

Of course, eclipse supports ant. But now, in modern project ant build files became too difficult to maintaine and refactor. Goal of this project - to implement an infrastructure to support refactorings for ant files, provide more clear and visual tool for working with ant tasks ant targets.


[edit] List of Ideas for 2009 Google Summer Of Code (taken from eclipse bug db)

1. Something like "extract method":

  • You select one task and could generate a <presetdef>.
  • You select multiple tasks and could generate a <macrodef>.
  • You select a <script> and could generate a <scriptdef>. (2) could be used inside

2. Introduce attributes (see "introduce parameters" on methods)

<macrodef name="foo">
    <sequential>
        <echo message="Hello World"/>
    </sequential>
</macrodef>
<foo/>

would be

<macrodef name="foo">
    <attribute name="msg"/>
    <sequential>
        <echo message="@{msg}"/>
    </sequential>
</macrodef>
<foo msg="Hello World"/>

3. Convert <presetdef> to <macrodef> Rename <presetdef> to <macrodef> and include the <sequential> container.

4. Rename
- rename of properties - definitions by <*def>

 -- change the value in the name-attribute
 -- change the value in "tasks"
 -- example (from 2):
    foo --> myecho
    --- <macrodef name="myecho">...
    --- <myecho msg="...

5. Extract property - Select an attribute value and it will introduce a property with that value.

  <echo message="Hello World"/>

...converted to...

  <property name="msg" value="Hello World"/>
  <echo message="${msg}"/>

6. Property bundle (see I18N-stuff) - gives a list with all properties - you select the properties to put into the new build.properties file - build.properties will be created and load into the build file

7. Pull up / push down - In Java code this means moving between a class and its parent. Here it would move between the actual buildfile and an <import>ed one. Could also be done with Drag&Drop in the Outline View (drag target on <import>) or Package Explorer. A somewhat related DND bug is bug 257209.


[edit] Current status

Tuesday, May 26, 2009 Start work on requirements. Ideas - there are very good, but we need more detailed requirements for putting up al details ;)
Tuesday, May 26, 2009 Start work on usecases. With usecases I`ll check if I complete idea or not.
Wednesday, June 10, 2009 Finish with docs, let`s go coding!
Sunday, August 23, 2009 Pause development because of official finish date of GSoC. I`m planning continue work on these ideas in the future (likely start in a week).


At present finished:
Rename: fixed existing bugs, added new functionality. Ready for check in.
Extract task to presetdef: finished with limitation. Currently not fully ready for check in (of should be disabled before check in)


Latest version of patch is available as attachment to origin bug.

[edit] For future period

If all previous ideas would been realized, I`m planning extend them with ant dependency grafic representation.


[edit] Contacts

jabber: st.shadow.by on gmail.com
email: st.shadow.by on gmail.com
irc: st_shadow_by , chanels #gsoc & #eclipse-soc on freenode.net