// Access to the flag property value fl = self.getProject().getProperty("flag");
// Evaluate if (fl == 'fail') { // use the id-Attribute doFail.setMessage("fail-message"); doFail.perform(); } else { doEcho.setMessage("ok"); doEcho.perform(); } ]]> </script>
</target>
<!-- The target begins with a '-' so it can?t be invoked from command line. It defines tasks used in the script task. These tasks have an id-Attribute so they can be referenced by these id in the script. --> <target name="-internalUsed"> <fail id="doFail"/> <echo id="doEcho"/> </target>
</project>
>ant Buildfile: build.xml main: [echo] ok BUILD SUCCESSFUL
-----Urspr?ngliche Nachricht----- Von: Craig Dickson [mailto:craig.dickson@(protected)] Gesendet am: Mittwoch, 19. M?rz 2003 00:08 An: 'user@(protected)' Betreff: Is there a way to fail a build from inside the script task?