Skip to content
This repository has been archived by the owner on Feb 23, 2018. It is now read-only.

Commit

Permalink
minor changes (Android examples)
Browse files Browse the repository at this point in the history
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@22479 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
  • Loading branch information
michelou committed Jul 2, 2010
1 parent 4382261 commit 0e42467
Show file tree
Hide file tree
Showing 49 changed files with 159 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1784,7 +1784,7 @@
</application>
<!-- our application is compatible only with devices -->
<!-- using the Android 2.0.1 (or greater) system image -->
<uses-sdk android:minSdkVersion="6" />
<uses-sdk android:targetSdkVersion="8" android:minSdkVersion="7" />

<instrumentation android:name=".app.LocalSampleInstrumentation"
android:targetPackage="com.example.android.apis"
Expand Down
3 changes: 2 additions & 1 deletion docs/android-examples/android-sdk/ApiDemos/build-scala.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<echo message="${adb.out}" taskname="adb" />
</target>

<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink">
<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink"
description="Shrink the Scala library code">
<taskdef resource="proguard/ant/task.properties"
classpath="${proguard.jar}" />
<property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
-->

<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="activity_sample_code">API Demos</string>
<string name="activity_sample_code">API Demos\n(Scala)</string>

<!-- =============================== -->
<!-- app/activity examples strings -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<echo message="${adb.out}" taskname="adb" />
</target>

<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink">
<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink"
description="Shrink the Scala library code">
<taskdef resource="proguard/ant/task.properties"
classpath="${proguard.jar}" />
<property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<echo message="${adb.out}" taskname="adb" />
</target>

<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink">
<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink"
description="Shrink the Scala library code">
<taskdef resource="proguard/ant/task.properties"
classpath="${proguard.jar}" />
<property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<echo message="${adb.out}" taskname="adb" />
</target>

<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink">
<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink"
description="Shrink the Scala library code">
<taskdef resource="proguard/ant/task.properties"
classpath="${proguard.jar}" />
<property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<echo message="${adb.out}" taskname="adb" />
</target>

<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink">
<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink"
description="Shrink the Scala library code">
<taskdef resource="proguard/ant/task.properties"
classpath="${proguard.jar}" />
<property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<echo message="${adb.out}" taskname="adb" />
</target>

<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink">
<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink"
description="Shrink the Scala library code">
<taskdef resource="proguard/ant/task.properties"
classpath="${proguard.jar}" />
<property
Expand Down
3 changes: 2 additions & 1 deletion docs/android-examples/android-sdk/Home/build-scala.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<echo message="${adb.out}" taskname="adb" />
</target>

<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink">
<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink"
description="Shrink the Scala library code">
<taskdef resource="proguard/ant/task.properties"
classpath="${proguard.jar}" />
<property
Expand Down
16 changes: 12 additions & 4 deletions docs/android-examples/android-sdk/INSTALL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ The installation directory is organized as follows :
createramdisks
emulator
emulator-maps
removeramdisks
configs/
ant/
ant-windows.properties
ant-mac.properties
ant-unix.properties
ant-windows.properties
build-scala.xml
proguard.conf
proguard-optimize.conf
emulator/
busybox.applets
busybox.txt
Expand All @@ -50,7 +53,8 @@ The shell scripts are located in the "bin/" directory.
device; furthermore they use custom ramdisk images when present (see
the script "createramdisks" below).

* The "createramdisks" script performs the following tasks:
* The "createramdisks" script creates customized ramdisk images; in
particular it performs the following tasks:

- it splits the Scala library ($SCALA_HOME/lib/scala-library.jar) into
three smaller pieces as the dx tool fails to process a so large file,
Expand All @@ -67,6 +71,9 @@ The shell scripts are located in the "bin/" directory.
Android projects (they are then used by the shell scripts "emulator"
and "emulator-maps").

* The "removeramdisks" script simply removes the customized ramdisk images
created using "createramdisks".


Ant build scripts
-----------------
Expand Down Expand Up @@ -102,8 +109,9 @@ and focus our attention on the "scala-compile" target and the advanced targets
project's .scala files into .class files.

* The target "setenv" uses the configuration settings found in the
directory "configs/ant/" and, when necessary, updates the two files
"local.properties" and "build-scala.xml" in each project directory.
directory "configs/ant/" and, when necessary, updates the three files
"local.properties", "build-scala.xml" and "proguard.conf" in each project
directory.

* The target "check-maps" checks the consistency of the configuration
settings for the Google's APIs (i.e. maps.jar) defined in the project
Expand Down
3 changes: 2 additions & 1 deletion docs/android-examples/android-sdk/JetBoy/build-scala.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<echo message="${adb.out}" taskname="adb" />
</target>

<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink">
<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink"
description="Shrink the Scala library code">
<taskdef resource="proguard/ant/task.properties"
classpath="${proguard.jar}" />
<property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<echo message="${adb.out}" taskname="adb" />
</target>

<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink">
<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink"
description="Shrink the Scala library code">
<taskdef resource="proguard/ant/task.properties"
classpath="${proguard.jar}" />
<property
Expand Down
3 changes: 2 additions & 1 deletion docs/android-examples/android-sdk/NotePad/build-scala.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<echo message="${adb.out}" taskname="adb" />
</target>

<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink">
<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink"
description="Shrink the Scala library code">
<taskdef resource="proguard/ant/task.properties"
classpath="${proguard.jar}" />
<property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<echo message="${adb.out}" taskname="adb" />
</target>

<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink">
<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink"
description="Shrink the Scala library code">
<taskdef resource="proguard/ant/task.properties"
classpath="${proguard.jar}" />
<property
Expand Down
10 changes: 5 additions & 5 deletions docs/android-examples/android-sdk/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $ANDROID_SDK_ROOT/docs/guide/developing/tools/avd.html).

NB. The file INSTALL.txt gives VERY USEFUL informations about the small
development framework (directories "bin/" and "configs/") included in this
software distribution; in particular it permits to greatly improve the build
software distribution; in particular it permits to greatly reduce the build
time of Android applications written in Scala.


Expand All @@ -36,7 +36,7 @@ free software distributions (tested versions and download sites are given in
parenthesis) :

1) Sun Java SDK 1.6 or newer (1.6.0_20 , www.sun.com/java/jdk/)
2) Scala SDK 2.7.5 or newer (2.8.0_RC6, www.scala-lang.org/downloads/)
2) Scala SDK 2.7.5 or newer (2.8.0_RC7, www.scala-lang.org/downloads/)
3) Android SDK 1.5 or newer (2.2 , developer.android.com/sdk/)
4) Apache Ant 1.7.0 or newer (1.8.1 , ant.apache.org/)
5) ProGuard 4.4 or newer (4.5 , www.proguard.com/)
Expand Down Expand Up @@ -64,7 +64,7 @@ In particular:
properties (please adapt the respective values to your own environment):

Unix: Windows:
sdk.dir=/opt/android-sdk-linux_86 sdk.dir=c:/Progra~1/android-sdk-win32
sdk.dir=/opt/android-sdk-linux_86 sdk.dir=c:/Progra~1/android-sdk-windows
scala.dir=/opt/scala scala.dir=c:/Progra~1/Scala
proguard.dir=/opt/proguard proguard.dir=c:/Progra~1/ProGuard

Expand All @@ -81,7 +81,7 @@ In particular:

<!-- Converts this project's .class files into .dex files -->
<target name="-dex" depends="compile, scala-compile, scala-shrink">
<dex-helper />
<scala-dex-helper />
</target>

* The "build-scala.xml" Ant build script defines the targets "scala-compile"
Expand Down Expand Up @@ -184,7 +184,7 @@ bytecode. Concretely, we have two choices :
(2) Elapsed times for Scala builds include ProGuard processing time.

NB. The above results were measured with ProGuard 4.5 on a 2.0 GHz
Pentium M with 2 GB of memory, using Sun JDK 1.6.0_20 and Scala 2.8.0_RC6
Pentium M with 2 GB of memory, using Sun JDK 1.6.0_20 and Scala 2.8.0_RC7
on Ubuntu 8.04 Linux.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
*/
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.searchabledict">

<uses-sdk android:minSdkVersion="4" />
package="com.example.android.searchabledict"
android:versionCode="1"
android:versionName="1.0">

<application android:label="@string/app_name"
android:icon="@drawable/ic_dictionary">
Expand Down Expand Up @@ -55,4 +55,5 @@
android:syncable="false" />

</application>
<uses-sdk android:targetSdkVersion="7" android:minSdkVersion="4" />
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<echo message="${adb.out}" taskname="adb" />
</target>

<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink">
<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink"
description="Shrink the Scala library code">
<taskdef resource="proguard/ant/task.properties"
classpath="${proguard.jar}" />
<property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ sdk.dir=/opt/android-sdk-linux_86

scala.dir=/opt/scala

scalac.addparams=-deprecation

proguard.dir=/opt/proguard
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ class Dictionary {

private def addMatch(query: String, word: Word) {
mDict get query match {
case Some(list) => list + word
case None => mDict(query) = new ListBuffer() + word
case Some(list) => list += word
case None => mDict(query) = new ListBuffer() += word
}
}

Expand Down
3 changes: 2 additions & 1 deletion docs/android-examples/android-sdk/Snake/build-scala.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<echo message="${adb.out}" taskname="adb" />
</target>

<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink">
<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink"
description="Shrink the Scala library code">
<taskdef resource="proguard/ant/task.properties"
classpath="${proguard.jar}" />
<property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<echo message="${adb.out}" taskname="adb" />
</target>

<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink">
<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink"
description="Shrink the Scala library code">
<taskdef resource="proguard/ant/task.properties"
classpath="${proguard.jar}" />
<property
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@INJARS@
@OUTJARS@
@LIBRARYJARS@

-overloadaggressively
-repackageclasses ''
-allowaccessmodification

-dontpreverify

-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers

-dontwarn

#(org.xml.sax.EntityResolver)Class.forName(variable).newInstance()
-dontnote org.xml.sax.EntityResolver

-keep public class @MYAPP_PACKAGE@

Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<echo message="${adb.out}" taskname="adb" />
</target>

<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink">
<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink"
description="Shrink the Scala library code">
<taskdef resource="proguard/ant/task.properties"
classpath="${proguard.jar}" />
<property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<echo message="${adb.out}" taskname="adb" />
</target>

<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink">
<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink"
description="Shrink the Scala library code">
<taskdef resource="proguard/ant/task.properties"
classpath="${proguard.jar}" />
<property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<echo message="${adb.out}" taskname="adb" />
</target>

<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink">
<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink"
description="Shrink the Scala library code">
<taskdef resource="proguard/ant/task.properties"
classpath="${proguard.jar}" />
<property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<echo message="${adb.out}" taskname="adb" />
</target>

<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink">
<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink"
description="Shrink the Scala library code">
<taskdef resource="proguard/ant/task.properties"
classpath="${proguard.jar}" />
<property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
<echo message="${adb.out}" taskname="adb" />
</target>

<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink">
<target name="scala-shrink" depends="-shrink-if-test" unless="do.not.shrink"
description="Shrink the Scala library code">
<taskdef resource="proguard/ant/task.properties"
classpath="${proguard.jar}" />
<property
Expand Down
Loading

0 comments on commit 0e42467

Please sign in to comment.