You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2007/05/25 20:12:29 UTC
DO NOT REPLY [Bug 42522] New: - Add "if"/"unless" attributes to
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42522>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=42522
Summary: Add "if"/"unless" attributes to <import/>
Product: Ant
Version: 1.7.0
Platform: Other
OS/Version: other
Status: NEW
Severity: normal
Priority: P2
Component: Core
AssignedTo: dev@ant.apache.org
ReportedBy: josh.moore@gmx.de
Idea:
Add target-like if/unless logic to imports. Such sentinels would allow for logic
similar to C/C++ header file inclusion, which could server as a
workaround/replacement for wanting to <import/> from within a target.
Benefits:
* Backwards compatible
* Familiar (since <imports/> occur at the <project/> level like <target/>s
* Powerful. Much C/C++ build magic is based on this on principle
Example 1:
<project>
<import file="online.xml" unless="offline"/>
<import file="offline.xml" if="offline"/>
<target name="get-source">
<getSource/> <!-- Macro in on- or offline.xml -->
</target>
<target name="build" depends="get-source">
<!-- ... -->
</target>
</project>
$ ant -Doffline=yes build
Example 2:
A.xml:
<project name="A">
<import file="B.xml" unless="B.xml"/>
<import file="C.xml" unless="C.xml"/>
</project>
B.xml:
<project name="B">
<properties name="B.xml" value="true"/>
<!-- overrides C.xml -->
<properties name="C.xml" value="true"/>
<macrodef name="Cmacro">
<sequential><echo>B</echo></sequential>
</macrodef>
</project>
C.xml:
<project name="C">
<macrodef name="Cmacro">
<sequential><echo>C</echo></sequential>
</macrodef>
</project>
Possibly related to:
* scopes in build files (bug 23942)
* conditions at the project level (bug 20093)
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
DO NOT REPLY [Bug 42522] - Add "if"/"unless" attributes to
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42522>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=42522
gudnabrsam@yahoo.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |DUPLICATE
------- Additional Comments From gudnabrsam@yahoo.com 2007-05-25 11:21 -------
encompassed by bug 28882.
*** This bug has been marked as a duplicate of 28882 ***
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org