1 <project name="grails-osx">
4 <property name="build.command" value=";ant/bin/ant clean build"/>
5 <property name="test.command" value=";ant/bin/ant clean build test"/>
6 <property name="export.prefix" value="export JAVA_HOME="/>
8 <property name="jdk14.location" value="/System/Library/Frameworks/JavaVM.framework/Versions/1.4/Home"/>
9 <property name="jdk15.location" value="/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home"/>
10 <property name="jdk16.location" value="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home"/>
12 <property name="jdk14.build" value="${export.prefix}${jdk14.location}${build.command}"/>
13 <property name="jdk15.build" value="${export.prefix}${jdk15.location}${build.command}"/>
14 <property name="jdk16.build" value="${export.prefix}${jdk16.location}${build.command}"/>
16 <property name="jdk14.test" value="${jdk14.build} test"/>
17 <property name="jdk15.test" value="${jdk15.build} test"/>
18 <property name="jdk16.test" value="${jdk16.build} test"/>
20 <available file="${jdk14.location}" property="jdk14.present"/>
21 <available file="${jdk15.location}" property="jdk15.present"/>
22 <available file="${jdk16.location}" property="jdk16.present"/>
24 <target name="test-os">
25 <condition property="isOSX" else="isNotOSX">
33 <fail message="You are not running OS X" if="isNotOSX"/>
34 <echo>You are running ${os.name} ${os.arch} ${os.version}</echo>
37 <target name="build-with-jdk">
38 <exec executable="bash" failonerror="true">
41 <arg value="${export.prefix}${jdk.location}${build.command}"/>
45 <target name="test-with-jdk">
46 <exec executable="bash" failonerror="true">
49 <arg value="${export.prefix}${jdk.location}${build.command} test"/>
53 <target name="osx-build-with-14" if="jdk14.present">
54 <antcall target="build-with-jdk">
55 <param name="jdk.location" value="${jdk14.location}"/>
59 <target name="osx-build-with-15" if="jdk15.present">
60 <antcall target="build-with-jdk">
61 <param name="jdk.location" value="${jdk15.location}"/>
65 <target name="osx-build-with-16" if="jdk16.present">
66 <antcall target="build-with-jdk">
67 <param name="jdk.location" value="${jdk16.location}"/>
71 <target name="osx-test-with-14" if="jdk14.present">
72 <antcall target="test-with-jdk">
73 <param name="jdk.location" value="${jdk14.location}"/>
77 <target name="osx-test-with-15" if="jdk15.present">
78 <antcall target="test-with-jdk">
79 <param name="jdk.location" value="${jdk15.location}"/>
83 <target name="osx-test-with-16" if="jdk16.present">
84 <antcall target="test-with-jdk">
85 <param name="jdk.location" value="${jdk16.location}"/>
89 <target name="osx-multi-build" depends="test-os">
90 <antcall target="osx-build-with-14"/>
91 <antcall target="osx-build-with-15"/>
92 <antcall target="osx-build-with-16"/>
95 <target name="osx-multi-test" depends="test-os">
96 <antcall target="osx-test-with-14"/>
97 <antcall target="osx-test-with-15"/>
98 <antcall target="osx-test-with-16"/>