mailing lists">


List Info

Thread: DO NOT REPLY New: - Add "if"/"unless" attributes to




DO NOT REPLY New: - Add "if"/"unless" attributes to <import/>
country flaguser name
United States
2007-05-25 13:12:29
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=42
522>.
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: devant.apache.org
        ReportedBy: josh.mooregmx.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&
gt;
    </macrodef>
  </project>

C.xml:
  <project name="C">
    <macrodef name="Cmacro">
     
<sequential><echo>C</echo></sequential&
gt;
    </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=ema
il
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the
assignee.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeant.apache.org
For additional commands, e-mail: dev-helpant.apache.org


DO NOT REPLY - Add "if"/"unless" attributes to <import/>
country flaguser name
United States
2007-05-25 13:21:16
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )