From: <ad...@jb...> - 2005-04-27 22:54:35
|
Objections and ideals over. To reproduce what already exists, like you suggested, you could add specialised parameters to the source definition that can affect the macro generating the junit task. But this would require some coding. Probably the most general solution is to allow any element to be added to a macro by making each type implement DynamicElement not just DynamicAttribute? | <source id="tests" test="whatever"> | <junit-elements> <!-- This is just held inside the definition as a DynamicElement --> | ... | </junit-elements> | </source> | Then insert the junit-elements directly into the junit task (which might be empty). | <targetdef target="runtest"> | <component/> | <source when="@{test}"> | <mkdir dir="@{testDir}"/> | <junit fork="true" | printSummary="true"> | <formatter type="plain"/> | <classpath> | <pathElements/> | </classpath> | <batchtest todir="@{testDir}"> | <fileset dir="@{sourceDir}" includes="@{test}"/> | </batchtest> | <junit-elements/> <!-- HERE source/junit-elements --> | </junit> | </source> | </targetdef> | The downside is the loss of validation if you mistype and sub-element, e.g. | <source id="tests"> | <incude id="main"/> // OOPS! this is now a DynamicElement when it should be a parser exception | </source> View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3875681#3875681 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3875681 |