fixed setenv task (Android examples)
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@22197 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
parent
90ec20d87e
commit
133fe98371
|
@ -1,4 +1,4 @@
|
||||||
sdk.dir=C://Progra~1\\Android
|
sdk.dir=C://Progra~1//Android
|
||||||
scala.dir=c:${file.separator}Progra~1${file.separator}Scala
|
scala.dir=c://Progra~1//Scala
|
||||||
yguard.dir=c:\\Progra~1\\yguard-2.3.0.1
|
yguard.dir=c://Progra~1//yguard-2.3.0.1
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project name="android" default="help">
|
<project name="android" default="help">
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
Builds the Android applications targeted to the Scala platform.
|
Builds the Android applications targeted to the Scala platform.
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
<!-- Setting-up Ant contrib tasks -->
|
<!-- Setting-up Ant contrib tasks -->
|
||||||
|
@ -30,6 +30,11 @@
|
||||||
<ant.dirs target="release"/>
|
<ant.dirs target="release"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<target name="install" description="install applications">
|
||||||
|
<!--<confirm message="Is the Android emulator up and ready ?" />-->
|
||||||
|
<ant.dirs target="install"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
<target name="uninstall" description="uninstall applications">
|
<target name="uninstall" description="uninstall applications">
|
||||||
<ant.dirs target="uninstall"/>
|
<ant.dirs target="uninstall"/>
|
||||||
</target>
|
</target>
|
||||||
|
@ -46,22 +51,24 @@
|
||||||
<echo message=" release: Build applications in release mode."/>
|
<echo message=" release: Build applications in release mode."/>
|
||||||
<echo message=" uninstall: Uninstall applications from a running emulator or device."/>
|
<echo message=" uninstall: Uninstall applications from a running emulator or device."/>
|
||||||
<echo message=" clean: Clean up build files from projects."/>
|
<echo message=" clean: Clean up build files from projects."/>
|
||||||
<echo message=" setenv: Update software locations to current environment."/>
|
<echo message="Available advanced targets:"/>
|
||||||
|
<echo message=" setenv: Update build.properties files according to current environment."/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="setenv">
|
<target name="setenv">
|
||||||
<condition property="prop.file" value="${basedir}/ant-windows.properties">
|
<condition property="prop.file" value="${basedir}/ant-windows.properties">
|
||||||
<and>
|
<and>
|
||||||
<os family="unix" />
|
<os family="windows" />
|
||||||
<available file="${basedir}/ant-windows.properties" />
|
<available file="${basedir}/ant-windows.properties" />
|
||||||
</and>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
<condition property="prop.file" value="${basedir}/ant-unix.properties">
|
<condition property="prop.file" value="${basedir}/ant-unix.properties">
|
||||||
<and>
|
<and>
|
||||||
<os family="windows" />
|
<os family="unix" />
|
||||||
<available file="${basedir}/ant-unix.properties" />
|
<available file="${basedir}/ant-unix.properties" />
|
||||||
</and>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
|
<echo message="Reading environment settings from ${prop.file}" level="verbose" />
|
||||||
<!--<property file="${prop.file}" prefix="os" /> -->
|
<!--<property file="${prop.file}" prefix="os" /> -->
|
||||||
<loadproperties srcfile="${prop.file}" prefix="os" >
|
<loadproperties srcfile="${prop.file}" prefix="os" >
|
||||||
<filterchain>
|
<filterchain>
|
||||||
|
@ -74,19 +81,19 @@
|
||||||
<echo message="prop.file=${prop.file}" level="debug" />
|
<echo message="prop.file=${prop.file}" level="debug" />
|
||||||
<if><isset property="prop.file" />
|
<if><isset property="prop.file" />
|
||||||
<then>
|
<then>
|
||||||
<for list="Snake" param="dir"><sequential>
|
<for list="${dirs}" param="dir"><sequential>
|
||||||
<loadfile
|
<replaceproperty
|
||||||
srcfile="@{dir}/build.properties"
|
name="sdk.dir"
|
||||||
property="toto">
|
value="${os.sdk.dir}"
|
||||||
<filterchain>
|
dir="@{dir}"/>
|
||||||
<tokenfilter>
|
<replaceproperty
|
||||||
<replaceregex pattern="^sdk\.dir=.*$" replace="sdk.dir=${os.sdk.dir}" flags="gi"/>
|
name="scala.dir"
|
||||||
<replaceregex pattern="^scala\.dir=.*$" replace="scala.dir=${os.scala.dir}" flags="gi"/>
|
value="${os.scala.dir}"
|
||||||
<replaceregex pattern="^yguard\.dir=.*$" replace="yguard.dir=${os.yguard.dir}" flags="gi"/>
|
dir="@{dir}"/>
|
||||||
</tokenfilter>
|
<replaceproperty
|
||||||
</filterchain>
|
name="yguard.dir"
|
||||||
</loadfile>
|
value="${os.yguard.dir}"
|
||||||
<echo message="${toto}" file="@{dir}/build.properties" />
|
dir="@{dir}"/>
|
||||||
</sequential></for>
|
</sequential></for>
|
||||||
</then>
|
</then>
|
||||||
<else>
|
<else>
|
||||||
|
@ -106,4 +113,31 @@
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
|
|
||||||
|
<macrodef name="replaceproperty">
|
||||||
|
<attribute name="name" />
|
||||||
|
<attribute name="value" />
|
||||||
|
<attribute name="dir" />
|
||||||
|
<sequential>
|
||||||
|
<replaceregexp byline="true">
|
||||||
|
<regexp pattern="^@{name}=(.*)"/>
|
||||||
|
<substitution expression="@{name}=@{value}"/>
|
||||||
|
<fileset dir="@{dir}" includes="build.properties"/>
|
||||||
|
</replaceregexp>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
|
||||||
|
<macrodef name="confirm">
|
||||||
|
<attribute name="message" />
|
||||||
|
<sequential>
|
||||||
|
<input message="@{message}"
|
||||||
|
validargs="y,n"
|
||||||
|
addproperty="do.confirm"
|
||||||
|
/>
|
||||||
|
<condition property="do.abort">
|
||||||
|
<equals arg1="n" arg2="${do.confirm}"/>
|
||||||
|
</condition>
|
||||||
|
<fail if="do.abort">Build aborted by user.</fail>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
Loading…
Reference in New Issue