I moved OS check into ant xml file (build.xml or other)
On 20 September 2014 03:12, Dennis Gesker <[email protected]> wrote:
> Hello List:
>
> I could really use a couple of hints on this plugin with regard to ant
> tasks within execution.
>
> 1. It it allowed to have two targets within an execution?
> It seems that only the last target in the execution is run:
>
>
> <execution>
> <id>item1</id>
> <phase>pre-clean</phase>
> <goals>
> <goal>run</goal>
> </goals>
> <configuration>
> <!-- This does NOT Execute -->
> <target name="checkOnWindows">
> <condition property="isWindows"
> value="true" else="false">
> <os family="windows" />
> </condition>
> <echo>${isWindows}</echo>
> </target>
> <!-- This DOES Execute -->
> <target name="checkOnUnix">
> <condition property="isUnix" value="true"
> else="false">
> <os family="unix" />
> </condition>
> <echo>${isUnix}</echo>
> </target>
> </configuration>
> </execution>
>
>
> 2. Ant tasks outside of a project (condition in this case) seem to be
> ignored or not set:
>
> <execution>
> <id>item2</id>
> <phase>pre-clean</phase>
> <goals>
> <goal>run</goal>
> </goals>
> <configuration>
> <!-- This property does not seem to set -->
> <condition property="isWindows" value="true"
> else="false">
> <os family="windows" />
> </condition>
> <!-- This displays as executed task -->
> <target name="helloWorld" if="isWindows">
> <!-- This is never reached -->
> <echo>Hello World.</echo>
> </target>
> </configuration>
> </execution>
>
>
>
> I was going to try to use the <task> tags but I get a deprecated message.
> Could someone offer some insight on the above scenarios.
>
> JDK8_20, Ant_1.9.4
>
> Dennis
>
--
WBR
Maxim aka solomax