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