Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "User talk:Gaurangtpatel.gmail.com"
(→Project proposal) |
(→Proposal: Ant buildfile refactorings) |
||
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | == | + | == Proposal: Ant buildfile refactorings == |
− | + | There is a need of tool for refactoring of ant scripts. | |
+ | Ant macros can be used to achieve re usability of scripts. A macrodef, short for a macro definition, can be seen as defining a reusable piece of Ant functionality – if you think of it in terms of Java code, this would be a reusable utility method. An import is a way to include external Ant functionality into another script. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | ==== A macrodef for compiling Java code using the javac Ant task could look like this: ==== | ||
<macrodef name="m_compile"> | <macrodef name="m_compile"> | ||
Line 26: | Line 21: | ||
</sequential> | </sequential> | ||
</macrodef> | </macrodef> | ||
+ | |||
+ | |||
+ | ==== IMPORT ==== | ||
+ | <import file="${buildfiles.dir}/macro/compile.xml" /> | ||
+ | |||
+ | This statement imports the XML from the compile.xml file into the place where the import statement is. | ||
+ | |||
+ | |||
+ | |||
+ | ==== Challenges and Risks ==== | ||
+ | It will be interesting to see how deep I can go into developing this enhancement to platform ant. | ||
+ | Risks: I don't affevt any of the current functionalities. |
Latest revision as of 14:47, 3 April 2009
Contents
Proposal: Ant buildfile refactorings
There is a need of tool for refactoring of ant scripts.
Ant macros can be used to achieve re usability of scripts. A macrodef, short for a macro definition, can be seen as defining a reusable piece of Ant functionality – if you think of it in terms of Java code, this would be a reusable utility method. An import is a way to include external Ant functionality into another script.
A macrodef for compiling Java code using the javac Ant task could look like this:
<macrodef name="m_compile">
<attribute name="build.dir" default="${build.dir}" /> <attribute name="classpath.id" default="default.classpath" /> <attribute name="src.dir" default="${src.java.dir}" /> <sequential> <mkdir dir="@{build.dir}" /> <javac destdir="@{build.dir}" debug="${debug}" optimize="${optimize}"> <classpath refid="@{classpath.id}" /> <src path="@{src.dir}" /> </javac> </sequential>
</macrodef>
IMPORT
<import file="${buildfiles.dir}/macro/compile.xml" />
This statement imports the XML from the compile.xml file into the place where the import statement is.
Challenges and Risks
It will be interesting to see how deep I can go into developing this enhancement to platform ant. Risks: I don't affevt any of the current functionalities.