configurationengine/build.xml
changeset 9 63964d875993
parent 5 d2c80f5cab53
equal deleted inserted replaced
8:a2e65c705db8 9:63964d875993
     1 <!--****************************************************************************
     1 <!--****************************************************************************
     2  * Configuration Engine (ConE) main build file
     2  * Configuration Engine (ConE) main build file
     3  * This ant build.xml will build, install and test ConE and its plugins
     3  * This ant build.xml will build, install and test ConE and its plugins
     4  ****************************************************************************-->
     4  ****************************************************************************-->
     5 
     5 <project name="ConE"
     6 <project name="ConE" default="install">
     6          default="install">
     7     <property file="common.properties"/>
     7   <property file="common.properties" />
     8     <property file="linux.properties" />
     8   <property file="linux.properties" />
     9     <property file="windows.properties" />
     9   <property file="windows.properties" />
    10     <property environment="env"/>
    10   <property environment="env" />
    11 
    11   <property name="cone.src.dir" value="source/cone"/>
    12     <!--
    12   <property name="cone.src.dir_abs" location="${cone.src.dir}"/>
       
    13 
       
    14   <!--
    13     Build properties, intended to be overridden from the command line
    15     Build properties, intended to be overridden from the command line
    14     where necessary.
    16     where necessary.
    15 	
    17         
    16     E.g. ant install -Dbuild.build_path=C:/my/install/path -Dbuild.plugin_package=symbian
    18     E.g. ant install -Dbuild.build_path=C:/my/install/path -Dbuild.plugin_package=symbian
    17     -->
    19     -->
    18 	<property name="drive" value="" />
    20   <property name="drive"
    19 	<condition property="build.base_path" value="${drive}/build" else="build">
    21             value="" />
    20         <and>		
    22   <condition property="build.base_path"
    21             <not>
    23              value="${drive}/build"
    22 			    <equals arg1="${drive}" arg2="" />
    24              else="build">
    23 		    </not>
    25     <and>
    24             <not>
    26       <not>
    25                 <os name="${os.linux.name}" />
    27         <equals arg1="${drive}"
    26             </not>
    28                 arg2="" />
    27         </and>
    29       </not>
    28 	</condition>
    30       <not>
    29 	<condition property="build_scripts_dir" value="${drive}/${common.build_scripts_dir}" else="${common.build_scripts_dir}">
    31         <os name="${os.linux.name}" />
    30         <and>		
    32       </not>
    31             <not>
    33     </and>
    32 			    <equals arg1="${drive}" arg2="" />
    34   </condition>
    33 		    </not>
    35   <condition property="build_scripts_dir"
    34             <not>
    36              value="${drive}/${common.build_scripts_dir}"
    35                 <os name="${os.linux.name}" />
    37              else="${common.build_scripts_dir}">
    36             </not>
    38     <and>
    37         </and>
    39       <not>
    38 	</condition>
    40         <equals arg1="${drive}"
    39 	
    41                 arg2="" />
    40     <property name="build.plugin_package" value="common"/>
    42       </not>
    41     <!-- <property name="build.base_path" value="build"/> -->
    43       <not>
    42     <property name="build.cone_install_path" value="${build.base_path}/cone"/>
    44         <os name="${os.linux.name}" />
    43     <property name="build.bat_export_path" value="${build.base_path}/bat"/>
    45       </not>
    44     <property name="build.cone_pack_path" value="${build.base_path}/dist"/>
    46     </and>
    45     <property name="build.bat_pack_path" value="${build.base_path}/dist"/>
    47   </condition>
    46 
    48   <property name="build.plugin_package"
    47     <property name="build.cone_install_path_abs" location="${build.cone_install_path}"/>
    49             value="common" />
    48     <property name="build.bat_export_path_abs" location="${build.bat_export_path}"/>
    50   <!-- <property name="build.base_path" value="build"/> -->
    49     <property name="build.cone_pack_path_abs" location="${build.cone_pack_path}"/>
    51   <property name="build.cone_install_path"
    50     <property name="build.bat_pack_path_abs" location="${build.bat_pack_path}"/>
    52             value="${build.base_path}/cone" />
    51     <!--
    53   <property name="build.bat_export_path"
       
    54             value="${build.base_path}/bat" />
       
    55   <property name="build.cone_pack_path"
       
    56             value="${build.base_path}/dist" />
       
    57   <property name="build.bat_pack_path"
       
    58             value="${build.base_path}/dist" />
       
    59   <property name="build.cone_install_path_abs"
       
    60             location="${build.cone_install_path}" />
       
    61   <property name="build.bat_export_path_abs"
       
    62             location="${build.bat_export_path}" />
       
    63   <property name="build.cone_pack_path_abs"
       
    64             location="${build.cone_pack_path}" />
       
    65   <property name="build.bat_pack_path_abs"
       
    66             location="${build.bat_pack_path}" />
       
    67 
       
    68   <!--
    52     <property name="os.linux.name" value="Linux" />
    69     <property name="os.linux.name" value="Linux" />
    53     <property name="os.windows" value="Windows 2003, Windows XP, Windows vista" />
    70     <property name="os.windows" value="Windows 2003, Windows XP, Windows vista" />
    54     -->    
    71     -->
    55     <property name="pythonversion" value="" />
    72   <property name="pythonversion"
    56 
    73             value="" />
    57 	<condition property="os_is_linux">
    74   <condition property="os_is_linux">
    58 		<os name="${os.linux.name}" />
    75     <os name="${os.linux.name}" />
    59 	</condition>
    76   </condition>
    60     <condition property="pythonversion_defined">
    77   <condition property="pythonversion_defined">
    61         <not>
    78     <not>
    62             <equals arg1="${pythonversion}" arg2="" />
    79       <equals arg1="${pythonversion}"
    63         </not>
    80               arg2="" />
    64     </condition>
    81     </not>
    65 	<condition property="drive_defined">
    82   </condition>
    66         <not>
    83   <condition property="drive_defined">
    67             <equals arg1="${drive}" arg2="" />
    84     <not>
    68         </not>
    85       <equals arg1="${drive}"
    69     </condition>
    86               arg2="" />
    70 	<!-- Set properties based on OS -->
    87     </not>
    71 	<condition property="cmd_name" value="${os.linux.cmdname}" else="${os.windows.cmdname}">
    88   </condition>
    72 		<os name="${os.linux.name}" />
    89   <!-- Set properties based on OS -->
    73 	</condition>
    90   <condition property="cmd_name"
    74 	<condition property="cmd_switch" value="${os.linux.cmdswitch}" else="${os.windows.cmdswitch}">
    91              value="${os.linux.cmdname}"
    75 		<os name="${os.linux.name}" />
    92              else="${os.windows.cmdname}">
    76 	</condition>
    93     <os name="${os.linux.name}" />
    77 	<condition property="env_path" value="${env.PATH}" else="${env.Path}">
    94   </condition>
    78 		<os name="${os.linux.name}" />
    95   <condition property="cmd_switch"
    79 	</condition>
    96              value="${os.linux.cmdswitch}"
    80 	<!-- Set properties based on cmd line arguments -->
    97              else="${os.windows.cmdswitch}">
    81 	<condition property="full_path_linux" value="${os.linux.userbin}:${env_path}" else="${env_path}">	
    98     <os name="${os.linux.name}" />
    82         <not>
    99   </condition>
    83 		    <equals arg1="${pythonversion}" arg2="" />
   100   <condition property="env_path"
    84 	    </not>
   101              value="${env.PATH}"
    85 	</condition>
   102              else="${env.Path}">
    86 	<condition property="full_path_windows" value="${os.windows.pythonlocationbase}${pythonversion};${os.windows.pythonlocationbase}${pythonversion}/Scripts;${env_path}" else="${env_path}">
   103     <os name="${os.linux.name}" />
    87 		<not>
   104   </condition>
    88 			<equals arg1="${pythonversion}" arg2="" />
   105   <!-- Set properties based on cmd line arguments -->
    89 		</not>
   106   <condition property="full_path_linux"
    90 	</condition>
   107              value="${os.linux.userbin}:${env_path}"
    91 	<condition property="full_path" value="${full_path_linux}" else="${full_path_windows}">
   108              else="${env_path}">
    92 		<os name="${os.linux.name}" />
   109     <not>
    93 	</condition>
   110       <equals arg1="${pythonversion}"
    94     <condition property="create_symlink">
   111               arg2="" />
    95         <and>
   112     </not>
    96             <os name="${os.linux.name}" />
   113   </condition>
    97             <not>
   114   <condition property="full_path_windows"
    98                 <equals arg1="${pythonversion}" arg2="" />
   115              value="${os.windows.pythonlocationbase}${pythonversion};${os.windows.pythonlocationbase}${pythonversion}/Scripts;${env_path}"
    99             </not>
   116              else="${env_path}">
   100         </and>
   117     <not>
   101     </condition>
   118       <equals arg1="${pythonversion}"
   102 	
   119               arg2="" />
   103 	<!-- Targets -->
   120     </not>
   104     <target name="info">
   121   </condition>
   105         <echoproperties/>
   122   <condition property="full_path"
   106     </target>
   123              value="${full_path_linux}"
   107 
   124              else="${full_path_windows}">
   108     <!-- Aliases -->
   125     <os name="${os.linux.name}" />
   109     <target name="install" depends="install-cone"/>
   126   </condition>
   110     <target name="develop" depends="develop-cone"/>
   127   <condition property="create_symlink">
   111     <target name="test" depends="run-bat"/>
   128     <and>
   112     <target name="doc" depends="doc-all"/>
   129       <os name="${os.linux.name}" />
   113 
   130       <not>
   114     <target name="clean">
   131         <equals arg1="${pythonversion}"
   115         <delete dir="${build.cone_install_path_abs}"/>
   132                 arg2="" />
   116         <delete dir="${build.bat_export_path_abs}"/>
   133       </not>
   117         <delete dir="${build.cone_pack_path_abs}"/>
   134     </and>
   118         <delete dir="${build.bat_pack_path_abs}"/>
   135   </condition>
   119     </target>
   136   <!-- Targets -->
   120 
   137   <target name="info">
   121 
   138     <echoproperties />
   122     <target name="svnversion">
   139   </target>
   123         <!--
   140   <!-- Aliases -->
       
   141   <target name="install"
       
   142           depends="install-cone" />
       
   143   <target name="develop"
       
   144           depends="develop-cone" />
       
   145   <target name="test"
       
   146           depends="run-bat" />
       
   147   <target name="doc"
       
   148           depends="doc-all" />
       
   149   <target name="clean">
       
   150     <delete dir="${build.cone_install_path_abs}" />
       
   151     <delete dir="${build.bat_export_path_abs}" />
       
   152     <delete dir="${build.cone_pack_path_abs}" />
       
   153     <delete dir="${build.bat_pack_path_abs}" />
       
   154 
       
   155   </target>
       
   156   <target name="svnversion">
       
   157     <!--
   124         Call the revision update script without the revision argument
   158         Call the revision update script without the revision argument
   125         so that the revision is reverted back to "" (this should make
   159         so that the revision is reverted back to "" (this should make
   126         it so that the working copy has no modifications and the
   160         it so that the working copy has no modifications and the
   127         revision will be e.g. "1234" instead of "1234M".
   161         revision will be e.g. "1234" instead of "1234M".
   128         -->
   162         -->
   129         <echo>Revert SVN revision in source/cone/__init__.py</echo>
   163     <echo>Revert SVN revision in source/cone/__init__.py</echo>
   130         <exec executable="python">
   164     <exec executable="python">
   131             <arg value="update_svn_revision.py"/>
   165       <arg value="update_svn_revision.py" />
   132             <arg value="source/cone/__init__.py"/>
   166       <arg value="source/cone/__init__.py" />
   133         </exec>
   167     </exec>
   134 
   168     <echo>Determine current working copy revision</echo>
   135         <echo>Determine current working copy revision</echo>
   169     <exec executable="svnversion"
   136         <exec executable="svnversion" failifexecutionfails="false">
   170           failifexecutionfails="false">
   137             <redirector outputproperty="svn.version"/>
   171       <redirector outputproperty="svn.version" />
   138         </exec>
   172     </exec>
   139         
   173     <echo>SVN revision: ${svn.version}</echo>
   140         <echo>SVN revision: ${svn.version}</echo>
   174   </target>
   141     </target>
   175   <target name="svninitupdate"
   142 
   176           depends="svnversion">
   143     <target name="svninitupdate" depends="svnversion">
   177     <echo>Update SVN revision in __init__.py</echo>
   144       <echo>Update SVN revision in __init__.py</echo>
   178     <exec executable="python">
   145       <exec executable="python">
   179       <arg value="update_svn_revision.py" />
   146         <arg value="update_svn_revision.py"/>
   180       <arg value="source/cone/__init__.py" />
   147         <arg value="source/cone/__init__.py"/>
   181       <arg value="${svn.version}" />
   148         <arg value="${svn.version}"/>
   182     </exec>
   149       </exec>
   183   </target>
   150     </target>
   184   <target name="_mount-drive"
   151 
   185           unless="os_is_linux"
   152 	<target name="_mount-drive" unless="os_is_linux" if="drive_defined">
   186           if="drive_defined">
   153 		<echo message="Mounting drive ${drive} on Windows" />
   187     <echo message="Mounting drive ${drive} on Windows" />
   154 		<exec executable="cmd">
   188     <exec executable="cmd">
   155 			<arg value="/c" />
   189       <arg value="/c" />
   156 			<arg value="subst /D ${drive}" />
   190       <arg value="subst /D ${drive}" />
   157 		</exec>
   191     </exec>
   158 		<exec executable="cmd">
   192     <exec executable="cmd">
   159 			<arg value="/c" />
   193       <arg value="/c" />
   160 			<arg value="subst ${drive} ." />
   194       <arg value="subst ${drive} ." />
   161 		</exec>
   195     </exec>
   162 	</target>
   196   </target>
   163 	
   197   <target name="install-cone"
   164     <target name="install-cone" depends="svninitupdate">
   198           depends="svninitupdate">
   165         <!--
   199     <!--
   166         <echo>$${build.cone_install_path}:     ${build.cone_install_path}</echo>
   200         <echo>$${build.cone_install_path}:     ${build.cone_install_path}</echo>
   167         <echo>$${build.cone_install_path_abs}: ${build.cone_install_path_abs}</echo>
   201         <echo>$${build.cone_install_path_abs}: ${build.cone_install_path_abs}</echo>
   168         -->
   202         -->
   169 		
   203     <!-- Linux: set the correct python version -->
   170 		<!-- Linux: set the correct python version -->		
   204     <antcall target="_create-python-version-symlink" />
   171 		<antcall target="_create-python-version-symlink" />
   205     <!-- Windows: mount drive -->
   172 		<!-- Windows: mount drive -->
   206     <antcall target="_mount-drive" />
   173 		<antcall target="_mount-drive" />
   207     <echo message="OS: ${os.name}" />
   174 		
   208     <echo message="Python version:" />
   175         <echo message="OS: ${os.name}" />
   209     <exec executable="${cmd_name}">
   176 		<echo message="Python version:" />
   210       <env key="PATH"
   177 		<exec executable="${cmd_name}">
   211            path="${full_path}" />
   178             <env key="PATH" path="${full_path}" />
   212       <arg value="${cmd_switch}" />
   179             <arg value="${cmd_switch}" />
   213       <arg value="python --version" />
   180             <arg value="python --version"/>
   214     </exec>
   181         </exec>
   215     <!-- Run the install script in build-scripts/ -->
   182 		
   216     <echo message="Run ConE install script" />
   183 		<!-- Run the install script in build-scripts/ -->
   217     <exec executable="${cmd_name}"
   184 		<echo message="Run ConE install script" />
   218           dir="${build_scripts_dir}"
   185 		<exec executable="${cmd_name}" dir="${build_scripts_dir}" failonerror="true">
   219           failonerror="true">
   186 			<env key="PATH" value="${full_path}" />
   220       <env key="PATH"
   187 			<arg value="${cmd_switch}" />
   221            value="${full_path}" />
   188 			<arg value='python install_cone.py --target-dir="${build.cone_install_path_abs}" --plugin-package="${build.plugin_package}"'/>
   222       <arg value="${cmd_switch}" />
   189 		</exec>
   223       <arg value='python install_cone.py --target-dir=&quot;${build.cone_install_path_abs}&quot; --plugin-package=&quot;${build.plugin_package}&quot;' />
   190 		
   224     </exec>
   191         <!-- Revert the SVN revision so that it doesn't mark the working copy as modified needlessly -->
   225     <!-- Revert the SVN revision so that it doesn't mark the working copy as modified needlessly -->
   192         <echo>Revert SVN revision in source/cone/__init__.py</echo>
   226     <echo>Revert SVN revision in source/cone/__init__.py</echo>
   193         <exec executable="python">
   227     <exec executable="python">
   194             <arg value="update_svn_revision.py"/>
   228       <arg value="update_svn_revision.py" />
   195             <arg value="source/cone/__init__.py"/>
   229       <arg value="source/cone/__init__.py" />
   196         </exec>
   230     </exec>
   197         <echo message="Done" />
   231     <echo message="Done" />
   198     </target>
   232   </target>
   199 
   233   <target name="build-cone"
   200     <target name="build-cone" depends="svninitupdate">
   234           depends="svninitupdate">
   201         <!-- Linux: set the correct python version -->      
   235     <!-- Linux: set the correct python version -->
   202         <antcall target="_create-python-version-symlink" />
   236     <antcall target="_create-python-version-symlink" />
   203         <!-- Windows: mount drive -->
   237     <!-- Windows: mount drive -->
   204         <antcall target="_mount-drive" />
   238     <antcall target="_mount-drive" />
   205         
   239     <echo message="OS: ${os.name}" />
   206         <echo message="OS: ${os.name}" />
   240     <echo message="Python version:" />
   207         <echo message="Python version:" />
   241     <exec executable="${cmd_name}">
   208         <exec executable="${cmd_name}">
   242       <env key="PATH"
   209             <env key="PATH" path="${full_path}" />
   243            path="${full_path}" />
   210             <arg value="${cmd_switch}" />
   244       <arg value="${cmd_switch}" />
   211             <arg value="python --version"/>
   245       <arg value="python --version" />
   212         </exec>
   246     </exec>
   213         
   247     <!-- Run the install script in build-scripts/ -->
   214         <!-- Run the install script in build-scripts/ -->
   248     <echo message="Run ConE install script" />
   215         <echo message="Run ConE install script" />
   249     <exec executable="${cmd_name}"
   216         <exec executable="${cmd_name}" dir="${build_scripts_dir}" failonerror="true">
   250           dir="${build_scripts_dir}"
   217             <env key="PATH" value="${full_path}" />
   251           failonerror="true">
   218             <arg value="${cmd_switch}" />
   252       <env key="PATH"
   219             <arg value='python install_cone.py -i build --target-dir="${build.cone_install_path_abs}" --plugin-package="${build.plugin_package}"'/>
   253            value="${full_path}" />
   220         </exec>
   254       <arg value="${cmd_switch}" />
   221         
   255       <arg value='python install_cone.py -i build --target-dir=&quot;${build.cone_install_path_abs}&quot; --plugin-package=&quot;${build.plugin_package}&quot;' />
   222         <!-- Revert the SVN revision so that it doesn't mark the working copy as modified needlessly -->
   256     </exec>
   223         <echo>Revert SVN revision in source/cone/__init__.py</echo>
   257     <!-- Revert the SVN revision so that it doesn't mark the working copy as modified needlessly -->
   224         <exec executable="python">
   258     <echo>Revert SVN revision in source/cone/__init__.py</echo>
   225             <arg value="update_svn_revision.py"/>
   259     <exec executable="python">
   226             <arg value="source/cone/__init__.py"/>
   260       <arg value="update_svn_revision.py" />
   227         </exec>
   261       <arg value="source/cone/__init__.py" />
   228         <echo message="Done" />
   262     </exec>
   229     </target>
   263     <echo message="Done" />
   230 
   264   </target>
   231     <!--
   265   <!--
   232     Internal target for installing ConE on Windows so that it supports
   266     Internal target for installing ConE on Windows so that it supports
   233     two Python versions.
   267     two Python versions.
   234     
   268     
   235     Depends on two properties: build.dualversioninstall.path1 and
   269     Depends on two properties: build.dualversioninstall.path1 and
   236     build.dualversioninstall.path2 that must be set to the values of the PATH
   270     build.dualversioninstall.path2 that must be set to the values of the PATH
   237     environment that contains the locations of the two Python installations.
   271     environment that contains the locations of the two Python installations.
   238     -->
   272     -->
   239     <target name="_install-cone-dualversion-win" depends="svninitupdate" unless="os_is_linux">
   273   <target name="_install-cone-dualversion-win"
   240         <!-- Run the install script using the first Python version-->
   274           depends="svninitupdate"
   241         <echo>Installing with first Python version (PATH=${build.dualversioninstall.path1})</echo>
   275           unless="os_is_linux">
   242         <exec executable="python" dir="${build_scripts_dir}" failonerror="true">
   276     <!-- Run the install script using the first Python version-->
   243             <env key="PATH" value="${build.dualversioninstall.path1}"/>
   277     <echo>Installing with first Python version (PATH=${build.dualversioninstall.path1})</echo>
   244             <arg line='install_cone.py --target-dir="${build.cone_install_path_abs}" --plugin-package="${build.plugin_package}"'/>
   278     <exec executable="python"
   245         </exec>
   279           dir="${build_scripts_dir}"
   246         
   280           failonerror="true">
   247         <!-- Run the install script using the second Python version-->
   281       <env key="PATH"
   248         <echo>Installing with second Python version (PATH=${build.dualversioninstall.path2})</echo>
   282            value="${build.dualversioninstall.path1}" />
   249         <exec executable="python" dir="${build_scripts_dir}" failonerror="true">
   283       <arg line='install_cone.py --target-dir=&quot;${build.cone_install_path_abs}&quot; --plugin-package=&quot;${build.plugin_package}&quot;' />
   250             <env key="PATH" value="${build.dualversioninstall.path2}"/>
   284     </exec>
   251             <arg line='install_cone.py --target-dir="${build.cone_install_path_abs}" --plugin-package="${build.plugin_package}"'/>
   285     <!-- Run the install script using the second Python version-->
   252         </exec>
   286     <echo>Installing with second Python version (PATH=${build.dualversioninstall.path2})</echo>
   253         
   287     <exec executable="python"
   254         <!-- Revert the SVN revision so that it doesn't mark the working copy as modified needlessly -->
   288           dir="${build_scripts_dir}"
   255         <echo>Revert SVN revision in source/cone/__init__.py</echo>
   289           failonerror="true">
   256         <exec executable="python">
   290       <env key="PATH"
   257             <arg value="update_svn_revision.py"/>
   291            value="${build.dualversioninstall.path2}" />
   258             <arg value="source/cone/__init__.py"/>
   292       <arg line='install_cone.py --target-dir=&quot;${build.cone_install_path_abs}&quot; --plugin-package=&quot;${build.plugin_package}&quot;' />
   259         </exec>
   293     </exec>
   260     </target>
   294     <!-- Revert the SVN revision so that it doesn't mark the working copy as modified needlessly -->
   261     
   295     <echo>Revert SVN revision in source/cone/__init__.py</echo>
   262     <!--
   296     <exec executable="python">
       
   297       <arg value="update_svn_revision.py" />
       
   298       <arg value="source/cone/__init__.py" />
       
   299     </exec>
       
   300   </target>
       
   301   <!--
   263     Internal target for installing ConE on Linux so that it supports
   302     Internal target for installing ConE on Linux so that it supports
   264     two Python versions.
   303     two Python versions.
   265     
   304     
   266     Depends on two properties: build.dualversioninstall.executable1 and
   305     Depends on two properties: build.dualversioninstall.executable1 and
   267     build.dualversioninstall.executable1 that must be set to the Python
   306     build.dualversioninstall.executable1 that must be set to the Python
   268     executables to run the installation (e.g. python2.5 and python2.6)
   307     executables to run the installation (e.g. python2.5 and python2.6)
   269     -->
   308     -->
   270     <target name="_install-cone-dualversion-linux" depends="svninitupdate" if="os_is_linux">
   309   <target name="_install-cone-dualversion-linux"
   271         <echo>Installing with first Python version (executable=${build.dualversioninstall.executable1})</echo>
   310           depends="svninitupdate"
   272         <exec executable="python" dir="${build_scripts_dir}" failonerror="true">
   311           if="os_is_linux">
   273             <arg line='install_cone.py --target-dir="${build.cone_install_path_abs}" --plugin-package="${build.plugin_package}" --python-executable="${build.dualversioninstall.executable1}"'/>
   312     <echo>Adding execution rights to source/cone</echo>
   274         </exec>
   313     <chmod dir="source" file="cone" perm="ugo+rx"/>
   275         
   314     <echo>Installing with first Python version (executable=${build.dualversioninstall.executable1})</echo>
   276         <echo>Installing with second Python version (executable=${build.dualversioninstall.executable2})</echo>
   315     <exec executable="python"
   277         <exec executable="python" dir="${build_scripts_dir}" failonerror="true">
   316           dir="${build_scripts_dir}"
   278             <arg line='install_cone.py --target-dir="${build.cone_install_path_abs}" --plugin-package="${build.plugin_package}" --python-executable="${build.dualversioninstall.executable2}"'/>
   317           failonerror="true">
   279         </exec>
   318       <arg line='install_cone.py --target-dir=&quot;${build.cone_install_path_abs}&quot; --plugin-package=&quot;${build.plugin_package}&quot; --python-executable=&quot;${build.dualversioninstall.executable1}&quot;' />
   280         
   319     </exec>
   281         <!-- Revert the SVN revision so that it doesn't mark the working copy as modified needlessly -->
   320     <echo>Installing with second Python version (executable=${build.dualversioninstall.executable2})</echo>
   282         <echo>Revert SVN revision in source/cone/__init__.py</echo>
   321     <exec executable="python"
   283         <exec executable="python">
   322           dir="${build_scripts_dir}"
   284             <arg value="update_svn_revision.py"/>
   323           failonerror="true">
   285             <arg value="source/cone/__init__.py"/>
   324       <arg line='install_cone.py --target-dir=&quot;${build.cone_install_path_abs}&quot; --plugin-package=&quot;${build.plugin_package}&quot; --python-executable=&quot;${build.dualversioninstall.executable2}&quot;' />
   286         </exec>
   325     </exec>
   287     </target>
   326     <!-- Revert the SVN revision so that it doesn't mark the working copy as modified needlessly -->
   288     
   327     <echo>Revert SVN revision in source/cone/__init__.py</echo>
   289     <target name="install-cone-dualversion" depends="_install-cone-dualversion-win,_install-cone-dualversion-linux"/>
   328     <exec executable="python">
   290     
   329       <arg value="update_svn_revision.py" />
   291     <target name="develop-cone">
   330       <arg value="source/cone/__init__.py" />
   292         <!-- Run the install script in build-scripts/ -->
   331     </exec>
   293         <exec executable="python" dir="${build_scripts_dir}" failonerror="true">
   332 
   294             <arg line='install_cone.py --target-dir="${build.cone_install_path_abs}" --plugin-package="${build.plugin_package}" --install-type develop'/>
   333   </target>
   295         </exec>
   334   <target name="install-cone-dualversion"
   296     </target>
   335           depends="_install-cone-dualversion-win,_install-cone-dualversion-linux" />
   297 
   336   <target name="develop-cone">
   298     <!--
   337     <!-- Run the install script in build-scripts/ -->
       
   338     <exec executable="python"
       
   339           dir="${build_scripts_dir}"
       
   340           failonerror="true">
       
   341       <arg line='install_cone.py --target-dir=&quot;${build.cone_install_path_abs}&quot; --plugin-package=&quot;${build.plugin_package}&quot; --install-type develop' />
       
   342     </exec>
       
   343   </target>
       
   344   <!--
   299     Internal pack target for packing the ConE installation.
   345     Internal pack target for packing the ConE installation.
   300     The actual dependencies to cone-install and cone-install-dualversion are
   346     The actual dependencies to cone-install and cone-install-dualversion are
   301     specified in the actual targets below.
   347     specified in the actual targets below.
   302     -->
   348     -->
   303     <target name="_pack">
   349   <target name="_pack" depends="_pack_linux,_pack_windows"/>
   304         <!--
   350 
       
   351   <target name="_pack_linux" if="os_is_linux">
       
   352     <!--
   305         <echo>$${build.cone_pack_path}:     ${build.cone_pack_path}</echo>
   353         <echo>$${build.cone_pack_path}:     ${build.cone_pack_path}</echo>
   306         <echo>$${build.cone_pack_path_abs}: ${build.cone_pack_path_abs}</echo>
   354         <echo>$${build.cone_pack_path_abs}: ${build.cone_pack_path_abs}</echo>
   307         -->
   355         -->
   308 
   356     <echo message="Creating zip file" />
   309         <echo message="Creating zip file"/>
   357     <mkdir dir="${build.cone_pack_path_abs}" />
   310         <mkdir dir="${build.cone_pack_path_abs}"/>
   358     <tstamp>
   311 
   359       <format property="lastbuild"
   312         <tstamp>
   360               pattern="yyyyMMddHHmmss" />
   313                <format property="lastbuild" pattern="yyyyMMddHHmmss"/>
   361     </tstamp>
   314         </tstamp>
   362     <zip destfile="${build.cone_pack_path_abs}/ConE-${common.version}-${build.plugin_package}-${lastbuild}-${svn.version}.zip">
   315 
   363       <fileset dir="${build.cone_install_path_abs}" />
   316         <zip destfile="${build.cone_pack_path_abs}/ConE-${common.version}-${build.plugin_package}-${lastbuild}-${svn.version}.zip">
   364     </zip>
   317             <fileset dir="${build.cone_install_path_abs}"/>
   365     <exec executable="zip"
   318         </zip>
   366           dir="${build.cone_pack_path_abs}">
   319     </target>
   367       <arg value="-j" />
   320     
   368       <arg value="ConE-${common.version}-${build.plugin_package}-${lastbuild}-${svn.version}.zip" />
   321     <!-- Actual pack targets -->
   369       <arg value="${build.cone_install_path_abs}/cone" />
   322     <target name="pack" depends="install-cone">
   370     </exec>
   323         <antcall target="_pack"/>
   371   </target>	
   324     </target>
   372 
   325     <target name="pack-dualversion" depends="install-cone-dualversion">
   373   <target name="_pack_windows" unless="os_is_linux">
   326         <antcall target="_pack"/>
   374     <!--
   327     </target>
   375         <echo>$${build.cone_pack_path}:     ${build.cone_pack_path}</echo>
   328 
   376         <echo>$${build.cone_pack_path_abs}: ${build.cone_pack_path_abs}</echo>
   329 
   377         -->
   330     <target name="export-bat">
   378     <echo message="Creating zip file" />
   331     	<!-- Linux: set the correct python version -->		
   379     <mkdir dir="${build.cone_pack_path_abs}" />
   332 		<antcall target="_create-python-version-symlink" />
   380     <tstamp>
   333         <!-- Run the export script in build-scripts/ -->
   381       <format property="lastbuild"
   334         <exec executable="${cmd_name}" dir="${build_scripts_dir}" failonerror="true">
   382               pattern="yyyyMMddHHmmss" />
   335             <env key="PATH" value="${full_path}" />
   383     </tstamp>
   336             <arg value="${cmd_switch}" />
   384     <zip destfile="${build.cone_pack_path_abs}/ConE-${common.version}-${build.plugin_package}-${lastbuild}-${svn.version}.zip">
   337 			<arg value='python export_bat.py --target-dir="${build.bat_export_path_abs}" --plugin-package="${build.plugin_package}"'/>
   385       <fileset dir="${build.cone_install_path_abs}" />
   338         </exec>
   386     </zip>
   339     </target>
   387   </target>
   340 
   388 
   341     <target name="pack-bat" depends="export-bat">
   389 <!-- Actual pack targets -->
   342         <echo message="Creating zip file"/>
   390   <target name="pack"
   343         <mkdir dir="${build.bat_pack_path_abs}"/>
   391           depends="install-cone">
   344 
   392     <antcall target="_pack" />
   345         <zip destfile="${build.bat_pack_path_abs}/ConE-BAT-${build.plugin_package}.zip">
   393   </target>
   346             <fileset dir="${build.bat_export_path_abs}"/>
   394   <target name="pack-dualversion"
   347         </zip>
   395           depends="install-cone-dualversion">
   348     </target>
   396     <antcall target="_pack" />
   349     
   397   </target>
   350 	<!-- Linux: Create a symbolic link to the Python version used -->
   398   <target name="export-bat">
   351     <target name="_create-python-version-symlink" if="create_symlink">
   399     <!-- Linux: set the correct python version -->
   352 		<echo message="Change Python version on Linux" />
   400     <antcall target="_create-python-version-symlink" />
   353         <echo message="Deleting old symlink"/>        
   401     <!-- Run the export script in build-scripts/ -->
   354         <delete file="${os.linux.userbin}/python" />
   402     <exec executable="${cmd_name}"
   355         <echo message="ln -s -f /usr/bin/${pythonversion} ${os.linux.userbin}/python" />
   403           dir="${build_scripts_dir}"
   356         <exec executable="ln">
   404           failonerror="true">
   357 		    <arg value="-s" />
   405       <env key="PATH"
   358 		    <arg value="-f" />
   406            value="${full_path}" />
   359 		    <arg value="/usr/bin/${pythonversion}" />
   407       <arg value="${cmd_switch}" />
   360 		    <arg value="${os.linux.userbin}/python" />
   408       <arg value='python export_bat.py --target-dir=&quot;${build.bat_export_path_abs}&quot; --plugin-package=&quot;${build.plugin_package}&quot;' />
   361 	    </exec>
   409     </exec>
   362     </target>
   410   </target>
   363 
   411   <target name="pack-bat"
   364     <target name="run-bat" depends="install-cone, export-bat">
   412           depends="export-bat">
   365         <echo message="Running BAT tests..."/>
   413     <echo message="Creating zip file" />
   366   
   414     <mkdir dir="${build.bat_pack_path_abs}" />
   367         <echo message="Moving ConE installation under BAT..."/>
   415     <zip destfile="${build.bat_pack_path_abs}/ConE-BAT-${build.plugin_package}.zip">
   368         <move todir="${build.bat_export_path_abs}/cone">
   416       <fileset dir="${build.bat_export_path_abs}" />
   369             <fileset dir="${build.cone_install_path_abs}"/>
   417     </zip>
   370         </move>
   418   </target>
   371 		
   419   <!-- Linux: Create a symbolic link to the Python version used -->
   372 		<exec executable="${cmd_name}" dir="${build.bat_export_path_abs}">
   420   <target name="_create-python-version-symlink"
   373             <env key="PATH" path="${full_path}" />
   421           if="create_symlink">
   374             <arg value="${cmd_switch}" />
   422     <echo message="Change Python version on Linux" />
   375             <arg value="python runtests.py --with-nose"/>
   423     <echo message="Deleting old symlink" />
   376         </exec>
   424     <delete file="${os.linux.userbin}/python" />
   377     </target>
   425     <echo message="ln -s -f /usr/bin/${pythonversion} ${os.linux.userbin}/python" />
   378 
   426     <exec executable="ln">
   379 
   427       <arg value="-s" />
   380     <target name="run-all-tests" depends="build-cone">
   428       <arg value="-f" />
   381 		<echo message="Run all tests" />
   429       <arg value="/usr/bin/${pythonversion}" />
   382 		<echo message="OS: ${os.name}" />
   430       <arg value="${os.linux.userbin}/python" />
   383 		<!-- Linux: Set the correct Python version -->
   431     </exec>
   384 		<antcall target="_create-python-version-symlink" />
   432   </target>
   385 		
   433   <target name="run-bat"
   386 		<echo message="Python version:" />
   434           depends="install-cone, export-bat">
   387 		<exec executable="${cmd_name}" dir="./source">
   435     <echo message="Running BAT tests..." />
   388 			<env key="PATH" path="${full_path}" />
   436     <echo message="Moving ConE installation under BAT..." />
   389 			<arg value="${cmd_switch}" />
   437     <move todir="${build.bat_export_path_abs}/cone">
   390 			<arg value="python --version" />
   438       <fileset dir="${build.cone_install_path_abs}" />
   391 		</exec>
   439     </move>
   392 		<echo message="Run tests" />
   440     <exec executable="${cmd_name}"
   393 		<exec executable="${cmd_name}" dir="./source">
   441           dir="${build.bat_export_path_abs}">
   394 			<env key="PATH" path="${full_path}" />
   442       <env key="PATH"
   395 			<env key="PYTHONPATH" path="${cone_python_path}" />
   443            path="${full_path}" />
   396 			<arg value="${cmd_switch}" />
   444       <arg value="${cmd_switch}" />
   397 			<arg value="python runtests.py" />
   445       <arg value="python runtests.py --with-nose" />
   398 		</exec>
   446     </exec>
   399     </target>
   447   </target>
   400 	
   448   <target name="run-all-tests"
   401     <import file="generatedoc-build.xml"/>
   449           depends="build-cone">
       
   450     <echo message="Run all tests" />
       
   451     <echo message="OS: ${os.name}" />
       
   452     <!-- Linux: Set the correct Python version -->
       
   453     <antcall target="_create-python-version-symlink" />
       
   454     <echo message="Python version:" />
       
   455     <exec executable="${cmd_name}"
       
   456           dir="./source">
       
   457       <env key="PATH"
       
   458            path="${full_path}" />
       
   459       <arg value="${cmd_switch}" />
       
   460       <arg value="python --version" />
       
   461     </exec>
       
   462     <echo message="Run tests" />
       
   463     <exec executable="${cmd_name}"
       
   464           dir="./source">
       
   465       <env key="PATH"
       
   466            path="${full_path}" />
       
   467       <env key="PYTHONPATH"
       
   468            path="${cone_python_path}" />
       
   469       <arg value="${cmd_switch}" />
       
   470       <arg value="python runtests.py" />
       
   471     </exec>
       
   472   </target>
       
   473     <target name="zip-src" depends="svnversion, clean">
       
   474             
       
   475             <mkdir dir="${build.cone_pack_path_abs}"/>
       
   476             
       
   477             <tstamp>
       
   478                 <format property="lastbuild" pattern="yyyyMMdd-HHmmss" />
       
   479             </tstamp>
       
   480             <property name="zip_abs" location="${build.cone_pack_path_abs}/cone-src-${common.version}-${lastbuild}-r${svn.version}.zip" />
       
   481             
       
   482             <zip destfile="${zip_abs}">
       
   483                 <zipfileset dir="${cone.src.dir_abs}">
       
   484                     <exclude name="**/tests/**"/>
       
   485                     <exclude name="**/*.pyc"/>
       
   486                 	<exclude name="**/runtests.py"/>
       
   487                 	<exclude name="test.xml"/>
       
   488                 	<exclude name="nose_unittests.cfg"/>
       
   489                 	<exclude name="all.doxygen"/>
       
   490                 	
       
   491                 </zipfileset>
       
   492                 <zipfileset file="RELEASE.TXT"/>
       
   493 
       
   494             </zip>
       
   495             
       
   496             <echo>Zip package located at ${zip_abs}.</echo>
       
   497         </target>
       
   498   <import file="generatedoc-build.xml" />
   402 </project>
   499 </project>