[no content change] Fixed all SVN properties: mimes, EOL, executable. Id expansion is consistently enabled for Scala/Java/C# sources in 'src/' and consistently disabled and removed from everywhere else: there should not be any dead Id tags anymore.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@18773 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
|
@ -1,5 +1,4 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- $Id$ -->
|
|
||||||
|
|
||||||
<project name="scala-examples" default="build">
|
<project name="scala-examples" default="build">
|
||||||
|
|
||||||
|
|
|
@ -14,5 +14,5 @@
|
||||||
</application>
|
</application>
|
||||||
<!-- our application is compatible only with devices -->
|
<!-- our application is compatible only with devices -->
|
||||||
<!-- using the Android 1.1 (or greater) system image -->
|
<!-- using the Android 1.1 (or greater) system image -->
|
||||||
<uses-sdk android:minSdkVersion="2" />
|
<uses-sdk android:minSdkVersion="2" />
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
|
@ -1,158 +1,158 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project name="imported" default="help">
|
<project name="imported" default="help">
|
||||||
|
|
||||||
<property environment="env"/>
|
<property environment="env"/>
|
||||||
|
|
||||||
<!-- Android SDK -->
|
<!-- Android SDK -->
|
||||||
<condition property="_dx" value="dx.bat" else="dx">
|
<condition property="_dx" value="dx.bat" else="dx">
|
||||||
<os family="windows"/>
|
<os family="windows"/>
|
||||||
</condition>
|
</condition>
|
||||||
<condition property="_apkbuilder" value="apkbuilder.bat" else="apkbuilder">
|
<condition property="_apkbuilder" value="apkbuilder.bat" else="apkbuilder">
|
||||||
<os family="windows"/>
|
<os family="windows"/>
|
||||||
</condition>
|
</condition>
|
||||||
<property name="android.jar" value="${sdk-location}/platforms/android-1.5/android.jar"/>
|
<property name="android.jar" value="${sdk-location}/platforms/android-1.5/android.jar"/>
|
||||||
<property name="maps.jar" value="${sdk-location}/add-ons/maps.jar"/>
|
<property name="maps.jar" value="${sdk-location}/add-ons/maps.jar"/>
|
||||||
<property name="dx.cmd" value="${sdk-location}/platforms/android-1.5/tools/${_dx}"/>
|
<property name="dx.cmd" value="${sdk-location}/platforms/android-1.5/tools/${_dx}"/>
|
||||||
<property name="aapt.cmd" value="${sdk-location}/platforms/android-1.5/tools/aapt"/>
|
<property name="aapt.cmd" value="${sdk-location}/platforms/android-1.5/tools/aapt"/>
|
||||||
<property name="apkbuilder.cmd" value="${sdk-location}/tools/${_apkbuilder}"/>
|
<property name="apkbuilder.cmd" value="${sdk-location}/tools/${_apkbuilder}"/>
|
||||||
<property name="adb.cmd" value="${sdk-location}/tools/adb"/>
|
<property name="adb.cmd" value="${sdk-location}/tools/adb"/>
|
||||||
|
|
||||||
<!-- Scala SDK -->
|
<!-- Scala SDK -->
|
||||||
<property name="scala-compiler.jar" value="${env.SCALA_HOME}/lib/scala-compiler.jar"/>
|
<property name="scala-compiler.jar" value="${env.SCALA_HOME}/lib/scala-compiler.jar"/>
|
||||||
<property name="scala-library.jar" value="${env.SCALA_HOME}/lib/scala-library.jar"/>
|
<property name="scala-library.jar" value="${env.SCALA_HOME}/lib/scala-library.jar"/>
|
||||||
|
|
||||||
<!-- Android build files -->
|
<!-- Android build files -->
|
||||||
<property name="manifest.xml" value="${basedir}/AndroidManifest.xml"/>
|
<property name="manifest.xml" value="${basedir}/AndroidManifest.xml"/>
|
||||||
<xmlproperty file="${manifest.xml}" collapseAttributes="true"/>
|
<xmlproperty file="${manifest.xml}" collapseAttributes="true"/>
|
||||||
<property name="classes.dex" value="${basedir}/bin/classes.dex"/>
|
<property name="classes.dex" value="${basedir}/bin/classes.dex"/>
|
||||||
<property name="empty.apk" value="${basedir}/bin/${ant.project.name}.ap_"/>
|
<property name="empty.apk" value="${basedir}/bin/${ant.project.name}.ap_"/>
|
||||||
<property name="basename.apk" value="${ant.project.name}-debug.apk"/>
|
<property name="basename.apk" value="${ant.project.name}-debug.apk"/>
|
||||||
<property name="package.apk" value="${basedir}/bin/${basename.apk}"/>
|
<property name="package.apk" value="${basedir}/bin/${basename.apk}"/>
|
||||||
|
|
||||||
<taskdef name="apkbuilder"
|
<taskdef name="apkbuilder"
|
||||||
classname="com.android.ant.ApkBuilderTask"
|
classname="com.android.ant.ApkBuilderTask"
|
||||||
classpathref="android.antlibs"
|
classpathref="android.antlibs"
|
||||||
/>
|
/>
|
||||||
<path id="scala.path">
|
<path id="scala.path">
|
||||||
<pathelement path="${scala-compiler.jar}"/>
|
<pathelement path="${scala-compiler.jar}"/>
|
||||||
<pathelement path="${scala-library.jar}"/>
|
<pathelement path="${scala-library.jar}"/>
|
||||||
</path>
|
</path>
|
||||||
<taskdef
|
<taskdef
|
||||||
resource="scala/tools/ant/antlib.xml"
|
resource="scala/tools/ant/antlib.xml"
|
||||||
classpathref="scala.path"
|
classpathref="scala.path"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<uptodate property="gen.uptodate" targetfile="${basedir}/gen/.gen-complete">
|
<uptodate property="gen.uptodate" targetfile="${basedir}/gen/.gen-complete">
|
||||||
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="compile.uptodate" targetfile="${basedir}/bin/.compile-complete">
|
<uptodate property="compile.uptodate" targetfile="${basedir}/bin/.compile-complete">
|
||||||
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="dex.uptodate" targetfile="${classes.dex}">
|
<uptodate property="dex.uptodate" targetfile="${classes.dex}">
|
||||||
<srcfiles dir="${basedir}/bin/classes" includes="**/*.class"/>
|
<srcfiles dir="${basedir}/bin/classes" includes="**/*.class"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="pkg.uptodate" targetfile="${empty.apk}">
|
<uptodate property="pkg.uptodate" targetfile="${empty.apk}">
|
||||||
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="apk.uptodate" targetfile="${package.apk}">
|
<uptodate property="apk.uptodate" targetfile="${package.apk}">
|
||||||
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
|
|
||||||
<target name="resource-src" unless="gen.uptodate">
|
<target name="resource-src" unless="gen.uptodate">
|
||||||
<mkdir dir="${basedir}/gen"/>
|
<mkdir dir="${basedir}/gen"/>
|
||||||
<echo message="Generating R.java / Manifest.java from the resources..."/>
|
<echo message="Generating R.java / Manifest.java from the resources..."/>
|
||||||
<exec executable="${aapt.cmd}">
|
<exec executable="${aapt.cmd}">
|
||||||
<arg line="package -m -J '${basedir}/gen' -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}'"/>
|
<arg line="package -m -J '${basedir}/gen' -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
<touch file="${basedir}/gen/.gen-complete" verbose="no"/>
|
<touch file="${basedir}/gen/.gen-complete" verbose="no"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="compile" depends="resource-src" unless="compile.uptodate">
|
<target name="compile" depends="resource-src" unless="compile.uptodate">
|
||||||
<path id="boot.path">
|
<path id="boot.path">
|
||||||
<pathelement location="${android.jar}"/>
|
<pathelement location="${android.jar}"/>
|
||||||
<pathelement location="${maps.jar}"/>
|
<pathelement location="${maps.jar}"/>
|
||||||
</path>
|
</path>
|
||||||
<mkdir dir="${basedir}/bin/classes"/>
|
<mkdir dir="${basedir}/bin/classes"/>
|
||||||
<javac
|
<javac
|
||||||
srcdir="${basedir}/src${path.separator}${basedir}/gen" includes="**/*.java"
|
srcdir="${basedir}/src${path.separator}${basedir}/gen" includes="**/*.java"
|
||||||
destdir="${basedir}/bin/classes" bootclasspathref="boot.path"
|
destdir="${basedir}/bin/classes" bootclasspathref="boot.path"
|
||||||
target="1.5" source="1.5" encoding="ascii">
|
target="1.5" source="1.5" encoding="ascii">
|
||||||
<classpath>
|
<classpath>
|
||||||
<pathelement location="${android.jar}"/>
|
<pathelement location="${android.jar}"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
</javac>
|
</javac>
|
||||||
<scalac
|
<scalac
|
||||||
srcdir="${basedir}/src" includes="**/*.scala"
|
srcdir="${basedir}/src" includes="**/*.scala"
|
||||||
destdir="${basedir}/bin/classes" deprecation="on">
|
destdir="${basedir}/bin/classes" deprecation="on">
|
||||||
<classpath>
|
<classpath>
|
||||||
<pathelement location="${scala-library.jar}"/>
|
<pathelement location="${scala-library.jar}"/>
|
||||||
<pathelement location="${android.jar}"/>
|
<pathelement location="${android.jar}"/>
|
||||||
<pathelement location="${basedir}/bin/classes"/>
|
<pathelement location="${basedir}/bin/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
</scalac>
|
</scalac>
|
||||||
<touch file="${basedir}/bin/.compile-complete" verbose="no"/>
|
<touch file="${basedir}/bin/.compile-complete" verbose="no"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="dex" depends="compile" unless="dex.uptodate">
|
<target name="dex" depends="compile" unless="dex.uptodate">
|
||||||
<echo message="Converting compiled files and external libraries into bin/classes.dex..."/>
|
<echo message="Converting compiled files and external libraries into bin/classes.dex..."/>
|
||||||
<!-- IMPORTANT ! -->
|
<!-- IMPORTANT ! -->
|
||||||
<!-- in shell script /opt/android/platforms/android-1.5/tools/dx -->
|
<!-- in shell script /opt/android/platforms/android-1.5/tools/dx -->
|
||||||
<!-- add the following code on line 60: javaOpts="-Xmx768M" -->
|
<!-- add the following code on line 60: javaOpts="-Xmx768M" -->
|
||||||
<exec executable="${dx.cmd}">
|
<exec executable="${dx.cmd}">
|
||||||
<arg line="--dex --no-optimize --output='${classes.dex}' '${basedir}/bin/classes' '${scala-library.jar}'"/>
|
<arg line="--dex --no-optimize --output='${classes.dex}' '${basedir}/bin/classes' '${scala-library.jar}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="package-resources" depends="dex" unless="pkg.uptodate">
|
<target name="package-resources" depends="dex" unless="pkg.uptodate">
|
||||||
<echo message="Packaging resources"/>
|
<echo message="Packaging resources"/>
|
||||||
<exec executable="${aapt.cmd}">
|
<exec executable="${aapt.cmd}">
|
||||||
<arg line="package -f -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}' -F '${empty.apk}'"/>
|
<arg line="package -f -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}' -F '${empty.apk}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="debug" depends="package-resources" unless="apk.uptodate">
|
<target name="debug" depends="package-resources" unless="apk.uptodate">
|
||||||
<apkbuilder
|
<apkbuilder
|
||||||
basename="${ant.project.name}" outfolder="${basedir}/bin"
|
basename="${ant.project.name}" outfolder="${basedir}/bin"
|
||||||
signed="true" verbose="true"
|
signed="true" verbose="true"
|
||||||
/>
|
/>
|
||||||
<exec executable="${apkbuilder.cmd}">
|
<exec executable="${apkbuilder.cmd}">
|
||||||
<arg line="'${package.apk}' -v -z '${empty.apk}' -f '${classes.dex}'"/>
|
<arg line="'${package.apk}' -v -z '${empty.apk}' -f '${classes.dex}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="release">
|
<target name="release">
|
||||||
<echo message="Sorry. Not yet implemented"/>
|
<echo message="Sorry. Not yet implemented"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="install" depends="debug">
|
<target name="install" depends="debug">
|
||||||
<echo message="Installing bin/${basename.apk} onto default emulator..."/>
|
<echo message="Installing bin/${basename.apk} onto default emulator..."/>
|
||||||
<exec executable="${adb.cmd}">
|
<exec executable="${adb.cmd}">
|
||||||
<arg line="install '${package.apk}'"/>
|
<arg line="install '${package.apk}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="reinstall" depends="debug">
|
<target name="reinstall" depends="debug">
|
||||||
<echo message="Reinstalling bin/${basename.apk} onto default emulator..."/>
|
<echo message="Reinstalling bin/${basename.apk} onto default emulator..."/>
|
||||||
<exec executable="${adb.cmd}">
|
<exec executable="${adb.cmd}">
|
||||||
<arg line="install -r '${package.apk}'"/>
|
<arg line="install -r '${package.apk}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="uninstall">
|
||||||
|
<exec executable="${adb.cmd}">
|
||||||
|
<arg line="uninstall '${manifest.package}'"/>
|
||||||
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="help">
|
||||||
|
<echo message="Android Ant Build. Available targets:"/>
|
||||||
|
<echo message=" help: Display this help."/>
|
||||||
|
<echo message=" debug: Builds the application and sign it with a debug key."/>
|
||||||
|
<echo message=" install: Install the debug package onto a running emulator or device."/>
|
||||||
|
<echo message=" reinstall: Reinstall the debug package onto a running emulator or device."/>
|
||||||
|
<echo message=" uninstall: Uninstall the application from a running emulator or device."/>
|
||||||
|
<echo message=" clean: Clean up build files from project."/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="uninstall">
|
|
||||||
<exec executable="${adb.cmd}">
|
|
||||||
<arg line="uninstall '${manifest.package}'"/>
|
|
||||||
</exec>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="help">
|
|
||||||
<echo message="Android Ant Build. Available targets:"/>
|
|
||||||
<echo message=" help: Display this help."/>
|
|
||||||
<echo message=" debug: Builds the application and sign it with a debug key."/>
|
|
||||||
<echo message=" install: Install the debug package onto a running emulator or device."/>
|
|
||||||
<echo message=" reinstall: Reinstall the debug package onto a running emulator or device."/>
|
|
||||||
<echo message=" uninstall: Uninstall the application from a running emulator or device."/>
|
|
||||||
<echo message=" clean: Clean up build files from project."/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<macrodef name="remove">
|
<macrodef name="remove">
|
||||||
<attribute name="dir"/>
|
<attribute name="dir"/>
|
||||||
|
@ -161,10 +161,10 @@
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
|
|
||||||
<target name="clean" description="clean up">
|
<target name="clean" description="clean up">
|
||||||
<echo message="Cleaning project '${ant.project.name}'..."/>
|
<echo message="Cleaning project '${ant.project.name}'..."/>
|
||||||
<remove dir="${basedir}/bin"/>
|
<remove dir="${basedir}/bin"/>
|
||||||
<remove dir="${basedir}/gen"/>
|
<remove dir="${basedir}/gen"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -1,64 +1,64 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project name="FileBrowser" default="help">
|
<project name="FileBrowser" default="help">
|
||||||
|
|
||||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
<!-- The local.properties file is created and updated by the 'android' tool.
|
||||||
It contain the path to the SDK. It should *NOT* be checked in in Version
|
It contain the path to the SDK. It should *NOT* be checked in in Version
|
||||||
Control Systems. -->
|
Control Systems. -->
|
||||||
<property file="local.properties"/>
|
<property file="local.properties"/>
|
||||||
|
|
||||||
<!-- The build.properties file can be created by you and is never touched
|
<!-- The build.properties file can be created by you and is never touched
|
||||||
by the 'android' tool. This is the place to change some of the default property values
|
by the 'android' tool. This is the place to change some of the default property values
|
||||||
used by the Ant rules.
|
used by the Ant rules.
|
||||||
Here are some properties you may want to change/update:
|
Here are some properties you may want to change/update:
|
||||||
|
|
||||||
application-package
|
application-package
|
||||||
the name of your application package as defined in the manifest. Used by the
|
the name of your application package as defined in the manifest. Used by the
|
||||||
'uninstall' rule.
|
'uninstall' rule.
|
||||||
source-folder
|
source-folder
|
||||||
the name of the source folder. Default is 'src'.
|
the name of the source folder. Default is 'src'.
|
||||||
out-folder
|
out-folder
|
||||||
the name of the output folder. Default is 'bin'.
|
the name of the output folder. Default is 'bin'.
|
||||||
|
|
||||||
Properties related to the SDK location or the project target should be updated
|
Properties related to the SDK location or the project target should be updated
|
||||||
using the 'android' tool with the 'update' action.
|
using the 'android' tool with the 'update' action.
|
||||||
|
|
||||||
This file is an integral part of the build system for your application and
|
This file is an integral part of the build system for your application and
|
||||||
should be checked in in Version Control Systems.
|
should be checked in in Version Control Systems.
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<property file="build.properties"/>
|
<property file="build.properties"/>
|
||||||
|
|
||||||
<!-- The default.properties file is created and updated by the 'android' tool, as well
|
<!-- The default.properties file is created and updated by the 'android' tool, as well
|
||||||
as ADT.
|
as ADT.
|
||||||
This file is an integral part of the build system for your application and
|
This file is an integral part of the build system for your application and
|
||||||
should be checked in in Version Control Systems. -->
|
should be checked in in Version Control Systems. -->
|
||||||
<property file="default.properties"/>
|
<property file="default.properties"/>
|
||||||
|
|
||||||
<!-- Custom Android task to deal with the project target, and import the proper rules.
|
<!-- Custom Android task to deal with the project target, and import the proper rules.
|
||||||
This requires ant 1.6.0 or above. -->
|
This requires ant 1.6.0 or above. -->
|
||||||
<path id="android.antlibs">
|
<path id="android.antlibs">
|
||||||
<pathelement path="${sdk-location}/tools/lib/anttasks.jar" />
|
<pathelement path="${sdk-location}/tools/lib/anttasks.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/sdklib.jar" />
|
<pathelement path="${sdk-location}/tools/lib/sdklib.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/androidprefs.jar" />
|
<pathelement path="${sdk-location}/tools/lib/androidprefs.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/apkbuilder.jar" />
|
<pathelement path="${sdk-location}/tools/lib/apkbuilder.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/jarutils.jar" />
|
<pathelement path="${sdk-location}/tools/lib/jarutils.jar" />
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
<taskdef name="setup"
|
<taskdef name="setup"
|
||||||
classname="com.android.ant.SetupTask"
|
classname="com.android.ant.SetupTask"
|
||||||
classpathref="android.antlibs"/>
|
classpathref="android.antlibs"/>
|
||||||
|
|
||||||
<!-- Execute the Android Setup task that will setup some properties specific to the target,
|
<!-- Execute the Android Setup task that will setup some properties specific to the target,
|
||||||
and import the rules files.
|
and import the rules files.
|
||||||
To customize the rules, copy/paste them below the task, and disable import by setting
|
To customize the rules, copy/paste them below the task, and disable import by setting
|
||||||
the import attribute to false:
|
the import attribute to false:
|
||||||
<setup import="false" />
|
<setup import="false" />
|
||||||
|
|
||||||
This will ensure that the properties are setup correctly but that your customized
|
This will ensure that the properties are setup correctly but that your customized
|
||||||
targets are used.
|
targets are used.
|
||||||
-->
|
-->
|
||||||
<setup import="false"/>
|
<setup import="false"/>
|
||||||
|
|
||||||
<import file="build-imported.xml"/>
|
<import file="build-imported.xml"/>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
Before Width: | Height: | Size: 964 B After Width: | Height: | Size: 965 B |
Before Width: | Height: | Size: 1015 B After Width: | Height: | Size: 1016 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 667 B After Width: | Height: | Size: 668 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 971 B After Width: | Height: | Size: 972 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<TextView
|
<TextView
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -9,4 +9,4 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Hello World, AndroidFileBrowser"
|
android:text="Hello World, AndroidFileBrowser"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -1,28 +1,27 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<array name="fileEndingImage">
|
<array name="fileEndingImage">
|
||||||
<item>.png</item>
|
<item>.png</item>
|
||||||
<item>.gif</item>
|
<item>.gif</item>
|
||||||
<item>.jpg</item>
|
<item>.jpg</item>
|
||||||
<item>.jpeg</item>
|
<item>.jpeg</item>
|
||||||
<item>.bmp</item>
|
<item>.bmp</item>
|
||||||
</array>
|
</array>
|
||||||
<array name="fileEndingAudio">
|
<array name="fileEndingAudio">
|
||||||
<item>.mp3</item>
|
<item>.mp3</item>
|
||||||
<item>.wav</item>
|
<item>.wav</item>
|
||||||
<item>.ogg</item>
|
<item>.ogg</item>
|
||||||
<item>.midi</item>
|
<item>.midi</item>
|
||||||
</array>
|
</array>
|
||||||
<array name="fileEndingPackage">
|
<array name="fileEndingPackage">
|
||||||
<item>.jar</item>
|
<item>.jar</item>
|
||||||
<item>.zip</item>
|
<item>.zip</item>
|
||||||
<item>.rar</item>
|
<item>.rar</item>
|
||||||
<item>.gz</item>
|
<item>.gz</item>
|
||||||
</array>
|
</array>
|
||||||
<array name="fileEndingWebText">
|
<array name="fileEndingWebText">
|
||||||
<item>.htm</item>
|
<item>.htm</item>
|
||||||
<item>.html</item>
|
<item>.html</item>
|
||||||
<item>.php</item>
|
<item>.php</item>
|
||||||
</array>
|
</array>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Android File Browser (Scala)</string>
|
<string name="app_name">Android File Browser (Scala)</string>
|
||||||
<string name="dirname_app_name">Android File Browser (Scala)</string>
|
<string name="dirname_app_name">Android File Browser (Scala)</string>
|
||||||
<string name="menu_new_folder">New Folder</string>
|
<string name="menu_new_folder">New Folder</string>
|
||||||
<string name="dirnameinput_cmd_return">Save</string>
|
<string name="dirnameinput_cmd_return">Save</string>
|
||||||
<string name="dirnameinput_hint">Enter a directory-name:</string>
|
<string name="dirnameinput_hint">Enter a directory-name:</string>
|
||||||
<string name="up_one_level">..</string>
|
<string name="up_one_level">..</string>
|
||||||
<string name="current_dir">.</string>
|
<string name="current_dir">.</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.example.helloactivity"
|
package="com.example.helloactivity"
|
||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="1.0">
|
android:versionName="1.0">
|
||||||
<application android:label="@string/app_name">
|
<application android:label="@string/app_name">
|
||||||
<activity android:name=".HelloActivity"
|
<activity android:name=".HelloActivity"
|
||||||
android:label="@string/app_name">
|
android:label="@string/app_name">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
<!-- our application is compatible only with devices -->
|
<!-- our application is compatible only with devices -->
|
||||||
<!-- using the Android 1.1 (or greater) system image -->
|
<!-- using the Android 1.1 (or greater) system image -->
|
||||||
<uses-sdk android:minSdkVersion="2" />
|
<uses-sdk android:minSdkVersion="2" />
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
|
@ -1,158 +1,158 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project name="imported" default="help">
|
<project name="imported" default="help">
|
||||||
|
|
||||||
<property environment="env"/>
|
<property environment="env"/>
|
||||||
|
|
||||||
<!-- Android SDK -->
|
<!-- Android SDK -->
|
||||||
<condition property="_dx" value="dx.bat" else="dx">
|
<condition property="_dx" value="dx.bat" else="dx">
|
||||||
<os family="windows"/>
|
<os family="windows"/>
|
||||||
</condition>
|
</condition>
|
||||||
<condition property="_apkbuilder" value="apkbuilder.bat" else="apkbuilder">
|
<condition property="_apkbuilder" value="apkbuilder.bat" else="apkbuilder">
|
||||||
<os family="windows"/>
|
<os family="windows"/>
|
||||||
</condition>
|
</condition>
|
||||||
<property name="android.jar" value="${sdk-location}/platforms/android-1.5/android.jar"/>
|
<property name="android.jar" value="${sdk-location}/platforms/android-1.5/android.jar"/>
|
||||||
<property name="maps.jar" value="${sdk-location}/add-ons/maps.jar"/>
|
<property name="maps.jar" value="${sdk-location}/add-ons/maps.jar"/>
|
||||||
<property name="dx.cmd" value="${sdk-location}/platforms/android-1.5/tools/${_dx}"/>
|
<property name="dx.cmd" value="${sdk-location}/platforms/android-1.5/tools/${_dx}"/>
|
||||||
<property name="aapt.cmd" value="${sdk-location}/platforms/android-1.5/tools/aapt"/>
|
<property name="aapt.cmd" value="${sdk-location}/platforms/android-1.5/tools/aapt"/>
|
||||||
<property name="apkbuilder.cmd" value="${sdk-location}/tools/${_apkbuilder}"/>
|
<property name="apkbuilder.cmd" value="${sdk-location}/tools/${_apkbuilder}"/>
|
||||||
<property name="adb.cmd" value="${sdk-location}/tools/adb"/>
|
<property name="adb.cmd" value="${sdk-location}/tools/adb"/>
|
||||||
|
|
||||||
<!-- Scala SDK -->
|
<!-- Scala SDK -->
|
||||||
<property name="scala-compiler.jar" value="${env.SCALA_HOME}/lib/scala-compiler.jar"/>
|
<property name="scala-compiler.jar" value="${env.SCALA_HOME}/lib/scala-compiler.jar"/>
|
||||||
<property name="scala-library.jar" value="${env.SCALA_HOME}/lib/scala-library.jar"/>
|
<property name="scala-library.jar" value="${env.SCALA_HOME}/lib/scala-library.jar"/>
|
||||||
|
|
||||||
<!-- Android build files -->
|
<!-- Android build files -->
|
||||||
<property name="manifest.xml" value="${basedir}/AndroidManifest.xml"/>
|
<property name="manifest.xml" value="${basedir}/AndroidManifest.xml"/>
|
||||||
<xmlproperty file="${manifest.xml}" collapseAttributes="true"/>
|
<xmlproperty file="${manifest.xml}" collapseAttributes="true"/>
|
||||||
<property name="classes.dex" value="${basedir}/bin/classes.dex"/>
|
<property name="classes.dex" value="${basedir}/bin/classes.dex"/>
|
||||||
<property name="empty.apk" value="${basedir}/bin/${ant.project.name}.ap_"/>
|
<property name="empty.apk" value="${basedir}/bin/${ant.project.name}.ap_"/>
|
||||||
<property name="basename.apk" value="${ant.project.name}-debug.apk"/>
|
<property name="basename.apk" value="${ant.project.name}-debug.apk"/>
|
||||||
<property name="package.apk" value="${basedir}/bin/${basename.apk}"/>
|
<property name="package.apk" value="${basedir}/bin/${basename.apk}"/>
|
||||||
|
|
||||||
<taskdef name="apkbuilder"
|
<taskdef name="apkbuilder"
|
||||||
classname="com.android.ant.ApkBuilderTask"
|
classname="com.android.ant.ApkBuilderTask"
|
||||||
classpathref="android.antlibs"
|
classpathref="android.antlibs"
|
||||||
/>
|
/>
|
||||||
<path id="scala.path">
|
<path id="scala.path">
|
||||||
<pathelement path="${scala-compiler.jar}"/>
|
<pathelement path="${scala-compiler.jar}"/>
|
||||||
<pathelement path="${scala-library.jar}"/>
|
<pathelement path="${scala-library.jar}"/>
|
||||||
</path>
|
</path>
|
||||||
<taskdef
|
<taskdef
|
||||||
resource="scala/tools/ant/antlib.xml"
|
resource="scala/tools/ant/antlib.xml"
|
||||||
classpathref="scala.path"
|
classpathref="scala.path"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<uptodate property="gen.uptodate" targetfile="${basedir}/gen/.gen-complete">
|
<uptodate property="gen.uptodate" targetfile="${basedir}/gen/.gen-complete">
|
||||||
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="compile.uptodate" targetfile="${basedir}/bin/.compile-complete">
|
<uptodate property="compile.uptodate" targetfile="${basedir}/bin/.compile-complete">
|
||||||
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="dex.uptodate" targetfile="${classes.dex}">
|
<uptodate property="dex.uptodate" targetfile="${classes.dex}">
|
||||||
<srcfiles dir="${basedir}/bin/classes" includes="**/*.class"/>
|
<srcfiles dir="${basedir}/bin/classes" includes="**/*.class"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="pkg.uptodate" targetfile="${empty.apk}">
|
<uptodate property="pkg.uptodate" targetfile="${empty.apk}">
|
||||||
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="apk.uptodate" targetfile="${package.apk}">
|
<uptodate property="apk.uptodate" targetfile="${package.apk}">
|
||||||
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
|
|
||||||
<target name="resource-src" unless="gen.uptodate">
|
<target name="resource-src" unless="gen.uptodate">
|
||||||
<mkdir dir="${basedir}/gen"/>
|
<mkdir dir="${basedir}/gen"/>
|
||||||
<echo message="Generating R.java / Manifest.java from the resources..."/>
|
<echo message="Generating R.java / Manifest.java from the resources..."/>
|
||||||
<exec executable="${aapt.cmd}">
|
<exec executable="${aapt.cmd}">
|
||||||
<arg line="package -m -J '${basedir}/gen' -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}'"/>
|
<arg line="package -m -J '${basedir}/gen' -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
<touch file="${basedir}/gen/.gen-complete" verbose="no"/>
|
<touch file="${basedir}/gen/.gen-complete" verbose="no"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="compile" depends="resource-src" unless="compile.uptodate">
|
<target name="compile" depends="resource-src" unless="compile.uptodate">
|
||||||
<path id="boot.path">
|
<path id="boot.path">
|
||||||
<pathelement location="${android.jar}"/>
|
<pathelement location="${android.jar}"/>
|
||||||
<pathelement location="${maps.jar}"/>
|
<pathelement location="${maps.jar}"/>
|
||||||
</path>
|
</path>
|
||||||
<mkdir dir="${basedir}/bin/classes"/>
|
<mkdir dir="${basedir}/bin/classes"/>
|
||||||
<javac
|
<javac
|
||||||
srcdir="${basedir}/src${path.separator}${basedir}/gen" includes="**/*.java"
|
srcdir="${basedir}/src${path.separator}${basedir}/gen" includes="**/*.java"
|
||||||
destdir="${basedir}/bin/classes" bootclasspathref="boot.path"
|
destdir="${basedir}/bin/classes" bootclasspathref="boot.path"
|
||||||
target="1.5" source="1.5" encoding="ascii">
|
target="1.5" source="1.5" encoding="ascii">
|
||||||
<classpath>
|
<classpath>
|
||||||
<pathelement location="${android.jar}"/>
|
<pathelement location="${android.jar}"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
</javac>
|
</javac>
|
||||||
<scalac
|
<scalac
|
||||||
srcdir="${basedir}/src" includes="**/*.scala"
|
srcdir="${basedir}/src" includes="**/*.scala"
|
||||||
destdir="${basedir}/bin/classes" deprecation="on">
|
destdir="${basedir}/bin/classes" deprecation="on">
|
||||||
<classpath>
|
<classpath>
|
||||||
<pathelement location="${scala-library.jar}"/>
|
<pathelement location="${scala-library.jar}"/>
|
||||||
<pathelement location="${android.jar}"/>
|
<pathelement location="${android.jar}"/>
|
||||||
<pathelement location="${basedir}/bin/classes"/>
|
<pathelement location="${basedir}/bin/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
</scalac>
|
</scalac>
|
||||||
<touch file="${basedir}/bin/.compile-complete" verbose="no"/>
|
<touch file="${basedir}/bin/.compile-complete" verbose="no"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="dex" depends="compile" unless="dex.uptodate">
|
<target name="dex" depends="compile" unless="dex.uptodate">
|
||||||
<echo message="Converting compiled files and external libraries into bin/classes.dex..."/>
|
<echo message="Converting compiled files and external libraries into bin/classes.dex..."/>
|
||||||
<!-- IMPORTANT ! -->
|
<!-- IMPORTANT ! -->
|
||||||
<!-- in shell script /opt/android/platforms/android-1.5/tools/dx -->
|
<!-- in shell script /opt/android/platforms/android-1.5/tools/dx -->
|
||||||
<!-- add the following code on line 60: javaOpts="-Xmx768M" -->
|
<!-- add the following code on line 60: javaOpts="-Xmx768M" -->
|
||||||
<exec executable="${dx.cmd}">
|
<exec executable="${dx.cmd}">
|
||||||
<arg line="--dex --no-optimize --output='${classes.dex}' '${basedir}/bin/classes' '${scala-library.jar}'"/>
|
<arg line="--dex --no-optimize --output='${classes.dex}' '${basedir}/bin/classes' '${scala-library.jar}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="package-resources" depends="dex" unless="pkg.uptodate">
|
<target name="package-resources" depends="dex" unless="pkg.uptodate">
|
||||||
<echo message="Packaging resources"/>
|
<echo message="Packaging resources"/>
|
||||||
<exec executable="${aapt.cmd}">
|
<exec executable="${aapt.cmd}">
|
||||||
<arg line="package -f -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}' -F '${empty.apk}'"/>
|
<arg line="package -f -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}' -F '${empty.apk}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="debug" depends="package-resources" unless="apk.uptodate">
|
<target name="debug" depends="package-resources" unless="apk.uptodate">
|
||||||
<apkbuilder
|
<apkbuilder
|
||||||
basename="${ant.project.name}" outfolder="${basedir}/bin"
|
basename="${ant.project.name}" outfolder="${basedir}/bin"
|
||||||
signed="true" verbose="true"
|
signed="true" verbose="true"
|
||||||
/>
|
/>
|
||||||
<exec executable="${apkbuilder.cmd}">
|
<exec executable="${apkbuilder.cmd}">
|
||||||
<arg line="'${package.apk}' -v -z '${empty.apk}' -f '${classes.dex}'"/>
|
<arg line="'${package.apk}' -v -z '${empty.apk}' -f '${classes.dex}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="release">
|
<target name="release">
|
||||||
<echo message="Sorry. Not yet implemented"/>
|
<echo message="Sorry. Not yet implemented"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="install" depends="debug">
|
<target name="install" depends="debug">
|
||||||
<echo message="Installing bin/${basename.apk} onto default emulator..."/>
|
<echo message="Installing bin/${basename.apk} onto default emulator..."/>
|
||||||
<exec executable="${adb.cmd}">
|
<exec executable="${adb.cmd}">
|
||||||
<arg line="install '${package.apk}'"/>
|
<arg line="install '${package.apk}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="reinstall" depends="debug">
|
<target name="reinstall" depends="debug">
|
||||||
<echo message="Reinstalling bin/${basename.apk} onto default emulator..."/>
|
<echo message="Reinstalling bin/${basename.apk} onto default emulator..."/>
|
||||||
<exec executable="${adb.cmd}">
|
<exec executable="${adb.cmd}">
|
||||||
<arg line="install -r '${package.apk}'"/>
|
<arg line="install -r '${package.apk}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="uninstall">
|
||||||
|
<exec executable="${adb.cmd}">
|
||||||
|
<arg line="uninstall '${manifest.package}'"/>
|
||||||
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="help">
|
||||||
|
<echo message="Android Ant Build. Available targets:"/>
|
||||||
|
<echo message=" help: Display this help."/>
|
||||||
|
<echo message=" debug: Builds the application and sign it with a debug key."/>
|
||||||
|
<echo message=" install: Install the debug package onto a running emulator or device."/>
|
||||||
|
<echo message=" reinstall: Reinstall the debug package onto a running emulator or device."/>
|
||||||
|
<echo message=" uninstall: Uninstall the application from a running emulator or device."/>
|
||||||
|
<echo message=" clean: Clean up build files from project."/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="uninstall">
|
|
||||||
<exec executable="${adb.cmd}">
|
|
||||||
<arg line="uninstall '${manifest.package}'"/>
|
|
||||||
</exec>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="help">
|
|
||||||
<echo message="Android Ant Build. Available targets:"/>
|
|
||||||
<echo message=" help: Display this help."/>
|
|
||||||
<echo message=" debug: Builds the application and sign it with a debug key."/>
|
|
||||||
<echo message=" install: Install the debug package onto a running emulator or device."/>
|
|
||||||
<echo message=" reinstall: Reinstall the debug package onto a running emulator or device."/>
|
|
||||||
<echo message=" uninstall: Uninstall the application from a running emulator or device."/>
|
|
||||||
<echo message=" clean: Clean up build files from project."/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<macrodef name="remove">
|
<macrodef name="remove">
|
||||||
<attribute name="dir"/>
|
<attribute name="dir"/>
|
||||||
|
@ -161,10 +161,10 @@
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
|
|
||||||
<target name="clean" description="clean up">
|
<target name="clean" description="clean up">
|
||||||
<echo message="Cleaning project '${ant.project.name}'..."/>
|
<echo message="Cleaning project '${ant.project.name}'..."/>
|
||||||
<remove dir="${basedir}/bin"/>
|
<remove dir="${basedir}/bin"/>
|
||||||
<remove dir="${basedir}/gen"/>
|
<remove dir="${basedir}/gen"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -1,64 +1,64 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project name="HelloActivity" default="help">
|
<project name="HelloActivity" default="help">
|
||||||
|
|
||||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
<!-- The local.properties file is created and updated by the 'android' tool.
|
||||||
It contain the path to the SDK. It should *NOT* be checked in in Version
|
It contain the path to the SDK. It should *NOT* be checked in in Version
|
||||||
Control Systems. -->
|
Control Systems. -->
|
||||||
<property file="local.properties"/>
|
<property file="local.properties"/>
|
||||||
|
|
||||||
<!-- The build.properties file can be created by you and is never touched
|
<!-- The build.properties file can be created by you and is never touched
|
||||||
by the 'android' tool. This is the place to change some of the default property values
|
by the 'android' tool. This is the place to change some of the default property values
|
||||||
used by the Ant rules.
|
used by the Ant rules.
|
||||||
Here are some properties you may want to change/update:
|
Here are some properties you may want to change/update:
|
||||||
|
|
||||||
application-package
|
application-package
|
||||||
the name of your application package as defined in the manifest. Used by the
|
the name of your application package as defined in the manifest. Used by the
|
||||||
'uninstall' rule.
|
'uninstall' rule.
|
||||||
source-folder
|
source-folder
|
||||||
the name of the source folder. Default is 'src'.
|
the name of the source folder. Default is 'src'.
|
||||||
out-folder
|
out-folder
|
||||||
the name of the output folder. Default is 'bin'.
|
the name of the output folder. Default is 'bin'.
|
||||||
|
|
||||||
Properties related to the SDK location or the project target should be updated
|
Properties related to the SDK location or the project target should be updated
|
||||||
using the 'android' tool with the 'update' action.
|
using the 'android' tool with the 'update' action.
|
||||||
|
|
||||||
This file is an integral part of the build system for your application and
|
This file is an integral part of the build system for your application and
|
||||||
should be checked in in Version Control Systems.
|
should be checked in in Version Control Systems.
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<property file="build.properties"/>
|
<property file="build.properties"/>
|
||||||
|
|
||||||
<!-- The default.properties file is created and updated by the 'android' tool, as well
|
<!-- The default.properties file is created and updated by the 'android' tool, as well
|
||||||
as ADT.
|
as ADT.
|
||||||
This file is an integral part of the build system for your application and
|
This file is an integral part of the build system for your application and
|
||||||
should be checked in in Version Control Systems. -->
|
should be checked in in Version Control Systems. -->
|
||||||
<property file="default.properties"/>
|
<property file="default.properties"/>
|
||||||
|
|
||||||
<!-- Custom Android task to deal with the project target, and import the proper rules.
|
<!-- Custom Android task to deal with the project target, and import the proper rules.
|
||||||
This requires ant 1.6.0 or above. -->
|
This requires ant 1.6.0 or above. -->
|
||||||
<path id="android.antlibs">
|
<path id="android.antlibs">
|
||||||
<pathelement path="${sdk-location}/tools/lib/anttasks.jar" />
|
<pathelement path="${sdk-location}/tools/lib/anttasks.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/sdklib.jar" />
|
<pathelement path="${sdk-location}/tools/lib/sdklib.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/androidprefs.jar" />
|
<pathelement path="${sdk-location}/tools/lib/androidprefs.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/apkbuilder.jar" />
|
<pathelement path="${sdk-location}/tools/lib/apkbuilder.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/jarutils.jar" />
|
<pathelement path="${sdk-location}/tools/lib/jarutils.jar" />
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
<taskdef name="setup"
|
<taskdef name="setup"
|
||||||
classname="com.android.ant.SetupTask"
|
classname="com.android.ant.SetupTask"
|
||||||
classpathref="android.antlibs"/>
|
classpathref="android.antlibs"/>
|
||||||
|
|
||||||
<!-- Execute the Android Setup task that will setup some properties specific to the target,
|
<!-- Execute the Android Setup task that will setup some properties specific to the target,
|
||||||
and import the rules files.
|
and import the rules files.
|
||||||
To customize the rules, copy/paste them below the task, and disable import by setting
|
To customize the rules, copy/paste them below the task, and disable import by setting
|
||||||
the import attribute to false:
|
the import attribute to false:
|
||||||
<setup import="false" />
|
<setup import="false" />
|
||||||
|
|
||||||
This will ensure that the properties are setup correctly but that your customized
|
This will ensure that the properties are setup correctly but that your customized
|
||||||
targets are used.
|
targets are used.
|
||||||
-->
|
-->
|
||||||
<setup import="false"/>
|
<setup import="false"/>
|
||||||
|
|
||||||
<import file="build-imported.xml"/>
|
<import file="build-imported.xml"/>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
>
|
>
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Hello World, HelloAndroid"
|
android:text="Hello World, HelloAndroid"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Hello (Scala)</string>
|
<string name="app_name">Hello (Scala)</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
34
docs/android-examples/HelloActivity/src/com/example/helloactivity/HelloAndroid.scala
Executable file → Normal file
|
@ -1,17 +1,17 @@
|
||||||
package com.example.helloactivity
|
package com.example.helloactivity
|
||||||
|
|
||||||
import _root_.android.app.Activity
|
import _root_.android.app.Activity
|
||||||
import _root_.android.os.Bundle
|
import _root_.android.os.Bundle
|
||||||
import _root_.android.widget.TextView
|
import _root_.android.widget.TextView
|
||||||
|
|
||||||
class HelloActivity extends Activity {
|
class HelloActivity extends Activity {
|
||||||
|
|
||||||
/** Called when the activity is first created. */
|
/** Called when the activity is first created. */
|
||||||
override def onCreate(savedInstanceState: Bundle) {
|
override def onCreate(savedInstanceState: Bundle) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
val tv = new TextView(this)
|
val tv = new TextView(this)
|
||||||
tv setText "Scala on Android"
|
tv setText "Scala on Android"
|
||||||
setContentView(tv)
|
setContentView(tv)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
|
<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.android.helloandroid.tests"
|
package="com.android.helloandroid.tests"
|
||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="1.0">
|
android:versionName="1.0">
|
||||||
<!-- We add an application tag here just so that we can indicate that
|
<!-- We add an application tag here just so that we can indicate that
|
||||||
this package needs to link against the android.test library,
|
this package needs to link against the android.test library,
|
||||||
which is needed when building test cases. -->
|
which is needed when building test cases. -->
|
||||||
<application>
|
<application>
|
||||||
<uses-library android:name="android.test.runner" />
|
<uses-library android:name="android.test.runner" />
|
||||||
</application>
|
</application>
|
||||||
<!--
|
<!--
|
||||||
This declares that this application uses the instrumentation test runner targeting
|
This declares that this application uses the instrumentation test runner targeting
|
||||||
the package of com.android.helloandroid. To run the tests use the command:
|
the package of com.android.helloandroid. To run the tests use the command:
|
||||||
"adb shell am instrument -w com.android.helloandroid.tests/android.test.InstrumentationTestRunner"
|
"adb shell am instrument -w com.android.helloandroid.tests/android.test.InstrumentationTestRunner"
|
||||||
-->
|
-->
|
||||||
<instrumentation android:name="android.test.InstrumentationTestRunner"
|
<instrumentation android:name="android.test.InstrumentationTestRunner"
|
||||||
android:targetPackage="com.android.helloandroid"
|
android:targetPackage="com.android.helloandroid"
|
||||||
android:label="Tests for HelloAndroid"/>
|
android:label="Tests for HelloAndroid"/>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
|
@ -1,158 +1,158 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project name="imported" default="help">
|
<project name="imported" default="help">
|
||||||
|
|
||||||
<property environment="env"/>
|
<property environment="env"/>
|
||||||
|
|
||||||
<!-- Android SDK -->
|
<!-- Android SDK -->
|
||||||
<condition property="_dx" value="dx.bat" else="dx">
|
<condition property="_dx" value="dx.bat" else="dx">
|
||||||
<os family="windows"/>
|
<os family="windows"/>
|
||||||
</condition>
|
</condition>
|
||||||
<condition property="_apkbuilder" value="apkbuilder.bat" else="apkbuilder">
|
<condition property="_apkbuilder" value="apkbuilder.bat" else="apkbuilder">
|
||||||
<os family="windows"/>
|
<os family="windows"/>
|
||||||
</condition>
|
</condition>
|
||||||
<property name="android.jar" value="${sdk-location}/platforms/android-1.5/android.jar"/>
|
<property name="android.jar" value="${sdk-location}/platforms/android-1.5/android.jar"/>
|
||||||
<property name="maps.jar" value="${sdk-location}/add-ons/maps.jar"/>
|
<property name="maps.jar" value="${sdk-location}/add-ons/maps.jar"/>
|
||||||
<property name="dx.cmd" value="${sdk-location}/platforms/android-1.5/tools/${_dx}"/>
|
<property name="dx.cmd" value="${sdk-location}/platforms/android-1.5/tools/${_dx}"/>
|
||||||
<property name="aapt.cmd" value="${sdk-location}/platforms/android-1.5/tools/aapt"/>
|
<property name="aapt.cmd" value="${sdk-location}/platforms/android-1.5/tools/aapt"/>
|
||||||
<property name="apkbuilder.cmd" value="${sdk-location}/tools/${_apkbuilder}"/>
|
<property name="apkbuilder.cmd" value="${sdk-location}/tools/${_apkbuilder}"/>
|
||||||
<property name="adb.cmd" value="${sdk-location}/tools/adb"/>
|
<property name="adb.cmd" value="${sdk-location}/tools/adb"/>
|
||||||
|
|
||||||
<!-- Scala SDK -->
|
<!-- Scala SDK -->
|
||||||
<property name="scala-compiler.jar" value="${env.SCALA_HOME}/lib/scala-compiler.jar"/>
|
<property name="scala-compiler.jar" value="${env.SCALA_HOME}/lib/scala-compiler.jar"/>
|
||||||
<property name="scala-library.jar" value="${env.SCALA_HOME}/lib/scala-library.jar"/>
|
<property name="scala-library.jar" value="${env.SCALA_HOME}/lib/scala-library.jar"/>
|
||||||
|
|
||||||
<!-- Android build files -->
|
<!-- Android build files -->
|
||||||
<property name="manifest.xml" value="${basedir}/AndroidManifest.xml"/>
|
<property name="manifest.xml" value="${basedir}/AndroidManifest.xml"/>
|
||||||
<xmlproperty file="${manifest.xml}" collapseAttributes="true"/>
|
<xmlproperty file="${manifest.xml}" collapseAttributes="true"/>
|
||||||
<property name="classes.dex" value="${basedir}/bin/classes.dex"/>
|
<property name="classes.dex" value="${basedir}/bin/classes.dex"/>
|
||||||
<property name="empty.apk" value="${basedir}/bin/${ant.project.name}.ap_"/>
|
<property name="empty.apk" value="${basedir}/bin/${ant.project.name}.ap_"/>
|
||||||
<property name="basename.apk" value="${ant.project.name}-debug.apk"/>
|
<property name="basename.apk" value="${ant.project.name}-debug.apk"/>
|
||||||
<property name="package.apk" value="${basedir}/bin/${basename.apk}"/>
|
<property name="package.apk" value="${basedir}/bin/${basename.apk}"/>
|
||||||
|
|
||||||
<taskdef name="apkbuilder"
|
<taskdef name="apkbuilder"
|
||||||
classname="com.android.ant.ApkBuilderTask"
|
classname="com.android.ant.ApkBuilderTask"
|
||||||
classpathref="android.antlibs"
|
classpathref="android.antlibs"
|
||||||
/>
|
/>
|
||||||
<path id="scala.path">
|
<path id="scala.path">
|
||||||
<pathelement path="${scala-compiler.jar}"/>
|
<pathelement path="${scala-compiler.jar}"/>
|
||||||
<pathelement path="${scala-library.jar}"/>
|
<pathelement path="${scala-library.jar}"/>
|
||||||
</path>
|
</path>
|
||||||
<taskdef
|
<taskdef
|
||||||
resource="scala/tools/ant/antlib.xml"
|
resource="scala/tools/ant/antlib.xml"
|
||||||
classpathref="scala.path"
|
classpathref="scala.path"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<uptodate property="gen.uptodate" targetfile="${basedir}/gen/.gen-complete">
|
<uptodate property="gen.uptodate" targetfile="${basedir}/gen/.gen-complete">
|
||||||
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="compile.uptodate" targetfile="${basedir}/bin/.compile-complete">
|
<uptodate property="compile.uptodate" targetfile="${basedir}/bin/.compile-complete">
|
||||||
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="dex.uptodate" targetfile="${classes.dex}">
|
<uptodate property="dex.uptodate" targetfile="${classes.dex}">
|
||||||
<srcfiles dir="${basedir}/bin/classes" includes="**/*.class"/>
|
<srcfiles dir="${basedir}/bin/classes" includes="**/*.class"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="pkg.uptodate" targetfile="${empty.apk}">
|
<uptodate property="pkg.uptodate" targetfile="${empty.apk}">
|
||||||
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="apk.uptodate" targetfile="${package.apk}">
|
<uptodate property="apk.uptodate" targetfile="${package.apk}">
|
||||||
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
|
|
||||||
<target name="resource-src" unless="gen.uptodate">
|
<target name="resource-src" unless="gen.uptodate">
|
||||||
<mkdir dir="${basedir}/gen"/>
|
<mkdir dir="${basedir}/gen"/>
|
||||||
<echo message="Generating R.java / Manifest.java from the resources..."/>
|
<echo message="Generating R.java / Manifest.java from the resources..."/>
|
||||||
<exec executable="${aapt.cmd}">
|
<exec executable="${aapt.cmd}">
|
||||||
<arg line="package -m -J '${basedir}/gen' -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}'"/>
|
<arg line="package -m -J '${basedir}/gen' -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
<touch file="${basedir}/gen/.gen-complete" verbose="no"/>
|
<touch file="${basedir}/gen/.gen-complete" verbose="no"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="compile" depends="resource-src" unless="compile.uptodate">
|
<target name="compile" depends="resource-src" unless="compile.uptodate">
|
||||||
<path id="boot.path">
|
<path id="boot.path">
|
||||||
<pathelement location="${android.jar}"/>
|
<pathelement location="${android.jar}"/>
|
||||||
<pathelement location="${maps.jar}"/>
|
<pathelement location="${maps.jar}"/>
|
||||||
</path>
|
</path>
|
||||||
<mkdir dir="${basedir}/bin/classes"/>
|
<mkdir dir="${basedir}/bin/classes"/>
|
||||||
<javac
|
<javac
|
||||||
srcdir="${basedir}/src${path.separator}${basedir}/gen" includes="**/*.java"
|
srcdir="${basedir}/src${path.separator}${basedir}/gen" includes="**/*.java"
|
||||||
destdir="${basedir}/bin/classes" bootclasspathref="boot.path"
|
destdir="${basedir}/bin/classes" bootclasspathref="boot.path"
|
||||||
target="1.5" source="1.5" encoding="ascii">
|
target="1.5" source="1.5" encoding="ascii">
|
||||||
<classpath>
|
<classpath>
|
||||||
<pathelement location="${android.jar}"/>
|
<pathelement location="${android.jar}"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
</javac>
|
</javac>
|
||||||
<scalac
|
<scalac
|
||||||
srcdir="${basedir}/src" includes="**/*.scala"
|
srcdir="${basedir}/src" includes="**/*.scala"
|
||||||
destdir="${basedir}/bin/classes" deprecation="on">
|
destdir="${basedir}/bin/classes" deprecation="on">
|
||||||
<classpath>
|
<classpath>
|
||||||
<pathelement location="${scala-library.jar}"/>
|
<pathelement location="${scala-library.jar}"/>
|
||||||
<pathelement location="${android.jar}"/>
|
<pathelement location="${android.jar}"/>
|
||||||
<pathelement location="${basedir}/bin/classes"/>
|
<pathelement location="${basedir}/bin/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
</scalac>
|
</scalac>
|
||||||
<touch file="${basedir}/bin/.compile-complete" verbose="no"/>
|
<touch file="${basedir}/bin/.compile-complete" verbose="no"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="dex" depends="compile" unless="dex.uptodate">
|
<target name="dex" depends="compile" unless="dex.uptodate">
|
||||||
<echo message="Converting compiled files and external libraries into bin/classes.dex..."/>
|
<echo message="Converting compiled files and external libraries into bin/classes.dex..."/>
|
||||||
<!-- IMPORTANT ! -->
|
<!-- IMPORTANT ! -->
|
||||||
<!-- in shell script /opt/android/platforms/android-1.5/tools/dx -->
|
<!-- in shell script /opt/android/platforms/android-1.5/tools/dx -->
|
||||||
<!-- add the following code on line 60: javaOpts="-Xmx768M" -->
|
<!-- add the following code on line 60: javaOpts="-Xmx768M" -->
|
||||||
<exec executable="${dx.cmd}">
|
<exec executable="${dx.cmd}">
|
||||||
<arg line="--dex --no-optimize --output='${classes.dex}' '${basedir}/bin/classes' '${scala-library.jar}'"/>
|
<arg line="--dex --no-optimize --output='${classes.dex}' '${basedir}/bin/classes' '${scala-library.jar}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="package-resources" depends="dex" unless="pkg.uptodate">
|
<target name="package-resources" depends="dex" unless="pkg.uptodate">
|
||||||
<echo message="Packaging resources"/>
|
<echo message="Packaging resources"/>
|
||||||
<exec executable="${aapt.cmd}">
|
<exec executable="${aapt.cmd}">
|
||||||
<arg line="package -f -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}' -F '${empty.apk}'"/>
|
<arg line="package -f -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}' -F '${empty.apk}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="debug" depends="package-resources" unless="apk.uptodate">
|
<target name="debug" depends="package-resources" unless="apk.uptodate">
|
||||||
<apkbuilder
|
<apkbuilder
|
||||||
basename="${ant.project.name}" outfolder="${basedir}/bin"
|
basename="${ant.project.name}" outfolder="${basedir}/bin"
|
||||||
signed="true" verbose="true"
|
signed="true" verbose="true"
|
||||||
/>
|
/>
|
||||||
<exec executable="${apkbuilder.cmd}">
|
<exec executable="${apkbuilder.cmd}">
|
||||||
<arg line="'${package.apk}' -v -z '${empty.apk}' -f '${classes.dex}'"/>
|
<arg line="'${package.apk}' -v -z '${empty.apk}' -f '${classes.dex}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="release">
|
<target name="release">
|
||||||
<echo message="Sorry. Not yet implemented"/>
|
<echo message="Sorry. Not yet implemented"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="install" depends="debug">
|
<target name="install" depends="debug">
|
||||||
<echo message="Installing bin/${basename.apk} onto default emulator..."/>
|
<echo message="Installing bin/${basename.apk} onto default emulator..."/>
|
||||||
<exec executable="${adb.cmd}">
|
<exec executable="${adb.cmd}">
|
||||||
<arg line="install '${package.apk}'"/>
|
<arg line="install '${package.apk}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="reinstall" depends="debug">
|
<target name="reinstall" depends="debug">
|
||||||
<echo message="Reinstalling bin/${basename.apk} onto default emulator..."/>
|
<echo message="Reinstalling bin/${basename.apk} onto default emulator..."/>
|
||||||
<exec executable="${adb.cmd}">
|
<exec executable="${adb.cmd}">
|
||||||
<arg line="install -r '${package.apk}'"/>
|
<arg line="install -r '${package.apk}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="uninstall">
|
||||||
|
<exec executable="${adb.cmd}">
|
||||||
|
<arg line="uninstall '${manifest.package}'"/>
|
||||||
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="help">
|
||||||
|
<echo message="Android Ant Build. Available targets:"/>
|
||||||
|
<echo message=" help: Display this help."/>
|
||||||
|
<echo message=" debug: Builds the application and sign it with a debug key."/>
|
||||||
|
<echo message=" install: Install the debug package onto a running emulator or device."/>
|
||||||
|
<echo message=" reinstall: Reinstall the debug package onto a running emulator or device."/>
|
||||||
|
<echo message=" uninstall: Uninstall the application from a running emulator or device."/>
|
||||||
|
<echo message=" clean: Clean up build files from project."/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="uninstall">
|
|
||||||
<exec executable="${adb.cmd}">
|
|
||||||
<arg line="uninstall '${manifest.package}'"/>
|
|
||||||
</exec>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="help">
|
|
||||||
<echo message="Android Ant Build. Available targets:"/>
|
|
||||||
<echo message=" help: Display this help."/>
|
|
||||||
<echo message=" debug: Builds the application and sign it with a debug key."/>
|
|
||||||
<echo message=" install: Install the debug package onto a running emulator or device."/>
|
|
||||||
<echo message=" reinstall: Reinstall the debug package onto a running emulator or device."/>
|
|
||||||
<echo message=" uninstall: Uninstall the application from a running emulator or device."/>
|
|
||||||
<echo message=" clean: Clean up build files from project."/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<macrodef name="remove">
|
<macrodef name="remove">
|
||||||
<attribute name="dir"/>
|
<attribute name="dir"/>
|
||||||
|
@ -161,10 +161,10 @@
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
|
|
||||||
<target name="clean" description="clean up">
|
<target name="clean" description="clean up">
|
||||||
<echo message="Cleaning project '${ant.project.name}'..."/>
|
<echo message="Cleaning project '${ant.project.name}'..."/>
|
||||||
<remove dir="${basedir}/bin"/>
|
<remove dir="${basedir}/bin"/>
|
||||||
<remove dir="${basedir}/gen"/>
|
<remove dir="${basedir}/gen"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -1,64 +1,64 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project name="LunarLander" default="help">
|
<project name="LunarLander" default="help">
|
||||||
|
|
||||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
<!-- The local.properties file is created and updated by the 'android' tool.
|
||||||
It contain the path to the SDK. It should *NOT* be checked in in Version
|
It contain the path to the SDK. It should *NOT* be checked in in Version
|
||||||
Control Systems. -->
|
Control Systems. -->
|
||||||
<property file="local.properties"/>
|
<property file="local.properties"/>
|
||||||
|
|
||||||
<!-- The build.properties file can be created by you and is never touched
|
<!-- The build.properties file can be created by you and is never touched
|
||||||
by the 'android' tool. This is the place to change some of the default property values
|
by the 'android' tool. This is the place to change some of the default property values
|
||||||
used by the Ant rules.
|
used by the Ant rules.
|
||||||
Here are some properties you may want to change/update:
|
Here are some properties you may want to change/update:
|
||||||
|
|
||||||
application-package
|
application-package
|
||||||
the name of your application package as defined in the manifest. Used by the
|
the name of your application package as defined in the manifest. Used by the
|
||||||
'uninstall' rule.
|
'uninstall' rule.
|
||||||
source-folder
|
source-folder
|
||||||
the name of the source folder. Default is 'src'.
|
the name of the source folder. Default is 'src'.
|
||||||
out-folder
|
out-folder
|
||||||
the name of the output folder. Default is 'bin'.
|
the name of the output folder. Default is 'bin'.
|
||||||
|
|
||||||
Properties related to the SDK location or the project target should be updated
|
Properties related to the SDK location or the project target should be updated
|
||||||
using the 'android' tool with the 'update' action.
|
using the 'android' tool with the 'update' action.
|
||||||
|
|
||||||
This file is an integral part of the build system for your application and
|
This file is an integral part of the build system for your application and
|
||||||
should be checked in in Version Control Systems.
|
should be checked in in Version Control Systems.
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<property file="build.properties"/>
|
<property file="build.properties"/>
|
||||||
|
|
||||||
<!-- The default.properties file is created and updated by the 'android' tool, as well
|
<!-- The default.properties file is created and updated by the 'android' tool, as well
|
||||||
as ADT.
|
as ADT.
|
||||||
This file is an integral part of the build system for your application and
|
This file is an integral part of the build system for your application and
|
||||||
should be checked in in Version Control Systems. -->
|
should be checked in in Version Control Systems. -->
|
||||||
<property file="default.properties"/>
|
<property file="default.properties"/>
|
||||||
|
|
||||||
<!-- Custom Android task to deal with the project target, and import the proper rules.
|
<!-- Custom Android task to deal with the project target, and import the proper rules.
|
||||||
This requires ant 1.6.0 or above. -->
|
This requires ant 1.6.0 or above. -->
|
||||||
<path id="android.antlibs">
|
<path id="android.antlibs">
|
||||||
<pathelement path="${sdk-location}/tools/lib/anttasks.jar" />
|
<pathelement path="${sdk-location}/tools/lib/anttasks.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/sdklib.jar" />
|
<pathelement path="${sdk-location}/tools/lib/sdklib.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/androidprefs.jar" />
|
<pathelement path="${sdk-location}/tools/lib/androidprefs.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/apkbuilder.jar" />
|
<pathelement path="${sdk-location}/tools/lib/apkbuilder.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/jarutils.jar" />
|
<pathelement path="${sdk-location}/tools/lib/jarutils.jar" />
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
<taskdef name="setup"
|
<taskdef name="setup"
|
||||||
classname="com.android.ant.SetupTask"
|
classname="com.android.ant.SetupTask"
|
||||||
classpathref="android.antlibs"/>
|
classpathref="android.antlibs"/>
|
||||||
|
|
||||||
<!-- Execute the Android Setup task that will setup some properties specific to the target,
|
<!-- Execute the Android Setup task that will setup some properties specific to the target,
|
||||||
and import the rules files.
|
and import the rules files.
|
||||||
To customize the rules, copy/paste them below the task, and disable import by setting
|
To customize the rules, copy/paste them below the task, and disable import by setting
|
||||||
the import attribute to false:
|
the import attribute to false:
|
||||||
<setup import="false" />
|
<setup import="false" />
|
||||||
|
|
||||||
This will ensure that the properties are setup correctly but that your customized
|
This will ensure that the properties are setup correctly but that your customized
|
||||||
targets are used.
|
targets are used.
|
||||||
-->
|
-->
|
||||||
<setup import="false"/>
|
<setup import="false"/>
|
||||||
|
|
||||||
<import file="build-imported.xml"/>
|
<import file="build-imported.xml"/>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
28
docs/android-examples/LunarLander/src/com/example/android/lunarlander/LunarThread.scala
Executable file → Normal file
|
@ -1,12 +1,12 @@
|
||||||
package com.example.android.lunarlander
|
package com.example.android.lunarlander
|
||||||
|
|
||||||
import _root_.android.content.Context
|
import _root_.android.content.Context
|
||||||
import _root_.android.graphics.{Bitmap, BitmapFactory, Canvas, Paint, RectF}
|
import _root_.android.graphics.{Bitmap, BitmapFactory, Canvas, Paint, RectF}
|
||||||
import _root_.android.graphics.drawable.Drawable
|
import _root_.android.graphics.drawable.Drawable
|
||||||
import _root_.android.os.{Bundle, Handler, Message}
|
import _root_.android.os.{Bundle, Handler, Message}
|
||||||
import _root_.android.view.{KeyEvent, SurfaceHolder, View}
|
import _root_.android.view.{KeyEvent, SurfaceHolder, View}
|
||||||
|
|
||||||
|
|
||||||
private[lunarlander] object LunarThread {
|
private[lunarlander] object LunarThread {
|
||||||
|
|
||||||
/** Difficulty setting constants */
|
/** Difficulty setting constants */
|
||||||
|
@ -62,7 +62,7 @@ private[lunarlander] object LunarThread {
|
||||||
private val KEY_Y = "mY"
|
private val KEY_Y = "mY"
|
||||||
}
|
}
|
||||||
|
|
||||||
private[lunarlander] class LunarThread(mSurfaceHolder: SurfaceHolder,
|
private[lunarlander] class LunarThread(mSurfaceHolder: SurfaceHolder,
|
||||||
mContext: Context,
|
mContext: Context,
|
||||||
mHandler: Handler) extends Thread {
|
mHandler: Handler) extends Thread {
|
||||||
import LunarThread._
|
import LunarThread._
|
||||||
|
@ -153,8 +153,8 @@ private[lunarlander] class LunarThread(mSurfaceHolder: SurfaceHolder,
|
||||||
/** X/Y of lander center. */
|
/** X/Y of lander center. */
|
||||||
private var mX = 0.0
|
private var mX = 0.0
|
||||||
private var mY = 0.0
|
private var mY = 0.0
|
||||||
|
|
||||||
initLunarThread()
|
initLunarThread()
|
||||||
|
|
||||||
private def initLunarThread() {
|
private def initLunarThread() {
|
||||||
val res = mContext.getResources()
|
val res = mContext.getResources()
|
||||||
|
@ -227,7 +227,7 @@ private[lunarlander] class LunarThread(mSurfaceHolder: SurfaceHolder,
|
||||||
// Figure initial spot for landing, not too near center
|
// Figure initial spot for landing, not too near center
|
||||||
do {
|
do {
|
||||||
mGoalX = (Math.random * (mCanvasWidth - mGoalWidth)).toInt
|
mGoalX = (Math.random * (mCanvasWidth - mGoalWidth)).toInt
|
||||||
}
|
}
|
||||||
while (Math.abs(mGoalX - (mX - mLanderWidth / 2)) <= mCanvasHeight / 6)
|
while (Math.abs(mGoalX - (mX - mLanderWidth / 2)) <= mCanvasHeight / 6)
|
||||||
|
|
||||||
mLastTime = System.currentTimeMillis + 100
|
mLastTime = System.currentTimeMillis + 100
|
||||||
|
@ -676,4 +676,4 @@ private[lunarlander] class LunarThread(mSurfaceHolder: SurfaceHolder,
|
||||||
setState(result, message)
|
setState(result, message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
0
docs/android-examples/LunarLander/tests/src/com/example/android/lunarlander/LunarLanderTest.java
Executable file → Normal file
|
@ -1,150 +1,150 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project name="imported" default="install">
|
<project name="imported" default="install">
|
||||||
|
|
||||||
<property environment="env"/>
|
<property environment="env"/>
|
||||||
|
|
||||||
<!-- Android SDK -->
|
<!-- Android SDK -->
|
||||||
<condition property="_dx" value="dx.bat" else="dx">
|
<condition property="_dx" value="dx.bat" else="dx">
|
||||||
<os family="windows"/>
|
<os family="windows"/>
|
||||||
</condition>
|
</condition>
|
||||||
<condition property="_apkbuilder" value="apkbuilder.bat" else="apkbuilder">
|
<condition property="_apkbuilder" value="apkbuilder.bat" else="apkbuilder">
|
||||||
<os family="windows"/>
|
<os family="windows"/>
|
||||||
</condition>
|
</condition>
|
||||||
<property name="android.jar" value="${sdk-location}/platforms/android-1.5/android.jar"/>
|
<property name="android.jar" value="${sdk-location}/platforms/android-1.5/android.jar"/>
|
||||||
<property name="maps.jar" value="${sdk-location}/add-ons/maps.jar"/>
|
<property name="maps.jar" value="${sdk-location}/add-ons/maps.jar"/>
|
||||||
<property name="dx.cmd" value="${sdk-location}/platforms/android-1.5/tools/${_dx}"/>
|
<property name="dx.cmd" value="${sdk-location}/platforms/android-1.5/tools/${_dx}"/>
|
||||||
<property name="aapt.cmd" value="${sdk-location}/platforms/android-1.5/tools/aapt"/>
|
<property name="aapt.cmd" value="${sdk-location}/platforms/android-1.5/tools/aapt"/>
|
||||||
<property name="apkbuilder.cmd" value="${sdk-location}/tools/${_apkbuilder}"/>
|
<property name="apkbuilder.cmd" value="${sdk-location}/tools/${_apkbuilder}"/>
|
||||||
<property name="adb.cmd" value="${sdk-location}/tools/adb"/>
|
<property name="adb.cmd" value="${sdk-location}/tools/adb"/>
|
||||||
|
|
||||||
<!-- Scala SDK -->
|
<!-- Scala SDK -->
|
||||||
<property name="scala-compiler.jar" value="${env.SCALA_HOME}/lib/scala-compiler.jar"/>
|
<property name="scala-compiler.jar" value="${env.SCALA_HOME}/lib/scala-compiler.jar"/>
|
||||||
<property name="scala-library.jar" value="${env.SCALA_HOME}/lib/scala-library.jar"/>
|
<property name="scala-library.jar" value="${env.SCALA_HOME}/lib/scala-library.jar"/>
|
||||||
|
|
||||||
<!-- Android build files -->
|
<!-- Android build files -->
|
||||||
<property name="manifest.xml" value="${basedir}/AndroidManifest.xml"/>
|
<property name="manifest.xml" value="${basedir}/AndroidManifest.xml"/>
|
||||||
<xmlproperty file="${manifest.xml}" collapseAttributes="true"/>
|
<xmlproperty file="${manifest.xml}" collapseAttributes="true"/>
|
||||||
<property name="classes.dex" value="${basedir}/bin/classes.dex"/>
|
<property name="classes.dex" value="${basedir}/bin/classes.dex"/>
|
||||||
<property name="empty.apk" value="${basedir}/bin/${ant.project.name}.ap_"/>
|
<property name="empty.apk" value="${basedir}/bin/${ant.project.name}.ap_"/>
|
||||||
<property name="basename.apk" value="${ant.project.name}-debug.apk"/>
|
<property name="basename.apk" value="${ant.project.name}-debug.apk"/>
|
||||||
<property name="package.apk" value="${basedir}/bin/${basename.apk}"/>
|
<property name="package.apk" value="${basedir}/bin/${basename.apk}"/>
|
||||||
|
|
||||||
<taskdef name="apkbuilder"
|
<taskdef name="apkbuilder"
|
||||||
classname="com.android.ant.ApkBuilderTask"
|
classname="com.android.ant.ApkBuilderTask"
|
||||||
classpathref="android.antlibs"
|
classpathref="android.antlibs"
|
||||||
/>
|
/>
|
||||||
<path id="scala.path">
|
<path id="scala.path">
|
||||||
<pathelement path="${scala-compiler.jar}"/>
|
<pathelement path="${scala-compiler.jar}"/>
|
||||||
<pathelement path="${scala-library.jar}"/>
|
<pathelement path="${scala-library.jar}"/>
|
||||||
</path>
|
</path>
|
||||||
<taskdef
|
<taskdef
|
||||||
resource="scala/tools/ant/antlib.xml"
|
resource="scala/tools/ant/antlib.xml"
|
||||||
classpathref="scala.path"
|
classpathref="scala.path"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<uptodate property="gen.uptodate" targetfile="${basedir}/gen/.gen-complete">
|
<uptodate property="gen.uptodate" targetfile="${basedir}/gen/.gen-complete">
|
||||||
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="compile.uptodate" targetfile="${basedir}/bin/.compile-complete">
|
<uptodate property="compile.uptodate" targetfile="${basedir}/bin/.compile-complete">
|
||||||
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="dex.uptodate" targetfile="${classes.dex}">
|
<uptodate property="dex.uptodate" targetfile="${classes.dex}">
|
||||||
<srcfiles dir="${basedir}/bin/classes" includes="**/*.class"/>
|
<srcfiles dir="${basedir}/bin/classes" includes="**/*.class"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="pkg.uptodate" targetfile="${empty.apk}">
|
<uptodate property="pkg.uptodate" targetfile="${empty.apk}">
|
||||||
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="apk.uptodate" targetfile="${package.apk}">
|
<uptodate property="apk.uptodate" targetfile="${package.apk}">
|
||||||
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
|
|
||||||
<target name="resource-src" unless="gen.uptodate">
|
<target name="resource-src" unless="gen.uptodate">
|
||||||
<mkdir dir="${basedir}/gen"/>
|
<mkdir dir="${basedir}/gen"/>
|
||||||
<echo message="Generating R.java / Manifest.java from the resources..."/>
|
<echo message="Generating R.java / Manifest.java from the resources..."/>
|
||||||
<exec executable="${aapt.cmd}">
|
<exec executable="${aapt.cmd}">
|
||||||
<arg line="package -m -J '${basedir}/gen' -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}'"/>
|
<arg line="package -m -J '${basedir}/gen' -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
<touch file="${basedir}/gen/.gen-complete" verbose="no"/>
|
<touch file="${basedir}/gen/.gen-complete" verbose="no"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="compile" depends="resource-src" unless="compile.uptodate">
|
<target name="compile" depends="resource-src" unless="compile.uptodate">
|
||||||
<path id="boot.path">
|
<path id="boot.path">
|
||||||
<pathelement location="${android.jar}"/>
|
<pathelement location="${android.jar}"/>
|
||||||
<pathelement location="${maps.jar}"/>
|
<pathelement location="${maps.jar}"/>
|
||||||
</path>
|
</path>
|
||||||
<mkdir dir="${basedir}/bin/classes"/>
|
<mkdir dir="${basedir}/bin/classes"/>
|
||||||
<javac
|
<javac
|
||||||
srcdir="${basedir}/src${path.separator}${basedir}/gen" includes="**/*.java"
|
srcdir="${basedir}/src${path.separator}${basedir}/gen" includes="**/*.java"
|
||||||
destdir="${basedir}/bin/classes" bootclasspathref="boot.path"
|
destdir="${basedir}/bin/classes" bootclasspathref="boot.path"
|
||||||
target="1.5" source="1.5" encoding="ascii">
|
target="1.5" source="1.5" encoding="ascii">
|
||||||
<classpath>
|
<classpath>
|
||||||
<pathelement location="${android.jar}"/>
|
<pathelement location="${android.jar}"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
</javac>
|
</javac>
|
||||||
<scalac
|
<scalac
|
||||||
srcdir="${basedir}/src" includes="**/*.scala"
|
srcdir="${basedir}/src" includes="**/*.scala"
|
||||||
destdir="${basedir}/bin/classes" deprecation="on">
|
destdir="${basedir}/bin/classes" deprecation="on">
|
||||||
<classpath>
|
<classpath>
|
||||||
<pathelement location="${scala-library.jar}"/>
|
<pathelement location="${scala-library.jar}"/>
|
||||||
<pathelement location="${android.jar}"/>
|
<pathelement location="${android.jar}"/>
|
||||||
<pathelement location="${basedir}/bin/classes"/>
|
<pathelement location="${basedir}/bin/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
</scalac>
|
</scalac>
|
||||||
<touch file="${basedir}/bin/.compile-complete" verbose="no"/>
|
<touch file="${basedir}/bin/.compile-complete" verbose="no"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="dex" depends="compile" unless="dex.uptodate">
|
<target name="dex" depends="compile" unless="dex.uptodate">
|
||||||
<echo message="Converting compiled files and external libraries into bin/classes.dex..."/>
|
<echo message="Converting compiled files and external libraries into bin/classes.dex..."/>
|
||||||
<!-- IMPORTANT ! -->
|
<!-- IMPORTANT ! -->
|
||||||
<!-- in shell script /opt/android/platforms/android-1.5/tools/dx -->
|
<!-- in shell script /opt/android/platforms/android-1.5/tools/dx -->
|
||||||
<!-- add the following code on line 60: javaOpts="-Xmx768M" -->
|
<!-- add the following code on line 60: javaOpts="-Xmx768M" -->
|
||||||
<exec executable="${dx.cmd}">
|
<exec executable="${dx.cmd}">
|
||||||
<arg line="--dex --no-optimize --output='${classes.dex}' '${basedir}/bin/classes' '${scala-library.jar}'"/>
|
<arg line="--dex --no-optimize --output='${classes.dex}' '${basedir}/bin/classes' '${scala-library.jar}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="package-resources" depends="dex" unless="pkg.uptodate">
|
<target name="package-resources" depends="dex" unless="pkg.uptodate">
|
||||||
<echo message="Packaging resources"/>
|
<echo message="Packaging resources"/>
|
||||||
<exec executable="${aapt.cmd}">
|
<exec executable="${aapt.cmd}">
|
||||||
<arg line="package -f -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}' -F '${empty.apk}'"/>
|
<arg line="package -f -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}' -F '${empty.apk}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="debug" depends="package-resources" unless="apk.uptodate">
|
<target name="debug" depends="package-resources" unless="apk.uptodate">
|
||||||
<apkbuilder
|
<apkbuilder
|
||||||
basename="${ant.project.name}" outfolder="${basedir}/bin"
|
basename="${ant.project.name}" outfolder="${basedir}/bin"
|
||||||
signed="true" verbose="true"
|
signed="true" verbose="true"
|
||||||
/>
|
/>
|
||||||
<exec executable="${apkbuilder.cmd}">
|
<exec executable="${apkbuilder.cmd}">
|
||||||
<arg line="'${package.apk}' -v -z '${empty.apk}' -f '${classes.dex}'"/>
|
<arg line="'${package.apk}' -v -z '${empty.apk}' -f '${classes.dex}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="release">
|
<target name="release">
|
||||||
<echo message="Sorry. Not yet implemented"/>
|
<echo message="Sorry. Not yet implemented"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="install" depends="debug">
|
<target name="install" depends="debug">
|
||||||
<echo message="Installing bin/${basename.apk} onto default emulator..."/>
|
<echo message="Installing bin/${basename.apk} onto default emulator..."/>
|
||||||
<exec executable="${adb.cmd}">
|
<exec executable="${adb.cmd}">
|
||||||
<arg line="install -r '${package.apk}'"/>
|
<arg line="install -r '${package.apk}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="uninstall">
|
<target name="uninstall">
|
||||||
<exec executable="${adb.cmd}">
|
<exec executable="${adb.cmd}">
|
||||||
<arg line="uninstall '${manifest.package}'"/>
|
<arg line="uninstall '${manifest.package}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="help">
|
<target name="help">
|
||||||
<echo message="Android Ant Build. Available targets:"/>
|
<echo message="Android Ant Build. Available targets:"/>
|
||||||
<echo message=" help: Display this help."/>
|
<echo message=" help: Display this help."/>
|
||||||
<echo message=" debug: Builds the application and sign it with a debug key."/>
|
<echo message=" debug: Builds the application and sign it with a debug key."/>
|
||||||
<echo message=" install: (Re-)Install the debug package onto a running emulator or device."/>
|
<echo message=" install: (Re-)Install the debug package onto a running emulator or device."/>
|
||||||
<echo message=" uninstall: Uninstall the application from a running emulator or device."/>
|
<echo message=" uninstall: Uninstall the application from a running emulator or device."/>
|
||||||
<echo message=" clean: Clean up build files from project."/>
|
<echo message=" clean: Clean up build files from project."/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<macrodef name="remove">
|
<macrodef name="remove">
|
||||||
<attribute name="dir"/>
|
<attribute name="dir"/>
|
||||||
|
@ -153,10 +153,10 @@
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
|
|
||||||
<target name="clean" description="clean up">
|
<target name="clean" description="clean up">
|
||||||
<echo message="Cleaning project '${ant.project.name}'..."/>
|
<echo message="Cleaning project '${ant.project.name}'..."/>
|
||||||
<remove dir="${basedir}/bin"/>
|
<remove dir="${basedir}/bin"/>
|
||||||
<remove dir="${basedir}/gen"/>
|
<remove dir="${basedir}/gen"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -1,64 +1,64 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project name="NotePad" default="help">
|
<project name="NotePad" default="help">
|
||||||
|
|
||||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
<!-- The local.properties file is created and updated by the 'android' tool.
|
||||||
It contain the path to the SDK. It should *NOT* be checked in in Version
|
It contain the path to the SDK. It should *NOT* be checked in in Version
|
||||||
Control Systems. -->
|
Control Systems. -->
|
||||||
<property file="local.properties"/>
|
<property file="local.properties"/>
|
||||||
|
|
||||||
<!-- The build.properties file can be created by you and is never touched
|
<!-- The build.properties file can be created by you and is never touched
|
||||||
by the 'android' tool. This is the place to change some of the default property values
|
by the 'android' tool. This is the place to change some of the default property values
|
||||||
used by the Ant rules.
|
used by the Ant rules.
|
||||||
Here are some properties you may want to change/update:
|
Here are some properties you may want to change/update:
|
||||||
|
|
||||||
application-package
|
application-package
|
||||||
the name of your application package as defined in the manifest. Used by the
|
the name of your application package as defined in the manifest. Used by the
|
||||||
'uninstall' rule.
|
'uninstall' rule.
|
||||||
source-folder
|
source-folder
|
||||||
the name of the source folder. Default is 'src'.
|
the name of the source folder. Default is 'src'.
|
||||||
out-folder
|
out-folder
|
||||||
the name of the output folder. Default is 'bin'.
|
the name of the output folder. Default is 'bin'.
|
||||||
|
|
||||||
Properties related to the SDK location or the project target should be updated
|
Properties related to the SDK location or the project target should be updated
|
||||||
using the 'android' tool with the 'update' action.
|
using the 'android' tool with the 'update' action.
|
||||||
|
|
||||||
This file is an integral part of the build system for your application and
|
This file is an integral part of the build system for your application and
|
||||||
should be checked in in Version Control Systems.
|
should be checked in in Version Control Systems.
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<property file="build.properties"/>
|
<property file="build.properties"/>
|
||||||
|
|
||||||
<!-- The default.properties file is created and updated by the 'android' tool, as well
|
<!-- The default.properties file is created and updated by the 'android' tool, as well
|
||||||
as ADT.
|
as ADT.
|
||||||
This file is an integral part of the build system for your application and
|
This file is an integral part of the build system for your application and
|
||||||
should be checked in in Version Control Systems. -->
|
should be checked in in Version Control Systems. -->
|
||||||
<property file="default.properties"/>
|
<property file="default.properties"/>
|
||||||
|
|
||||||
<!-- Custom Android task to deal with the project target, and import the proper rules.
|
<!-- Custom Android task to deal with the project target, and import the proper rules.
|
||||||
This requires ant 1.6.0 or above. -->
|
This requires ant 1.6.0 or above. -->
|
||||||
<path id="android.antlibs">
|
<path id="android.antlibs">
|
||||||
<pathelement path="${sdk-location}/tools/lib/anttasks.jar" />
|
<pathelement path="${sdk-location}/tools/lib/anttasks.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/sdklib.jar" />
|
<pathelement path="${sdk-location}/tools/lib/sdklib.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/androidprefs.jar" />
|
<pathelement path="${sdk-location}/tools/lib/androidprefs.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/apkbuilder.jar" />
|
<pathelement path="${sdk-location}/tools/lib/apkbuilder.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/jarutils.jar" />
|
<pathelement path="${sdk-location}/tools/lib/jarutils.jar" />
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
<taskdef name="setup"
|
<taskdef name="setup"
|
||||||
classname="com.android.ant.SetupTask"
|
classname="com.android.ant.SetupTask"
|
||||||
classpathref="android.antlibs"/>
|
classpathref="android.antlibs"/>
|
||||||
|
|
||||||
<!-- Execute the Android Setup task that will setup some properties specific to the target,
|
<!-- Execute the Android Setup task that will setup some properties specific to the target,
|
||||||
and import the rules files.
|
and import the rules files.
|
||||||
To customize the rules, copy/paste them below the task, and disable import by setting
|
To customize the rules, copy/paste them below the task, and disable import by setting
|
||||||
the import attribute to false:
|
the import attribute to false:
|
||||||
<setup import="false" />
|
<setup import="false" />
|
||||||
|
|
||||||
This will ensure that the properties are setup correctly but that your customized
|
This will ensure that the properties are setup correctly but that your customized
|
||||||
targets are used.
|
targets are used.
|
||||||
-->
|
-->
|
||||||
<setup import="false"/>
|
<setup import="false"/>
|
||||||
|
|
||||||
<import file="build-imported.xml"/>
|
<import file="build-imported.xml"/>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
|
@ -1,158 +1,158 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project name="imported" default="help">
|
<project name="imported" default="help">
|
||||||
|
|
||||||
<property environment="env"/>
|
<property environment="env"/>
|
||||||
|
|
||||||
<!-- Android SDK -->
|
<!-- Android SDK -->
|
||||||
<condition property="_dx" value="dx.bat" else="dx">
|
<condition property="_dx" value="dx.bat" else="dx">
|
||||||
<os family="windows"/>
|
<os family="windows"/>
|
||||||
</condition>
|
</condition>
|
||||||
<condition property="_apkbuilder" value="apkbuilder.bat" else="apkbuilder">
|
<condition property="_apkbuilder" value="apkbuilder.bat" else="apkbuilder">
|
||||||
<os family="windows"/>
|
<os family="windows"/>
|
||||||
</condition>
|
</condition>
|
||||||
<property name="android.jar" value="${sdk-location}/platforms/android-1.5/android.jar"/>
|
<property name="android.jar" value="${sdk-location}/platforms/android-1.5/android.jar"/>
|
||||||
<property name="maps.jar" value="${sdk-location}/add-ons/maps.jar"/>
|
<property name="maps.jar" value="${sdk-location}/add-ons/maps.jar"/>
|
||||||
<property name="dx.cmd" value="${sdk-location}/platforms/android-1.5/tools/${_dx}"/>
|
<property name="dx.cmd" value="${sdk-location}/platforms/android-1.5/tools/${_dx}"/>
|
||||||
<property name="aapt.cmd" value="${sdk-location}/platforms/android-1.5/tools/aapt"/>
|
<property name="aapt.cmd" value="${sdk-location}/platforms/android-1.5/tools/aapt"/>
|
||||||
<property name="apkbuilder.cmd" value="${sdk-location}/tools/${_apkbuilder}"/>
|
<property name="apkbuilder.cmd" value="${sdk-location}/tools/${_apkbuilder}"/>
|
||||||
<property name="adb.cmd" value="${sdk-location}/tools/adb"/>
|
<property name="adb.cmd" value="${sdk-location}/tools/adb"/>
|
||||||
|
|
||||||
<!-- Scala SDK -->
|
<!-- Scala SDK -->
|
||||||
<property name="scala-compiler.jar" value="${env.SCALA_HOME}/lib/scala-compiler.jar"/>
|
<property name="scala-compiler.jar" value="${env.SCALA_HOME}/lib/scala-compiler.jar"/>
|
||||||
<property name="scala-library.jar" value="${env.SCALA_HOME}/lib/scala-library.jar"/>
|
<property name="scala-library.jar" value="${env.SCALA_HOME}/lib/scala-library.jar"/>
|
||||||
|
|
||||||
<!-- Android build files -->
|
<!-- Android build files -->
|
||||||
<property name="manifest.xml" value="${basedir}/AndroidManifest.xml"/>
|
<property name="manifest.xml" value="${basedir}/AndroidManifest.xml"/>
|
||||||
<xmlproperty file="${manifest.xml}" collapseAttributes="true"/>
|
<xmlproperty file="${manifest.xml}" collapseAttributes="true"/>
|
||||||
<property name="classes.dex" value="${basedir}/bin/classes.dex"/>
|
<property name="classes.dex" value="${basedir}/bin/classes.dex"/>
|
||||||
<property name="empty.apk" value="${basedir}/bin/${ant.project.name}.ap_"/>
|
<property name="empty.apk" value="${basedir}/bin/${ant.project.name}.ap_"/>
|
||||||
<property name="basename.apk" value="${ant.project.name}-debug.apk"/>
|
<property name="basename.apk" value="${ant.project.name}-debug.apk"/>
|
||||||
<property name="package.apk" value="${basedir}/bin/${basename.apk}"/>
|
<property name="package.apk" value="${basedir}/bin/${basename.apk}"/>
|
||||||
|
|
||||||
<taskdef name="apkbuilder"
|
<taskdef name="apkbuilder"
|
||||||
classname="com.android.ant.ApkBuilderTask"
|
classname="com.android.ant.ApkBuilderTask"
|
||||||
classpathref="android.antlibs"
|
classpathref="android.antlibs"
|
||||||
/>
|
/>
|
||||||
<path id="scala.path">
|
<path id="scala.path">
|
||||||
<pathelement path="${scala-compiler.jar}"/>
|
<pathelement path="${scala-compiler.jar}"/>
|
||||||
<pathelement path="${scala-library.jar}"/>
|
<pathelement path="${scala-library.jar}"/>
|
||||||
</path>
|
</path>
|
||||||
<taskdef
|
<taskdef
|
||||||
resource="scala/tools/ant/antlib.xml"
|
resource="scala/tools/ant/antlib.xml"
|
||||||
classpathref="scala.path"
|
classpathref="scala.path"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<uptodate property="gen.uptodate" targetfile="${basedir}/gen/.gen-complete">
|
<uptodate property="gen.uptodate" targetfile="${basedir}/gen/.gen-complete">
|
||||||
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="compile.uptodate" targetfile="${basedir}/bin/.compile-complete">
|
<uptodate property="compile.uptodate" targetfile="${basedir}/bin/.compile-complete">
|
||||||
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="dex.uptodate" targetfile="${classes.dex}">
|
<uptodate property="dex.uptodate" targetfile="${classes.dex}">
|
||||||
<srcfiles dir="${basedir}/bin/classes" includes="**/*.class"/>
|
<srcfiles dir="${basedir}/bin/classes" includes="**/*.class"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="pkg.uptodate" targetfile="${empty.apk}">
|
<uptodate property="pkg.uptodate" targetfile="${empty.apk}">
|
||||||
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="apk.uptodate" targetfile="${package.apk}">
|
<uptodate property="apk.uptodate" targetfile="${package.apk}">
|
||||||
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
|
|
||||||
<target name="resource-src" unless="gen.uptodate">
|
<target name="resource-src" unless="gen.uptodate">
|
||||||
<mkdir dir="${basedir}/gen"/>
|
<mkdir dir="${basedir}/gen"/>
|
||||||
<echo message="Generating R.java / Manifest.java from the resources..."/>
|
<echo message="Generating R.java / Manifest.java from the resources..."/>
|
||||||
<exec executable="${aapt.cmd}">
|
<exec executable="${aapt.cmd}">
|
||||||
<arg line="package -m -J '${basedir}/gen' -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}'"/>
|
<arg line="package -m -J '${basedir}/gen' -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
<touch file="${basedir}/gen/.gen-complete" verbose="no"/>
|
<touch file="${basedir}/gen/.gen-complete" verbose="no"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="compile" depends="resource-src" unless="compile.uptodate">
|
<target name="compile" depends="resource-src" unless="compile.uptodate">
|
||||||
<path id="boot.path">
|
<path id="boot.path">
|
||||||
<pathelement location="${android.jar}"/>
|
<pathelement location="${android.jar}"/>
|
||||||
<pathelement location="${maps.jar}"/>
|
<pathelement location="${maps.jar}"/>
|
||||||
</path>
|
</path>
|
||||||
<mkdir dir="${basedir}/bin/classes"/>
|
<mkdir dir="${basedir}/bin/classes"/>
|
||||||
<javac
|
<javac
|
||||||
srcdir="${basedir}/src${path.separator}${basedir}/gen" includes="**/*.java"
|
srcdir="${basedir}/src${path.separator}${basedir}/gen" includes="**/*.java"
|
||||||
destdir="${basedir}/bin/classes" bootclasspathref="boot.path"
|
destdir="${basedir}/bin/classes" bootclasspathref="boot.path"
|
||||||
target="1.5" source="1.5" encoding="ascii">
|
target="1.5" source="1.5" encoding="ascii">
|
||||||
<classpath>
|
<classpath>
|
||||||
<pathelement location="${android.jar}"/>
|
<pathelement location="${android.jar}"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
</javac>
|
</javac>
|
||||||
<scalac
|
<scalac
|
||||||
srcdir="${basedir}/src" includes="**/*.scala"
|
srcdir="${basedir}/src" includes="**/*.scala"
|
||||||
destdir="${basedir}/bin/classes" deprecation="on">
|
destdir="${basedir}/bin/classes" deprecation="on">
|
||||||
<classpath>
|
<classpath>
|
||||||
<pathelement location="${scala-library.jar}"/>
|
<pathelement location="${scala-library.jar}"/>
|
||||||
<pathelement location="${android.jar}"/>
|
<pathelement location="${android.jar}"/>
|
||||||
<pathelement location="${basedir}/bin/classes"/>
|
<pathelement location="${basedir}/bin/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
</scalac>
|
</scalac>
|
||||||
<touch file="${basedir}/bin/.compile-complete" verbose="no"/>
|
<touch file="${basedir}/bin/.compile-complete" verbose="no"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="dex" depends="compile" unless="dex.uptodate">
|
<target name="dex" depends="compile" unless="dex.uptodate">
|
||||||
<echo message="Converting compiled files and external libraries into bin/classes.dex..."/>
|
<echo message="Converting compiled files and external libraries into bin/classes.dex..."/>
|
||||||
<!-- IMPORTANT ! -->
|
<!-- IMPORTANT ! -->
|
||||||
<!-- in shell script /opt/android/platforms/android-1.5/tools/dx -->
|
<!-- in shell script /opt/android/platforms/android-1.5/tools/dx -->
|
||||||
<!-- add the following code on line 60: javaOpts="-Xmx768M" -->
|
<!-- add the following code on line 60: javaOpts="-Xmx768M" -->
|
||||||
<exec executable="${dx.cmd}">
|
<exec executable="${dx.cmd}">
|
||||||
<arg line="--dex --no-optimize --output='${classes.dex}' '${basedir}/bin/classes' '${scala-library.jar}'"/>
|
<arg line="--dex --no-optimize --output='${classes.dex}' '${basedir}/bin/classes' '${scala-library.jar}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="package-resources" depends="dex" unless="pkg.uptodate">
|
<target name="package-resources" depends="dex" unless="pkg.uptodate">
|
||||||
<echo message="Packaging resources"/>
|
<echo message="Packaging resources"/>
|
||||||
<exec executable="${aapt.cmd}">
|
<exec executable="${aapt.cmd}">
|
||||||
<arg line="package -f -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}' -F '${empty.apk}'"/>
|
<arg line="package -f -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}' -F '${empty.apk}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="debug" depends="package-resources" unless="apk.uptodate">
|
<target name="debug" depends="package-resources" unless="apk.uptodate">
|
||||||
<apkbuilder
|
<apkbuilder
|
||||||
basename="${ant.project.name}" outfolder="${basedir}/bin"
|
basename="${ant.project.name}" outfolder="${basedir}/bin"
|
||||||
signed="true" verbose="true"
|
signed="true" verbose="true"
|
||||||
/>
|
/>
|
||||||
<exec executable="${apkbuilder.cmd}">
|
<exec executable="${apkbuilder.cmd}">
|
||||||
<arg line="'${package.apk}' -v -z '${empty.apk}' -f '${classes.dex}'"/>
|
<arg line="'${package.apk}' -v -z '${empty.apk}' -f '${classes.dex}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="release">
|
<target name="release">
|
||||||
<echo message="Sorry. Not yet implemented"/>
|
<echo message="Sorry. Not yet implemented"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="install" depends="debug">
|
<target name="install" depends="debug">
|
||||||
<echo message="Installing bin/${basename.apk} onto default emulator..."/>
|
<echo message="Installing bin/${basename.apk} onto default emulator..."/>
|
||||||
<exec executable="${adb.cmd}">
|
<exec executable="${adb.cmd}">
|
||||||
<arg line="install '${package.apk}'"/>
|
<arg line="install '${package.apk}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="reinstall" depends="debug">
|
<target name="reinstall" depends="debug">
|
||||||
<echo message="Reinstalling bin/${basename.apk} onto default emulator..."/>
|
<echo message="Reinstalling bin/${basename.apk} onto default emulator..."/>
|
||||||
<exec executable="${adb.cmd}">
|
<exec executable="${adb.cmd}">
|
||||||
<arg line="install -r '${package.apk}'"/>
|
<arg line="install -r '${package.apk}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="uninstall">
|
||||||
|
<exec executable="${adb.cmd}">
|
||||||
|
<arg line="uninstall '${manifest.package}'"/>
|
||||||
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="help">
|
||||||
|
<echo message="Android Ant Build. Available targets:"/>
|
||||||
|
<echo message=" help: Display this help."/>
|
||||||
|
<echo message=" debug: Builds the application and sign it with a debug key."/>
|
||||||
|
<echo message=" install: Install the debug package onto a running emulator or device."/>
|
||||||
|
<echo message=" reinstall: Reinstall the debug package onto a running emulator or device."/>
|
||||||
|
<echo message=" uninstall: Uninstall the application from a running emulator or device."/>
|
||||||
|
<echo message=" clean: Clean up build files from project."/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="uninstall">
|
|
||||||
<exec executable="${adb.cmd}">
|
|
||||||
<arg line="uninstall '${manifest.package}'"/>
|
|
||||||
</exec>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="help">
|
|
||||||
<echo message="Android Ant Build. Available targets:"/>
|
|
||||||
<echo message=" help: Display this help."/>
|
|
||||||
<echo message=" debug: Builds the application and sign it with a debug key."/>
|
|
||||||
<echo message=" install: Install the debug package onto a running emulator or device."/>
|
|
||||||
<echo message=" reinstall: Reinstall the debug package onto a running emulator or device."/>
|
|
||||||
<echo message=" uninstall: Uninstall the application from a running emulator or device."/>
|
|
||||||
<echo message=" clean: Clean up build files from project."/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<macrodef name="remove">
|
<macrodef name="remove">
|
||||||
<attribute name="dir"/>
|
<attribute name="dir"/>
|
||||||
|
@ -161,10 +161,10 @@
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
|
|
||||||
<target name="clean" description="clean up">
|
<target name="clean" description="clean up">
|
||||||
<echo message="Cleaning project '${ant.project.name}'..."/>
|
<echo message="Cleaning project '${ant.project.name}'..."/>
|
||||||
<remove dir="${basedir}/bin"/>
|
<remove dir="${basedir}/bin"/>
|
||||||
<remove dir="${basedir}/gen"/>
|
<remove dir="${basedir}/gen"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -1,64 +1,64 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project name="PhoneDialer" default="help">
|
<project name="PhoneDialer" default="help">
|
||||||
|
|
||||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
<!-- The local.properties file is created and updated by the 'android' tool.
|
||||||
It contain the path to the SDK. It should *NOT* be checked in in Version
|
It contain the path to the SDK. It should *NOT* be checked in in Version
|
||||||
Control Systems. -->
|
Control Systems. -->
|
||||||
<property file="local.properties"/>
|
<property file="local.properties"/>
|
||||||
|
|
||||||
<!-- The build.properties file can be created by you and is never touched
|
<!-- The build.properties file can be created by you and is never touched
|
||||||
by the 'android' tool. This is the place to change some of the default property values
|
by the 'android' tool. This is the place to change some of the default property values
|
||||||
used by the Ant rules.
|
used by the Ant rules.
|
||||||
Here are some properties you may want to change/update:
|
Here are some properties you may want to change/update:
|
||||||
|
|
||||||
application-package
|
application-package
|
||||||
the name of your application package as defined in the manifest. Used by the
|
the name of your application package as defined in the manifest. Used by the
|
||||||
'uninstall' rule.
|
'uninstall' rule.
|
||||||
source-folder
|
source-folder
|
||||||
the name of the source folder. Default is 'src'.
|
the name of the source folder. Default is 'src'.
|
||||||
out-folder
|
out-folder
|
||||||
the name of the output folder. Default is 'bin'.
|
the name of the output folder. Default is 'bin'.
|
||||||
|
|
||||||
Properties related to the SDK location or the project target should be updated
|
Properties related to the SDK location or the project target should be updated
|
||||||
using the 'android' tool with the 'update' action.
|
using the 'android' tool with the 'update' action.
|
||||||
|
|
||||||
This file is an integral part of the build system for your application and
|
This file is an integral part of the build system for your application and
|
||||||
should be checked in in Version Control Systems.
|
should be checked in in Version Control Systems.
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<property file="build.properties"/>
|
<property file="build.properties"/>
|
||||||
|
|
||||||
<!-- The default.properties file is created and updated by the 'android' tool, as well
|
<!-- The default.properties file is created and updated by the 'android' tool, as well
|
||||||
as ADT.
|
as ADT.
|
||||||
This file is an integral part of the build system for your application and
|
This file is an integral part of the build system for your application and
|
||||||
should be checked in in Version Control Systems. -->
|
should be checked in in Version Control Systems. -->
|
||||||
<property file="default.properties"/>
|
<property file="default.properties"/>
|
||||||
|
|
||||||
<!-- Custom Android task to deal with the project target, and import the proper rules.
|
<!-- Custom Android task to deal with the project target, and import the proper rules.
|
||||||
This requires ant 1.6.0 or above. -->
|
This requires ant 1.6.0 or above. -->
|
||||||
<path id="android.antlibs">
|
<path id="android.antlibs">
|
||||||
<pathelement path="${sdk-location}/tools/lib/anttasks.jar" />
|
<pathelement path="${sdk-location}/tools/lib/anttasks.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/sdklib.jar" />
|
<pathelement path="${sdk-location}/tools/lib/sdklib.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/androidprefs.jar" />
|
<pathelement path="${sdk-location}/tools/lib/androidprefs.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/apkbuilder.jar" />
|
<pathelement path="${sdk-location}/tools/lib/apkbuilder.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/jarutils.jar" />
|
<pathelement path="${sdk-location}/tools/lib/jarutils.jar" />
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
<taskdef name="setup"
|
<taskdef name="setup"
|
||||||
classname="com.android.ant.SetupTask"
|
classname="com.android.ant.SetupTask"
|
||||||
classpathref="android.antlibs"/>
|
classpathref="android.antlibs"/>
|
||||||
|
|
||||||
<!-- Execute the Android Setup task that will setup some properties specific to the target,
|
<!-- Execute the Android Setup task that will setup some properties specific to the target,
|
||||||
and import the rules files.
|
and import the rules files.
|
||||||
To customize the rules, copy/paste them below the task, and disable import by setting
|
To customize the rules, copy/paste them below the task, and disable import by setting
|
||||||
the import attribute to false:
|
the import attribute to false:
|
||||||
<setup import="false" />
|
<setup import="false" />
|
||||||
|
|
||||||
This will ensure that the properties are setup correctly but that your customized
|
This will ensure that the properties are setup correctly but that your customized
|
||||||
targets are used.
|
targets are used.
|
||||||
-->
|
-->
|
||||||
<setup import="false"/>
|
<setup import="false"/>
|
||||||
|
|
||||||
<import file="build-imported.xml"/>
|
<import file="build-imported.xml"/>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.example.android.snake"
|
package="com.example.android.snake"
|
||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="1.0">
|
android:versionName="1.0">
|
||||||
<application android:label="@string/app_name">
|
<application android:label="@string/app_name">
|
||||||
<activity android:name=".Snake"
|
<activity android:name=".Snake"
|
||||||
|
|
|
@ -1,158 +1,158 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project name="imported" default="help">
|
<project name="imported" default="help">
|
||||||
|
|
||||||
<property environment="env"/>
|
<property environment="env"/>
|
||||||
|
|
||||||
<!-- Android SDK -->
|
<!-- Android SDK -->
|
||||||
<condition property="_dx" value="dx.bat" else="dx">
|
<condition property="_dx" value="dx.bat" else="dx">
|
||||||
<os family="windows"/>
|
<os family="windows"/>
|
||||||
</condition>
|
</condition>
|
||||||
<condition property="_apkbuilder" value="apkbuilder.bat" else="apkbuilder">
|
<condition property="_apkbuilder" value="apkbuilder.bat" else="apkbuilder">
|
||||||
<os family="windows"/>
|
<os family="windows"/>
|
||||||
</condition>
|
</condition>
|
||||||
<property name="android.jar" value="${sdk-location}/platforms/android-1.5/android.jar"/>
|
<property name="android.jar" value="${sdk-location}/platforms/android-1.5/android.jar"/>
|
||||||
<property name="maps.jar" value="${sdk-location}/add-ons/maps.jar"/>
|
<property name="maps.jar" value="${sdk-location}/add-ons/maps.jar"/>
|
||||||
<property name="dx.cmd" value="${sdk-location}/platforms/android-1.5/tools/${_dx}"/>
|
<property name="dx.cmd" value="${sdk-location}/platforms/android-1.5/tools/${_dx}"/>
|
||||||
<property name="aapt.cmd" value="${sdk-location}/platforms/android-1.5/tools/aapt"/>
|
<property name="aapt.cmd" value="${sdk-location}/platforms/android-1.5/tools/aapt"/>
|
||||||
<property name="apkbuilder.cmd" value="${sdk-location}/tools/${_apkbuilder}"/>
|
<property name="apkbuilder.cmd" value="${sdk-location}/tools/${_apkbuilder}"/>
|
||||||
<property name="adb.cmd" value="${sdk-location}/tools/adb"/>
|
<property name="adb.cmd" value="${sdk-location}/tools/adb"/>
|
||||||
|
|
||||||
<!-- Scala SDK -->
|
<!-- Scala SDK -->
|
||||||
<property name="scala-compiler.jar" value="${env.SCALA_HOME}/lib/scala-compiler.jar"/>
|
<property name="scala-compiler.jar" value="${env.SCALA_HOME}/lib/scala-compiler.jar"/>
|
||||||
<property name="scala-library.jar" value="${env.SCALA_HOME}/lib/scala-library.jar"/>
|
<property name="scala-library.jar" value="${env.SCALA_HOME}/lib/scala-library.jar"/>
|
||||||
|
|
||||||
<!-- Android build files -->
|
<!-- Android build files -->
|
||||||
<property name="manifest.xml" value="${basedir}/AndroidManifest.xml"/>
|
<property name="manifest.xml" value="${basedir}/AndroidManifest.xml"/>
|
||||||
<xmlproperty file="${manifest.xml}" collapseAttributes="true"/>
|
<xmlproperty file="${manifest.xml}" collapseAttributes="true"/>
|
||||||
<property name="classes.dex" value="${basedir}/bin/classes.dex"/>
|
<property name="classes.dex" value="${basedir}/bin/classes.dex"/>
|
||||||
<property name="empty.apk" value="${basedir}/bin/${ant.project.name}.ap_"/>
|
<property name="empty.apk" value="${basedir}/bin/${ant.project.name}.ap_"/>
|
||||||
<property name="basename.apk" value="${ant.project.name}-debug.apk"/>
|
<property name="basename.apk" value="${ant.project.name}-debug.apk"/>
|
||||||
<property name="package.apk" value="${basedir}/bin/${basename.apk}"/>
|
<property name="package.apk" value="${basedir}/bin/${basename.apk}"/>
|
||||||
|
|
||||||
<taskdef name="apkbuilder"
|
<taskdef name="apkbuilder"
|
||||||
classname="com.android.ant.ApkBuilderTask"
|
classname="com.android.ant.ApkBuilderTask"
|
||||||
classpathref="android.antlibs"
|
classpathref="android.antlibs"
|
||||||
/>
|
/>
|
||||||
<path id="scala.path">
|
<path id="scala.path">
|
||||||
<pathelement path="${scala-compiler.jar}"/>
|
<pathelement path="${scala-compiler.jar}"/>
|
||||||
<pathelement path="${scala-library.jar}"/>
|
<pathelement path="${scala-library.jar}"/>
|
||||||
</path>
|
</path>
|
||||||
<taskdef
|
<taskdef
|
||||||
resource="scala/tools/ant/antlib.xml"
|
resource="scala/tools/ant/antlib.xml"
|
||||||
classpathref="scala.path"
|
classpathref="scala.path"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<uptodate property="gen.uptodate" targetfile="${basedir}/gen/.gen-complete">
|
<uptodate property="gen.uptodate" targetfile="${basedir}/gen/.gen-complete">
|
||||||
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="compile.uptodate" targetfile="${basedir}/bin/.compile-complete">
|
<uptodate property="compile.uptodate" targetfile="${basedir}/bin/.compile-complete">
|
||||||
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
<srcfiles dir="${basedir}/gen" includes="**/*.java"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="dex.uptodate" targetfile="${classes.dex}">
|
<uptodate property="dex.uptodate" targetfile="${classes.dex}">
|
||||||
<srcfiles dir="${basedir}/bin/classes" includes="**/*.class"/>
|
<srcfiles dir="${basedir}/bin/classes" includes="**/*.class"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="pkg.uptodate" targetfile="${empty.apk}">
|
<uptodate property="pkg.uptodate" targetfile="${empty.apk}">
|
||||||
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
<uptodate property="apk.uptodate" targetfile="${package.apk}">
|
<uptodate property="apk.uptodate" targetfile="${package.apk}">
|
||||||
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
<srcfiles dir="${basedir}/bin" includes="**/*.dex,**/*.xml"/>
|
||||||
</uptodate>
|
</uptodate>
|
||||||
|
|
||||||
<target name="resource-src" unless="gen.uptodate">
|
<target name="resource-src" unless="gen.uptodate">
|
||||||
<mkdir dir="${basedir}/gen"/>
|
<mkdir dir="${basedir}/gen"/>
|
||||||
<echo message="Generating R.java / Manifest.java from the resources..."/>
|
<echo message="Generating R.java / Manifest.java from the resources..."/>
|
||||||
<exec executable="${aapt.cmd}">
|
<exec executable="${aapt.cmd}">
|
||||||
<arg line="package -m -J '${basedir}/gen' -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}'"/>
|
<arg line="package -m -J '${basedir}/gen' -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
<touch file="${basedir}/gen/.gen-complete" verbose="no"/>
|
<touch file="${basedir}/gen/.gen-complete" verbose="no"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="compile" depends="resource-src" unless="compile.uptodate">
|
<target name="compile" depends="resource-src" unless="compile.uptodate">
|
||||||
<path id="boot.path">
|
<path id="boot.path">
|
||||||
<pathelement location="${android.jar}"/>
|
<pathelement location="${android.jar}"/>
|
||||||
<pathelement location="${maps.jar}"/>
|
<pathelement location="${maps.jar}"/>
|
||||||
</path>
|
</path>
|
||||||
<mkdir dir="${basedir}/bin/classes"/>
|
<mkdir dir="${basedir}/bin/classes"/>
|
||||||
<javac
|
<javac
|
||||||
srcdir="${basedir}/src${path.separator}${basedir}/gen" includes="**/*.java"
|
srcdir="${basedir}/src${path.separator}${basedir}/gen" includes="**/*.java"
|
||||||
destdir="${basedir}/bin/classes" bootclasspathref="boot.path"
|
destdir="${basedir}/bin/classes" bootclasspathref="boot.path"
|
||||||
target="1.5" source="1.5" encoding="ascii">
|
target="1.5" source="1.5" encoding="ascii">
|
||||||
<classpath>
|
<classpath>
|
||||||
<pathelement location="${android.jar}"/>
|
<pathelement location="${android.jar}"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
</javac>
|
</javac>
|
||||||
<scalac
|
<scalac
|
||||||
srcdir="${basedir}/src" includes="**/*.scala"
|
srcdir="${basedir}/src" includes="**/*.scala"
|
||||||
destdir="${basedir}/bin/classes" deprecation="on">
|
destdir="${basedir}/bin/classes" deprecation="on">
|
||||||
<classpath>
|
<classpath>
|
||||||
<pathelement location="${scala-library.jar}"/>
|
<pathelement location="${scala-library.jar}"/>
|
||||||
<pathelement location="${android.jar}"/>
|
<pathelement location="${android.jar}"/>
|
||||||
<pathelement location="${basedir}/bin/classes"/>
|
<pathelement location="${basedir}/bin/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
</scalac>
|
</scalac>
|
||||||
<touch file="${basedir}/bin/.compile-complete" verbose="no"/>
|
<touch file="${basedir}/bin/.compile-complete" verbose="no"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="dex" depends="compile" unless="dex.uptodate">
|
<target name="dex" depends="compile" unless="dex.uptodate">
|
||||||
<echo message="Converting compiled files and external libraries into bin/classes.dex..."/>
|
<echo message="Converting compiled files and external libraries into bin/classes.dex..."/>
|
||||||
<!-- IMPORTANT ! -->
|
<!-- IMPORTANT ! -->
|
||||||
<!-- in shell script /opt/android/platforms/android-1.5/tools/dx -->
|
<!-- in shell script /opt/android/platforms/android-1.5/tools/dx -->
|
||||||
<!-- add the following code on line 60: javaOpts="-Xmx768M" -->
|
<!-- add the following code on line 60: javaOpts="-Xmx768M" -->
|
||||||
<exec executable="${dx.cmd}">
|
<exec executable="${dx.cmd}">
|
||||||
<arg line="--dex --no-optimize --output='${classes.dex}' '${basedir}/bin/classes' '${scala-library.jar}'"/>
|
<arg line="--dex --no-optimize --output='${classes.dex}' '${basedir}/bin/classes' '${scala-library.jar}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="package-resources" depends="dex" unless="pkg.uptodate">
|
<target name="package-resources" depends="dex" unless="pkg.uptodate">
|
||||||
<echo message="Packaging resources"/>
|
<echo message="Packaging resources"/>
|
||||||
<exec executable="${aapt.cmd}">
|
<exec executable="${aapt.cmd}">
|
||||||
<arg line="package -f -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}' -F '${empty.apk}'"/>
|
<arg line="package -f -M '${manifest.xml}' -S '${basedir}/res' -I '${android.jar}' -F '${empty.apk}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="debug" depends="package-resources" unless="apk.uptodate">
|
<target name="debug" depends="package-resources" unless="apk.uptodate">
|
||||||
<apkbuilder
|
<apkbuilder
|
||||||
basename="${ant.project.name}" outfolder="${basedir}/bin"
|
basename="${ant.project.name}" outfolder="${basedir}/bin"
|
||||||
signed="true" verbose="true"
|
signed="true" verbose="true"
|
||||||
/>
|
/>
|
||||||
<exec executable="${apkbuilder.cmd}">
|
<exec executable="${apkbuilder.cmd}">
|
||||||
<arg line="'${package.apk}' -v -z '${empty.apk}' -f '${classes.dex}'"/>
|
<arg line="'${package.apk}' -v -z '${empty.apk}' -f '${classes.dex}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="release">
|
<target name="release">
|
||||||
<echo message="Sorry. Not yet implemented"/>
|
<echo message="Sorry. Not yet implemented"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="install" depends="debug">
|
<target name="install" depends="debug">
|
||||||
<echo message="Installing bin/${basename.apk} onto default emulator..."/>
|
<echo message="Installing bin/${basename.apk} onto default emulator..."/>
|
||||||
<exec executable="${adb.cmd}">
|
<exec executable="${adb.cmd}">
|
||||||
<arg line="install '${package.apk}'"/>
|
<arg line="install '${package.apk}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="reinstall" depends="debug">
|
<target name="reinstall" depends="debug">
|
||||||
<echo message="Reinstalling bin/${basename.apk} onto default emulator..."/>
|
<echo message="Reinstalling bin/${basename.apk} onto default emulator..."/>
|
||||||
<exec executable="${adb.cmd}">
|
<exec executable="${adb.cmd}">
|
||||||
<arg line="install -r '${package.apk}'"/>
|
<arg line="install -r '${package.apk}'"/>
|
||||||
</exec>
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="uninstall">
|
||||||
|
<exec executable="${adb.cmd}">
|
||||||
|
<arg line="uninstall '${manifest.package}'"/>
|
||||||
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="help">
|
||||||
|
<echo message="Android Ant Build. Available targets:"/>
|
||||||
|
<echo message=" help: Display this help."/>
|
||||||
|
<echo message=" debug: Builds the application and sign it with a debug key."/>
|
||||||
|
<echo message=" install: Install the debug package onto a running emulator or device."/>
|
||||||
|
<echo message=" reinstall: Reinstall the debug package onto a running emulator or device."/>
|
||||||
|
<echo message=" uninstall: Uninstall the application from a running emulator or device."/>
|
||||||
|
<echo message=" clean: Clean up build files from project."/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="uninstall">
|
|
||||||
<exec executable="${adb.cmd}">
|
|
||||||
<arg line="uninstall '${manifest.package}'"/>
|
|
||||||
</exec>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="help">
|
|
||||||
<echo message="Android Ant Build. Available targets:"/>
|
|
||||||
<echo message=" help: Display this help."/>
|
|
||||||
<echo message=" debug: Builds the application and sign it with a debug key."/>
|
|
||||||
<echo message=" install: Install the debug package onto a running emulator or device."/>
|
|
||||||
<echo message=" reinstall: Reinstall the debug package onto a running emulator or device."/>
|
|
||||||
<echo message=" uninstall: Uninstall the application from a running emulator or device."/>
|
|
||||||
<echo message=" clean: Clean up build files from project."/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<macrodef name="remove">
|
<macrodef name="remove">
|
||||||
<attribute name="dir"/>
|
<attribute name="dir"/>
|
||||||
|
@ -161,10 +161,10 @@
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
|
|
||||||
<target name="clean" description="clean up">
|
<target name="clean" description="clean up">
|
||||||
<echo message="Cleaning project '${ant.project.name}'..."/>
|
<echo message="Cleaning project '${ant.project.name}'..."/>
|
||||||
<remove dir="${basedir}/bin"/>
|
<remove dir="${basedir}/bin"/>
|
||||||
<remove dir="${basedir}/gen"/>
|
<remove dir="${basedir}/gen"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -1,64 +1,64 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project name="Snake" default="help">
|
<project name="Snake" default="help">
|
||||||
|
|
||||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
<!-- The local.properties file is created and updated by the 'android' tool.
|
||||||
It contain the path to the SDK. It should *NOT* be checked in in Version
|
It contain the path to the SDK. It should *NOT* be checked in in Version
|
||||||
Control Systems. -->
|
Control Systems. -->
|
||||||
<property file="local.properties"/>
|
<property file="local.properties"/>
|
||||||
|
|
||||||
<!-- The build.properties file can be created by you and is never touched
|
<!-- The build.properties file can be created by you and is never touched
|
||||||
by the 'android' tool. This is the place to change some of the default property values
|
by the 'android' tool. This is the place to change some of the default property values
|
||||||
used by the Ant rules.
|
used by the Ant rules.
|
||||||
Here are some properties you may want to change/update:
|
Here are some properties you may want to change/update:
|
||||||
|
|
||||||
application-package
|
application-package
|
||||||
the name of your application package as defined in the manifest. Used by the
|
the name of your application package as defined in the manifest. Used by the
|
||||||
'uninstall' rule.
|
'uninstall' rule.
|
||||||
source-folder
|
source-folder
|
||||||
the name of the source folder. Default is 'src'.
|
the name of the source folder. Default is 'src'.
|
||||||
out-folder
|
out-folder
|
||||||
the name of the output folder. Default is 'bin'.
|
the name of the output folder. Default is 'bin'.
|
||||||
|
|
||||||
Properties related to the SDK location or the project target should be updated
|
Properties related to the SDK location or the project target should be updated
|
||||||
using the 'android' tool with the 'update' action.
|
using the 'android' tool with the 'update' action.
|
||||||
|
|
||||||
This file is an integral part of the build system for your application and
|
This file is an integral part of the build system for your application and
|
||||||
should be checked in in Version Control Systems.
|
should be checked in in Version Control Systems.
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<property file="build.properties"/>
|
<property file="build.properties"/>
|
||||||
|
|
||||||
<!-- The default.properties file is created and updated by the 'android' tool, as well
|
<!-- The default.properties file is created and updated by the 'android' tool, as well
|
||||||
as ADT.
|
as ADT.
|
||||||
This file is an integral part of the build system for your application and
|
This file is an integral part of the build system for your application and
|
||||||
should be checked in in Version Control Systems. -->
|
should be checked in in Version Control Systems. -->
|
||||||
<property file="default.properties"/>
|
<property file="default.properties"/>
|
||||||
|
|
||||||
<!-- Custom Android task to deal with the project target, and import the proper rules.
|
<!-- Custom Android task to deal with the project target, and import the proper rules.
|
||||||
This requires ant 1.6.0 or above. -->
|
This requires ant 1.6.0 or above. -->
|
||||||
<path id="android.antlibs">
|
<path id="android.antlibs">
|
||||||
<pathelement path="${sdk-location}/tools/lib/anttasks.jar" />
|
<pathelement path="${sdk-location}/tools/lib/anttasks.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/sdklib.jar" />
|
<pathelement path="${sdk-location}/tools/lib/sdklib.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/androidprefs.jar" />
|
<pathelement path="${sdk-location}/tools/lib/androidprefs.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/apkbuilder.jar" />
|
<pathelement path="${sdk-location}/tools/lib/apkbuilder.jar" />
|
||||||
<pathelement path="${sdk-location}/tools/lib/jarutils.jar" />
|
<pathelement path="${sdk-location}/tools/lib/jarutils.jar" />
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
<taskdef name="setup"
|
<taskdef name="setup"
|
||||||
classname="com.android.ant.SetupTask"
|
classname="com.android.ant.SetupTask"
|
||||||
classpathref="android.antlibs"/>
|
classpathref="android.antlibs"/>
|
||||||
|
|
||||||
<!-- Execute the Android Setup task that will setup some properties specific to the target,
|
<!-- Execute the Android Setup task that will setup some properties specific to the target,
|
||||||
and import the rules files.
|
and import the rules files.
|
||||||
To customize the rules, copy/paste them below the task, and disable import by setting
|
To customize the rules, copy/paste them below the task, and disable import by setting
|
||||||
the import attribute to false:
|
the import attribute to false:
|
||||||
<setup import="false" />
|
<setup import="false" />
|
||||||
|
|
||||||
This will ensure that the properties are setup correctly but that your customized
|
This will ensure that the properties are setup correctly but that your customized
|
||||||
targets are used.
|
targets are used.
|
||||||
-->
|
-->
|
||||||
<setup import="false"/>
|
<setup import="false"/>
|
||||||
|
|
||||||
<import file="build-imported.xml"/>
|
<import file="build-imported.xml"/>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
0
docs/android-examples/Snake/tests/src/com/example/android/snake/SnakeTest.java
Executable file → Normal file
|
@ -1,29 +1,29 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project name="android" default="help">
|
<project name="android" default="help">
|
||||||
|
|
||||||
<target name="uninstall" description="uninstall applications">
|
<target name="uninstall" description="uninstall applications">
|
||||||
<ant dir="FileBrowser" target="uninstall"/>
|
<ant dir="FileBrowser" target="uninstall"/>
|
||||||
<ant dir="HelloActivity" target="uninstall"/>
|
<ant dir="HelloActivity" target="uninstall"/>
|
||||||
<ant dir="LunarLander" target="uninstall"/>
|
<ant dir="LunarLander" target="uninstall"/>
|
||||||
<ant dir="NotePad" target="uninstall"/>
|
<ant dir="NotePad" target="uninstall"/>
|
||||||
<ant dir="PhoneDialer" target="uninstall"/>
|
<ant dir="PhoneDialer" target="uninstall"/>
|
||||||
<ant dir="Snake" target="uninstall"/>
|
<ant dir="Snake" target="uninstall"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="clean" description="clean up">
|
<target name="clean" description="clean up">
|
||||||
<ant dir="FileBrowser" target="clean"/>
|
<ant dir="FileBrowser" target="clean"/>
|
||||||
<ant dir="HelloActivity" target="clean"/>
|
<ant dir="HelloActivity" target="clean"/>
|
||||||
<ant dir="LunarLander" target="clean"/>
|
<ant dir="LunarLander" target="clean"/>
|
||||||
<ant dir="NotePad" target="clean"/>
|
<ant dir="NotePad" target="clean"/>
|
||||||
<ant dir="PhoneDialer" target="clean"/>
|
<ant dir="PhoneDialer" target="clean"/>
|
||||||
<ant dir="Snake" target="clean"/>
|
<ant dir="Snake" target="clean"/>
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="help">
|
|
||||||
<echo message="Android Ant Build. Available targets:"/>
|
|
||||||
<echo message=" help: Display this help."/>
|
|
||||||
<echo message=" uninstall: Uninstall applications from a running emulator or device."/>
|
|
||||||
<echo message=" clean: Clean up build files from projects."/>
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
</project>
|
<target name="help">
|
||||||
|
<echo message="Android Ant Build. Available targets:"/>
|
||||||
|
<echo message=" help: Display this help."/>
|
||||||
|
<echo message=" uninstall: Uninstall applications from a running emulator or device."/>
|
||||||
|
<echo message=" clean: Clean up build files from projects."/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</project>
|
||||||
|
|
|
@ -45,4 +45,4 @@ digraph SQLTypes {
|
||||||
TimeWithTimezoneType -> TimeType
|
TimeWithTimezoneType -> TimeType
|
||||||
TimestampWithoutTimezoneType -> TimestampType
|
TimestampWithoutTimezoneType -> TimestampType
|
||||||
TimestampWithTimezoneType -> TimestampType
|
TimestampWithTimezoneType -> TimestampType
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,4 +101,4 @@ digraph SQLTypes {
|
||||||
|
|
||||||
AppliedTypeTree -> TypTree
|
AppliedTypeTree -> TypTree
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,4 +54,4 @@ object arithmeticParserDesugared extends StdTokenParsers {
|
||||||
"usage: scala examples.parsing.arithmeticParser <expr-string>"
|
"usage: scala examples.parsing.arithmeticParser <expr-string>"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,4 +58,4 @@ object PluginProperties {
|
||||||
Some(p)
|
Some(p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,4 +164,4 @@ trait HOSeq {
|
||||||
// @pre hasNext
|
// @pre hasNext
|
||||||
// @post hasAdvanced
|
// @post hasAdvanced
|
||||||
def advance: Unit
|
def advance: Unit
|
||||||
}*/
|
}*/
|
||||||
|
|
|
@ -66,4 +66,4 @@ class SomeIsMonad[a] extends OptionIsMonad[Some, a] {
|
||||||
class NoneIsMonad[a] extends OptionIsMonad[None, a] {
|
class NoneIsMonad[a] extends OptionIsMonad[None, a] {
|
||||||
def >>=[b](fun: a => Option[b]): Option[b] = None
|
def >>=[b](fun: a => Option[b]): Option[b] = None
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
3048
scala-lang.ipr
|
@ -6,7 +6,7 @@
|
||||||
** |/ **
|
** |/ **
|
||||||
\* */
|
\* */
|
||||||
|
|
||||||
// $Id:$
|
// $Id$
|
||||||
|
|
||||||
package scala.actors
|
package scala.actors
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
** |/ **
|
** |/ **
|
||||||
\* */
|
\* */
|
||||||
|
|
||||||
// $Id: Reaction.scala 17862 2009-05-27 23:27:05Z phaller $
|
// $Id$
|
||||||
|
|
||||||
|
|
||||||
package scala.actors
|
package scala.actors
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
** |/ **
|
** |/ **
|
||||||
\* */
|
\* */
|
||||||
|
|
||||||
// $Id: $
|
// $Id$
|
||||||
|
|
||||||
package scala.actors
|
package scala.actors
|
||||||
package scheduler
|
package scheduler
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
** |/ **
|
** |/ **
|
||||||
\* */
|
\* */
|
||||||
|
|
||||||
// $Id:$
|
// $Id$
|
||||||
|
|
||||||
package scala.actors
|
package scala.actors
|
||||||
package scheduler
|
package scheduler
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
** |/ **
|
** |/ **
|
||||||
\* */
|
\* */
|
||||||
|
|
||||||
// $Id: $
|
// $Id$
|
||||||
|
|
||||||
package scala.actors
|
package scala.actors
|
||||||
package scheduler
|
package scheduler
|
||||||
|
|
|
@ -13,4 +13,4 @@ package scala
|
||||||
|
|
||||||
import Predef._
|
import Predef._
|
||||||
|
|
||||||
trait ScalaObject extends AnyRef
|
trait ScalaObject extends AnyRef
|
||||||
|
|
|
@ -339,4 +339,4 @@ trait {className}{covariantArgs} extends Product {{
|
||||||
}}
|
}}
|
||||||
</file>}
|
</file>}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,4 +7,4 @@
|
||||||
classname="scala.tools.ant.sabbus.Break"/>
|
classname="scala.tools.ant.sabbus.Break"/>
|
||||||
<taskdef name="scalacfork"
|
<taskdef name="scalacfork"
|
||||||
classname="scala.tools.ant.sabbus.ScalacFork"/>
|
classname="scala.tools.ant.sabbus.ScalacFork"/>
|
||||||
</antlib>
|
</antlib>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* Copyright 2005-2009 LAMP/EPFL
|
* Copyright 2005-2009 LAMP/EPFL
|
||||||
* @author Burak Emir
|
* @author Burak Emir
|
||||||
*/
|
*/
|
||||||
// $Id: MarkupParsers.scala 17754 2009-05-18 10:54:00Z milessabin $
|
// $Id$
|
||||||
|
|
||||||
package scala.tools.nsc
|
package scala.tools.nsc
|
||||||
package ast.parser
|
package ast.parser
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* Copyright 2005-2009 LAMP/EPFL
|
* Copyright 2005-2009 LAMP/EPFL
|
||||||
* @author Martin Odersky
|
* @author Martin Odersky
|
||||||
*/
|
*/
|
||||||
// $Id: Parsers.scala 17756 2009-05-18 14:28:59Z rytz $
|
// $Id$
|
||||||
//todo: allow infix type patterns
|
//todo: allow infix type patterns
|
||||||
|
|
||||||
|
|
||||||
|
|