updated build scripts (Android examples)

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@22248 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
michelou 2010-06-12 18:53:45 +00:00
parent e5564efaae
commit cd1e4d3fa7
796 changed files with 1557 additions and 912 deletions

View File

@ -1,27 +0,0 @@
# This file is used to override default values used by the Ant build system.
#
# This file must be checked in Version Control Systems, as it is
# integral to the build system of your project.
# This file is only used by the Ant script.
# You can use this to override default values such as
# 'source.dir' for the location of your java source folder and
# 'out.dir' for the location of your output folder.
# You can also use it define how the release builds are signed by declaring
# the following properties:
# 'key.store' for the location of your keystore and
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.
#sdk.dir=C:\\Progra~1\\Android
sdk.dir=/opt/android
#scala.dir=c:\\Progra~1\\Scala
scala.dir=/opt/scala
scalac.addparams=-deprecation
#yguard.dir=c:\\Progra~1\\yguard-2.3.0.1
yguard.dir=/opt/yguard

View File

@ -1,63 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="build-scala">
<!-- Scala SDK (www.scala-lang.org) -->
<property name="scala-compiler.jar" value="${scala.dir}/lib/scala-compiler.jar" />
<property name="scala-library.jar" value="${scala.dir}/lib/scala-library.jar" />
<!-- YGuard SDK (www.yworks.com/products/yguard) -->
<property name="yguard.jar" value="${yguard.dir}/lib/yguard.jar" />
<!-- Ant generated files -->
<property name="scala-library_shr.jar" value="${out.dir}/scala-library_shr.jar" />
<property name="myapp.jar" value="${out.dir}/${ant.project.name}.jar" />
<path id="scala.path">
<pathelement path="${scala-compiler.jar}" />
<pathelement path="${scala-library.jar}" />
</path>
<taskdef
resource="scala/tools/ant/antlib.xml"
classpathref="scala.path"
/>
<property prefix="scala" resource="library.properties" classpathref="scala.path" />
<echo message="Scala Version: ${scala.version.number}" level="info" />
<taskdef
name="yguard" classname="com.yworks.yguard.YGuardTask"
classpath="${yguard.jar}"
/>
<uptodate property="myapp.isUpToDate" targetfile="${myapp.jar}">
<srcfiles dir="${source.dir}" includes="**/*.scala,**/*.java" />
<srcfiles dir="${resource.dir}" />
</uptodate>
<target name="scala-compile" depends="compile"
description="Compiles project's .scala files into .class files"
unless="myapp.isUpToDate">
<scalac
srcdir="${source.dir}" includes="**/*.scala"
destdir="${out.classes.dir}"
addparams="${scalac.addparams}">
<classpath>
<pathelement location="${scala-library.jar}" />
<pathelement location="${android.jar}" />
<pathelement location="${out.classes.dir}" />
</classpath>
</scalac>
</target>
<target name="scala-shrink" depends="scala-compile"
description="Shrink code size of Scala library">
<jar destfile="${myapp.jar}" basedir="${out.classes.dir}" />
<yguard>
<inoutpair in="${scala-library.jar}" out="${scala-library_shr.jar}" />
<externalclasses>
<pathelement location="${android.jar}" />
</externalclasses>
<shrink logfile="${out.dir}/yshrinklog.xml">
<entrypointjar name="${myapp.jar}" />
</shrink>
</yguard>
<unjar src="${scala-library_shr.jar}" dest="${out.classes.dir}" />
</target>
</project>

View File

@ -1,27 +0,0 @@
# This file is used to override default values used by the Ant build system.
#
# This file must be checked in Version Control Systems, as it is
# integral to the build system of your project.
# This file is only used by the Ant script.
# You can use this to override default values such as
# 'source.dir' for the location of your java source folder and
# 'out.dir' for the location of your output folder.
# You can also use it define how the release builds are signed by declaring
# the following properties:
# 'key.store' for the location of your keystore and
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.
#sdk.dir=C:\\Progra~1\\Android
sdk.dir=/opt/android
#scala.dir=c:\\Progra~1\\Scala
scala.dir=/opt/scala
scalac.addparams=-deprecation
#yguard.dir=c:\\Progra~1\\yguard-2.3.0.1
yguard.dir=/opt/yguard

View File

@ -1,63 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="build-scala">
<!-- Scala SDK (www.scala-lang.org) -->
<property name="scala-compiler.jar" value="${scala.dir}/lib/scala-compiler.jar" />
<property name="scala-library.jar" value="${scala.dir}/lib/scala-library.jar" />
<!-- YGuard SDK (www.yworks.com/products/yguard) -->
<property name="yguard.jar" value="${yguard.dir}/lib/yguard.jar" />
<!-- Ant generated files -->
<property name="scala-library_shr.jar" value="${out.dir}/scala-library_shr.jar" />
<property name="myapp.jar" value="${out.dir}/${ant.project.name}.jar" />
<path id="scala.path">
<pathelement path="${scala-compiler.jar}" />
<pathelement path="${scala-library.jar}" />
</path>
<taskdef
resource="scala/tools/ant/antlib.xml"
classpathref="scala.path"
/>
<property prefix="scala" resource="library.properties" classpathref="scala.path" />
<echo message="Scala Version: ${scala.version.number}" level="info" />
<taskdef
name="yguard" classname="com.yworks.yguard.YGuardTask"
classpath="${yguard.jar}"
/>
<uptodate property="myapp.isUpToDate" targetfile="${myapp.jar}">
<srcfiles dir="${source.dir}" includes="**/*.scala,**/*.java" />
<srcfiles dir="${resource.dir}" />
</uptodate>
<target name="scala-compile" depends="compile"
description="Compiles project's .scala files into .class files"
unless="myapp.isUpToDate">
<scalac
srcdir="${source.dir}" includes="**/*.scala"
destdir="${out.classes.dir}"
addparams="${scalac.addparams}">
<classpath>
<pathelement location="${scala-library.jar}" />
<pathelement location="${android.jar}" />
<pathelement location="${out.classes.dir}" />
</classpath>
</scalac>
</target>
<target name="scala-shrink" depends="scala-compile"
description="Shrink code size of Scala library">
<jar destfile="${myapp.jar}" basedir="${out.classes.dir}" />
<yguard>
<inoutpair in="${scala-library.jar}" out="${scala-library_shr.jar}" />
<externalclasses>
<pathelement location="${android.jar}" />
</externalclasses>
<shrink logfile="${out.dir}/yshrinklog.xml">
<entrypointjar name="${myapp.jar}" />
</shrink>
</yguard>
<unjar src="${scala-library_shr.jar}" dest="${out.classes.dir}" />
</target>
</project>

View File

@ -1,27 +0,0 @@
# This file is used to override default values used by the Ant build system.
#
# This file must be checked in Version Control Systems, as it is
# integral to the build system of your project.
# This file is only used by the Ant script.
# You can use this to override default values such as
# 'source.dir' for the location of your java source folder and
# 'out.dir' for the location of your output folder.
# You can also use it define how the release builds are signed by declaring
# the following properties:
# 'key.store' for the location of your keystore and
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.
#sdk.dir=C:\\Progra~1\\Android
sdk.dir=/opt/android
#scala.dir=c:\\Progra~1\\Scala
scala.dir=/opt/scala
scalac.addparams=-deprecation
#yguard.dir=c:\\Progra~1\\yguard-2.3.0.1
yguard.dir=/opt/yguard

View File

@ -1,63 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="build-scala">
<!-- Scala SDK (www.scala-lang.org) -->
<property name="scala-compiler.jar" value="${scala.dir}/lib/scala-compiler.jar" />
<property name="scala-library.jar" value="${scala.dir}/lib/scala-library.jar" />
<!-- YGuard SDK (www.yworks.com/products/yguard) -->
<property name="yguard.jar" value="${yguard.dir}/lib/yguard.jar" />
<!-- Ant generated files -->
<property name="scala-library_shr.jar" value="${out.dir}/scala-library_shr.jar" />
<property name="myapp.jar" value="${out.dir}/${ant.project.name}.jar" />
<path id="scala.path">
<pathelement path="${scala-compiler.jar}" />
<pathelement path="${scala-library.jar}" />
</path>
<taskdef
resource="scala/tools/ant/antlib.xml"
classpathref="scala.path"
/>
<property prefix="scala" resource="library.properties" classpathref="scala.path" />
<echo message="Scala Version: ${scala.version.number}" level="info" />
<taskdef
name="yguard" classname="com.yworks.yguard.YGuardTask"
classpath="${yguard.jar}"
/>
<uptodate property="myapp.isUpToDate" targetfile="${myapp.jar}">
<srcfiles dir="${source.dir}" includes="**/*.scala,**/*.java" />
<srcfiles dir="${resource.dir}" />
</uptodate>
<target name="scala-compile" depends="compile"
description="Compiles project's .scala files into .class files"
unless="myapp.isUpToDate">
<scalac
srcdir="${source.dir}" includes="**/*.scala"
destdir="${out.classes.dir}"
addparams="${scalac.addparams}">
<classpath>
<pathelement location="${scala-library.jar}" />
<pathelement location="${android.jar}" />
<pathelement location="${out.classes.dir}" />
</classpath>
</scalac>
</target>
<target name="scala-shrink" depends="scala-compile"
description="Shrink code size of Scala library">
<jar destfile="${myapp.jar}" basedir="${out.classes.dir}" />
<yguard>
<inoutpair in="${scala-library.jar}" out="${scala-library_shr.jar}" />
<externalclasses>
<pathelement location="${android.jar}" />
</externalclasses>
<shrink logfile="${out.dir}/yshrinklog.xml">
<entrypointjar name="${myapp.jar}" />
</shrink>
</yguard>
<unjar src="${scala-library_shr.jar}" dest="${out.classes.dir}" />
</target>
</project>

View File

@ -1,27 +0,0 @@
# This file is used to override default values used by the Ant build system.
#
# This file must be checked in Version Control Systems, as it is
# integral to the build system of your project.
# This file is only used by the Ant script.
# You can use this to override default values such as
# 'source.dir' for the location of your java source folder and
# 'out.dir' for the location of your output folder.
# You can also use it define how the release builds are signed by declaring
# the following properties:
# 'key.store' for the location of your keystore and
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.
#sdk.dir=C:\\Progra~1\\Android
sdk.dir=/opt/android
#scala.dir=c:\\Progra~1\\Scala
scala.dir=/opt/scala
scalac.addparams=-deprecation
#yguard.dir=c:\\Progra~1\\yguard-2.3.0.1
yguard.dir=/opt/yguard

View File

@ -1,63 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="build-scala">
<!-- Scala SDK (www.scala-lang.org) -->
<property name="scala-compiler.jar" value="${scala.dir}/lib/scala-compiler.jar" />
<property name="scala-library.jar" value="${scala.dir}/lib/scala-library.jar" />
<!-- YGuard SDK (www.yworks.com/products/yguard) -->
<property name="yguard.jar" value="${yguard.dir}/lib/yguard.jar" />
<!-- Ant generated files -->
<property name="scala-library_shr.jar" value="${out.dir}/scala-library_shr.jar" />
<property name="myapp.jar" value="${out.dir}/${ant.project.name}.jar" />
<path id="scala.path">
<pathelement path="${scala-compiler.jar}" />
<pathelement path="${scala-library.jar}" />
</path>
<taskdef
resource="scala/tools/ant/antlib.xml"
classpathref="scala.path"
/>
<property prefix="scala" resource="library.properties" classpathref="scala.path" />
<echo message="Scala Version: ${scala.version.number}" level="info" />
<taskdef
name="yguard" classname="com.yworks.yguard.YGuardTask"
classpath="${yguard.jar}"
/>
<uptodate property="myapp.isUpToDate" targetfile="${myapp.jar}">
<srcfiles dir="${source.dir}" includes="**/*.scala,**/*.java" />
<srcfiles dir="${resource.dir}" />
</uptodate>
<target name="scala-compile" depends="compile"
description="Compiles project's .scala files into .class files"
unless="myapp.isUpToDate">
<scalac
srcdir="${source.dir}" includes="**/*.scala"
destdir="${out.classes.dir}"
addparams="${scalac.addparams}">
<classpath>
<pathelement location="${scala-library.jar}" />
<pathelement location="${android.jar}" />
<pathelement location="${out.classes.dir}" />
</classpath>
</scalac>
</target>
<target name="scala-shrink" depends="scala-compile"
description="Shrink code size of Scala library">
<jar destfile="${myapp.jar}" basedir="${out.classes.dir}" />
<yguard>
<inoutpair in="${scala-library.jar}" out="${scala-library_shr.jar}" />
<externalclasses>
<pathelement location="${android.jar}" />
</externalclasses>
<shrink logfile="${out.dir}/yshrinklog.xml">
<entrypointjar name="${myapp.jar}" />
</shrink>
</yguard>
<unjar src="${scala-library_shr.jar}" dest="${out.classes.dir}" />
</target>
</project>

View File

@ -1,27 +0,0 @@
# This file is used to override default values used by the Ant build system.
#
# This file must be checked in Version Control Systems, as it is
# integral to the build system of your project.
# This file is only used by the Ant script.
# You can use this to override default values such as
# 'source.dir' for the location of your java source folder and
# 'out.dir' for the location of your output folder.
# You can also use it define how the release builds are signed by declaring
# the following properties:
# 'key.store' for the location of your keystore and
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.
#sdk.dir=C:\\Progra~1\\Android
sdk.dir=/opt/android
#scala.dir=c:\\Progra~1\\Scala
scala.dir=/opt/scala
scalac.addparams=-deprecation
#yguard.dir=c:\\Progra~1\\yguard-2.3.0.1
yguard.dir=/opt/yguard

View File

@ -1,63 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="build-scala">
<!-- Scala SDK (www.scala-lang.org) -->
<property name="scala-compiler.jar" value="${scala.dir}/lib/scala-compiler.jar" />
<property name="scala-library.jar" value="${scala.dir}/lib/scala-library.jar" />
<!-- YGuard SDK (www.yworks.com/products/yguard) -->
<property name="yguard.jar" value="${yguard.dir}/lib/yguard.jar" />
<!-- Ant generated files -->
<property name="scala-library_shr.jar" value="${out.dir}/scala-library_shr.jar" />
<property name="myapp.jar" value="${out.dir}/${ant.project.name}.jar" />
<path id="scala.path">
<pathelement path="${scala-compiler.jar}" />
<pathelement path="${scala-library.jar}" />
</path>
<taskdef
resource="scala/tools/ant/antlib.xml"
classpathref="scala.path"
/>
<property prefix="scala" resource="library.properties" classpathref="scala.path" />
<echo message="Scala Version: ${scala.version.number}" level="info" />
<taskdef
name="yguard" classname="com.yworks.yguard.YGuardTask"
classpath="${yguard.jar}"
/>
<uptodate property="myapp.isUpToDate" targetfile="${myapp.jar}">
<srcfiles dir="${source.dir}" includes="**/*.scala,**/*.java" />
<srcfiles dir="${resource.dir}" />
</uptodate>
<target name="scala-compile" depends="compile"
description="Compiles project's .scala files into .class files"
unless="myapp.isUpToDate">
<scalac
srcdir="${source.dir}" includes="**/*.scala"
destdir="${out.classes.dir}"
addparams="${scalac.addparams}">
<classpath>
<pathelement location="${scala-library.jar}" />
<pathelement location="${android.jar}" />
<pathelement location="${out.classes.dir}" />
</classpath>
</scalac>
</target>
<target name="scala-shrink" depends="scala-compile"
description="Shrink code size of Scala library">
<jar destfile="${myapp.jar}" basedir="${out.classes.dir}" />
<yguard>
<inoutpair in="${scala-library.jar}" out="${scala-library_shr.jar}" />
<externalclasses>
<pathelement location="${android.jar}" />
</externalclasses>
<shrink logfile="${out.dir}/yshrinklog.xml">
<entrypointjar name="${myapp.jar}" />
</shrink>
</yguard>
<unjar src="${scala-library_shr.jar}" dest="${out.classes.dir}" />
</target>
</project>

View File

@ -1,27 +0,0 @@
# This file is used to override default values used by the Ant build system.
#
# This file must be checked in Version Control Systems, as it is
# integral to the build system of your project.
# This file is only used by the Ant script.
# You can use this to override default values such as
# 'source.dir' for the location of your java source folder and
# 'out.dir' for the location of your output folder.
# You can also use it define how the release builds are signed by declaring
# the following properties:
# 'key.store' for the location of your keystore and
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.
#sdk.dir=C:\\Progra~1\\Android
sdk.dir=/opt/android
#scala.dir=c:\\Progra~1\\Scala
scala.dir=/opt/scala
scalac.addparams=-deprecation
#yguard.dir=c:\\Progra~1\\yguard-2.3.0.1
yguard.dir=/opt/yguard

View File

@ -1,63 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="build-scala">
<!-- Scala SDK (www.scala-lang.org) -->
<property name="scala-compiler.jar" value="${scala.dir}/lib/scala-compiler.jar" />
<property name="scala-library.jar" value="${scala.dir}/lib/scala-library.jar" />
<!-- YGuard SDK (www.yworks.com/products/yguard) -->
<property name="yguard.jar" value="${yguard.dir}/lib/yguard.jar" />
<!-- Ant generated files -->
<property name="scala-library_shr.jar" value="${out.dir}/scala-library_shr.jar" />
<property name="myapp.jar" value="${out.dir}/${ant.project.name}.jar" />
<path id="scala.path">
<pathelement path="${scala-compiler.jar}" />
<pathelement path="${scala-library.jar}" />
</path>
<taskdef
resource="scala/tools/ant/antlib.xml"
classpathref="scala.path"
/>
<property prefix="scala" resource="library.properties" classpathref="scala.path" />
<echo message="Scala Version: ${scala.version.number}" level="info" />
<taskdef
name="yguard" classname="com.yworks.yguard.YGuardTask"
classpath="${yguard.jar}"
/>
<uptodate property="myapp.isUpToDate" targetfile="${myapp.jar}">
<srcfiles dir="${source.dir}" includes="**/*.scala,**/*.java" />
<srcfiles dir="${resource.dir}" />
</uptodate>
<target name="scala-compile" depends="compile"
description="Compiles project's .scala files into .class files"
unless="myapp.isUpToDate">
<scalac
srcdir="${source.dir}" includes="**/*.scala"
destdir="${out.classes.dir}"
addparams="${scalac.addparams}">
<classpath>
<pathelement location="${scala-library.jar}" />
<pathelement location="${android.jar}" />
<pathelement location="${out.classes.dir}" />
</classpath>
</scalac>
</target>
<target name="scala-shrink" depends="scala-compile"
description="Shrink code size of Scala library">
<jar destfile="${myapp.jar}" basedir="${out.classes.dir}" />
<yguard>
<inoutpair in="${scala-library.jar}" out="${scala-library_shr.jar}" />
<externalclasses>
<pathelement location="${android.jar}" />
</externalclasses>
<shrink logfile="${out.dir}/yshrinklog.xml">
<entrypointjar name="${myapp.jar}" />
</shrink>
</yguard>
<unjar src="${scala-library_shr.jar}" dest="${out.classes.dir}" />
</target>
</project>

View File

@ -1,27 +0,0 @@
# This file is used to override default values used by the Ant build system.
#
# This file must be checked in Version Control Systems, as it is
# integral to the build system of your project.
# This file is only used by the Ant script.
# You can use this to override default values such as
# 'source.dir' for the location of your java source folder and
# 'out.dir' for the location of your output folder.
# You can also use it define how the release builds are signed by declaring
# the following properties:
# 'key.store' for the location of your keystore and
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.
#sdk.dir=C:\\Progra~1\\Android
sdk.dir=/opt/android
#scala.dir=c:\\Progra~1\\Scala
scala.dir=/opt/scala
scalac.addparams=-deprecation
#yguard.dir=c:\\Progra~1\\yguard-2.3.0.1
yguard.dir=/opt/yguard

View File

@ -1,63 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="build-scala">
<!-- Scala SDK (www.scala-lang.org) -->
<property name="scala-compiler.jar" value="${scala.dir}/lib/scala-compiler.jar" />
<property name="scala-library.jar" value="${scala.dir}/lib/scala-library.jar" />
<!-- YGuard SDK (www.yworks.com/products/yguard) -->
<property name="yguard.jar" value="${yguard.dir}/lib/yguard.jar" />
<!-- Ant generated files -->
<property name="scala-library_shr.jar" value="${out.dir}/scala-library_shr.jar" />
<property name="myapp.jar" value="${out.dir}/${ant.project.name}.jar" />
<path id="scala.path">
<pathelement path="${scala-compiler.jar}" />
<pathelement path="${scala-library.jar}" />
</path>
<taskdef
resource="scala/tools/ant/antlib.xml"
classpathref="scala.path"
/>
<property prefix="scala" resource="library.properties" classpathref="scala.path" />
<echo message="Scala Version: ${scala.version.number}" level="info" />
<taskdef
name="yguard" classname="com.yworks.yguard.YGuardTask"
classpath="${yguard.jar}"
/>
<uptodate property="myapp.isUpToDate" targetfile="${myapp.jar}">
<srcfiles dir="${source.dir}" includes="**/*.scala,**/*.java" />
<srcfiles dir="${resource.dir}" />
</uptodate>
<target name="scala-compile" depends="compile"
description="Compiles project's .scala files into .class files"
unless="myapp.isUpToDate">
<scalac
srcdir="${source.dir}" includes="**/*.scala"
destdir="${out.classes.dir}"
addparams="${scalac.addparams}">
<classpath>
<pathelement location="${scala-library.jar}" />
<pathelement location="${android.jar}" />
<pathelement location="${out.classes.dir}" />
</classpath>
</scalac>
</target>
<target name="scala-shrink" depends="scala-compile"
description="Shrink code size of Scala library">
<jar destfile="${myapp.jar}" basedir="${out.classes.dir}" />
<yguard>
<inoutpair in="${scala-library.jar}" out="${scala-library_shr.jar}" />
<externalclasses>
<pathelement location="${android.jar}" />
</externalclasses>
<shrink logfile="${out.dir}/yshrinklog.xml">
<entrypointjar name="${myapp.jar}" />
</shrink>
</yguard>
<unjar src="${scala-library_shr.jar}" dest="${out.classes.dir}" />
</target>
</project>

View File

@ -12,7 +12,7 @@ Note that the description below applies to both the Unix and Windows
environments.
All Android examples have been run successfully on the virtual Android device
"2.1_128M_HVGA" configured as follows: 2.1 target, 128M SD card and HVGA skin
"2.2_128M_HVGA" configured as follows: 2.2 target, 128M SD card and HVGA skin
(for more details see the documentation page
$ANDROID_HOME/docs/guide/developing/tools/avd.html).
@ -26,7 +26,7 @@ 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_RC3, www.scala-lang.org/downloads/)
3) Android SDK 1.5 or newer (2.1 , developer.android.com/sdk/)
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) YGuard 2.3 or newer (2.3.0.1 , www.yworks.com/products/yguard/)
@ -55,7 +55,7 @@ In particular:
Unix: Windows:
sdk.dir=/opt/android sdk.dir=c:\\Progra~1\\Android
scala.dir=/opt/scala sdk.dir=c:\\Progra~1\\Scala
yguard.dir=/opt/yguard sdk.dir=c:\\Progra~1\\yguard-3.2.0.1
yguard.dir=/opt/yguard sdk.dir=c:\\Progra~1\\YGuard
* The "default.properties" file defines the default API level of an Android
(for more details see the documentation page
@ -85,16 +85,17 @@ Project Build
-------------
First we make sure the Android emulator is up and running; if not we start it
using the shell command (let us assume the existence of the "2.1_128M_HVGA"
using the shell command (let us assume the existence of the "2.2_128M_HVGA"
virtual device) :
android-examples> emulator -no-boot-anim -no-jni -avd 2.1_128M_HVGA &
android-examples> emulator -no-boot-anim -no-jni -avd 2.2_128M_HVGA &
Then we move for instance to the "Snake" project directory and execute one of
the following Ant targets :
android-examples> cd Snake
Snake> ant clean
Snake> ant scala-compile
Snake> ant debug
Snake> ant install
(now let us play with our application on the emulator !)
@ -131,7 +132,7 @@ bytecode. Concretely, we have two choices :
time consuming (to be improved e.g. using a compiler generated dependency
list).
Application <myapp>.jar scala-library_shr.jar classes.dex
Application <myapp>.jar scala-library-shrinked.jar classes.dex
(in Scala) (entry point) (orig. 3900 classes) (Android bytecode)
-----------------------------------------------------------------------
ApiDemos 982K 361K (482 classes) 785K
@ -172,7 +173,7 @@ bytecode. Concretely, we have two choices :
(2) Elapsed times for Scala builds include YGuard processing time.
NB. The above results were measured with YGuard 3.2.0.1 on a 2.0 GHz
Pentium M with 2 GB of memory, using Sun JDK 1.6.0_20 and Scala 2.8.0_RC2
Pentium M with 2 GB of memory, using Sun JDK 1.6.0_20 and Scala 2.8.0_RC3
on Ubuntu 8.04 Linux.

View File

@ -1,63 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="build-scala">
<!-- Scala SDK (www.scala-lang.org) -->
<property name="scala-compiler.jar" value="${scala.dir}/lib/scala-compiler.jar" />
<property name="scala-library.jar" value="${scala.dir}/lib/scala-library.jar" />
<!-- YGuard SDK (www.yworks.com/products/yguard) -->
<property name="yguard.jar" value="${yguard.dir}/lib/yguard.jar" />
<!-- Ant generated files -->
<property name="scala-library_shr.jar" value="${out.dir}/scala-library_shr.jar" />
<property name="myapp.jar" value="${out.dir}/${ant.project.name}.jar" />
<path id="scala.path">
<pathelement path="${scala-compiler.jar}" />
<pathelement path="${scala-library.jar}" />
</path>
<taskdef
resource="scala/tools/ant/antlib.xml"
classpathref="scala.path"
/>
<property prefix="scala" resource="library.properties" classpathref="scala.path" />
<echo message="Scala Version: ${scala.version.number}" level="info" />
<taskdef
name="yguard" classname="com.yworks.yguard.YGuardTask"
classpath="${yguard.jar}"
/>
<uptodate property="myapp.isUpToDate" targetfile="${myapp.jar}">
<srcfiles dir="${source.dir}" includes="**/*.scala,**/*.java" />
<srcfiles dir="${resource.dir}" />
</uptodate>
<target name="scala-compile" depends="compile"
description="Compiles project's .scala files into .class files"
unless="myapp.isUpToDate">
<scalac
srcdir="${source.dir}" includes="**/*.scala"
destdir="${out.classes.dir}"
addparams="${scalac.addparams}">
<classpath>
<pathelement location="${scala-library.jar}" />
<pathelement location="${android.jar}" />
<pathelement location="${out.classes.dir}" />
</classpath>
</scalac>
</target>
<target name="scala-shrink" depends="scala-compile"
description="Shrink code size of Scala library">
<jar destfile="${myapp.jar}" basedir="${out.classes.dir}" />
<yguard>
<inoutpair in="${scala-library.jar}" out="${scala-library_shr.jar}" />
<externalclasses>
<pathelement location="${android.jar}" />
</externalclasses>
<shrink logfile="${out.dir}/yshrinklog.xml">
<entrypointjar name="${myapp.jar}" />
</shrink>
</yguard>
<unjar src="${scala-library_shr.jar}" dest="${out.classes.dir}" />
</target>
</project>

View File

@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="build-scala">
<!-- This file is imported by the main Ant script. -->
<!-- Scala SDK (www.scala-lang.org) -->
<property name="scala-compiler.jar" value="${scala.dir}/lib/scala-compiler.jar" />
<property name="scala-library.jar" value="${scala.dir}/lib/scala-library.jar" />
<!-- YGuard SDK (www.yworks.com/products/yguard) -->
<property name="yguard.jar" value="${yguard.dir}/lib/yguard.jar" />
<!-- Ant generated files -->
<property name="scala-library_shr.jar" value="${out.dir}/scala-library_shr.jar" />
<property name="myapp.jar" value="${out.dir}/${ant.project.name}.jar" />
<path id="scala.path">
<pathelement path="${scala-compiler.jar}" />
@ -16,23 +15,32 @@
</path>
<taskdef
resource="scala/tools/ant/antlib.xml"
classpathref="scala.path"
/>
<property prefix="scala" resource="library.properties" classpathref="scala.path" />
<echo message="Scala Version: ${scala.version.number}" level="info" />
classpathref="scala.path" />
<taskdef
name="yguard" classname="com.yworks.yguard.YGuardTask"
classpath="${yguard.jar}"
/>
classpath="${yguard.jar}" />
<uptodate property="myapp.isUpToDate" targetfile="${myapp.jar}">
<resourcecount property="scala.files.count">
<fileset dir="${source.dir}" includes="**/*.scala" />
</resourcecount>
<condition property="myapp.containsScala">
<not><equals arg1="${scala.files.count}" arg2="0" /></not>
</condition>
<uptodate property="myapp.isUpToDate" targetfile="${out.dir}/classes.complete">
<srcfiles dir="${source.dir}" includes="**/*.scala,**/*.java" />
<srcfiles dir="${resource.dir}" />
</uptodate>
<target name="scala-compile" depends="compile"
description="Compiles project's .scala files into .class files"
unless="myapp.isUpToDate">
if="myapp.containsScala" unless="myapp.isUpToDate">
<property prefix="scala"
resource="compiler.properties"
classpathref="scala.path" />
<echo
message="Scala version ${scala.version.number} - http://scala-lang.org"
level="info" taskname="scalac" />
<scalac
srcdir="${source.dir}" includes="**/*.scala"
destdir="${out.classes.dir}"
@ -43,13 +51,21 @@
<pathelement location="${out.classes.dir}" />
</classpath>
</scalac>
<touch file="${out.dir}/classes.complete" verbose="no"/>
</target>
<target name="scala-shrink" depends="scala-compile"
description="Shrink code size of Scala library">
description="Shrink code size of Scala library"
if="myapp.containsScala">
<property
name="scala-library-shrinked.jar"
value="${out.dir}/scala-library-shrinked.jar" />
<property
name="myapp.jar"
value="${out.dir}/${ant.project.name}.jar" />
<jar destfile="${myapp.jar}" basedir="${out.classes.dir}" />
<yguard>
<inoutpair in="${scala-library.jar}" out="${scala-library_shr.jar}" />
<inoutpair in="${scala-library.jar}" out="${scala-library-shrinked.jar}" />
<externalclasses>
<pathelement location="${android.jar}" />
</externalclasses>
@ -57,7 +73,7 @@
<entrypointjar name="${myapp.jar}" />
</shrink>
</yguard>
<unjar src="${scala-library_shr.jar}" dest="${out.classes.dir}" />
<unjar src="${scala-library-shrinked.jar}" dest="${out.classes.dir}" />
</target>
</project>

View File

@ -15,13 +15,13 @@
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.
# You can add the following two lines to the imported Ant script file
# By adding the following two lines to the imported Ant script file
# platforms/android-<level>/ant/ant_rules_r2.xml :
# <property name="javac.args" value="-nowarn" />
# <compilerarg value="${javac.args}"/> <!-- 'compile' target -->
# Then you can declare the followin property in order to generate detailed
# warning messages:
# javac.args=-deprecation
# <compilerarg line="${javac.args}"/> <!-- 'compile' target -->
# you can specify additional compiler arguments (e.g. to generate detailed
# warning messages):
# javac.args=-deprecation -Xlint
#sdk.dir=C:\\Progra~1\\Android
sdk.dir=/opt/android

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 660 B

After

Width:  |  Height:  |  Size: 660 B

View File

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Some files were not shown because too many files have changed in this diff Show More