Migrated ant scripts to Android SDK v15

pull/14/head
Tim Su 14 years ago
parent 8404b964da
commit 1998689734

@ -1,68 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project name="." default="help"> <project name="api" default="help">
<!-- The local.properties file is created and updated by the 'android' tool. <!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked in in Version It contains the path to the SDK. It should *NOT* be checked into
Control Systems. --> Version Control Systems. -->
<property file="local.properties" /> <loadproperties srcFile="local.properties" />
<!-- The build.properties file can be created by you and is never touched <!-- The ant.properties file can be created by you. It is only edited by the
by the 'android' tool. This is the place to change some of the default property values 'android' tool to add properties to it.
used by the Ant rules. This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update: 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.dir source.dir
the name of the source directory. Default is 'src'. The name of the source directory. Default is 'src'.
out.dir out.dir
the name of the output directory. Default is 'bin'. The name of the output directory. Default is 'bin'.
Properties related to the SDK location or the project target should be updated For other overridable properties, look at the beginning of the rules
using the 'android' tool with the 'update' action. files in the SDK, at tools/ant/build.xml
This file is an integral part of the build system for your application and Properties related to the SDK location or the project target should
should be checked in in Version Control Systems. 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 into Version Control Systems.
--> -->
<property file="build.properties" /> <property file="ant.properties" />
<!-- The default.properties file is created and updated by the 'android' tool, as well <!-- The project.properties file is created and updated by the 'android'
as ADT. 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. --> This contains project specific properties such as project target, and library
<property file="default.properties" /> dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
<!-- Custom Android task to deal with the project target, and import the proper rules.
This requires ant 1.6.0 or above. --> This file is an integral part of the build system for your
<path id="android.antlibs"> application and should be checked into Version Control Systems. -->
<pathelement path="${sdk.dir}/tools/lib/anttasks.jar" /> <loadproperties srcFile="project.properties" />
<pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
<pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" /> <!-- quick check on sdk.dir -->
<pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" /> <fail
<pathelement path="${sdk.dir}/tools/lib/jarutils.jar" /> message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
</path> unless="sdk.dir"
/>
<taskdef name="setup"
classname="com.android.ant.SetupTask"
classpathref="android.antlibs" /> <!-- extension targets. Uncomment the ones where you want to do custom work
in between standard targets -->
<!-- Execute the Android Setup task that will setup some properties specific to the target, <!--
and import the build rules files. <target name="-pre-build">
</target>
The rules file is imported from <target name="-pre-compile">
<SDK>/platforms/<target_platform>/templates/android_rules.xml </target>
To customize some build steps for your project: /* This is typically used for code obfuscation.
- copy the content of the main node <project> from android_rules.xml Compiled code location: ${out.classes.absolute.dir}
- paste it in this build.xml below the <setup /> task. If this is not done in place, override ${out.dex.input.absolute.dir} */
- disable the import by changing the setup task below to <setup import="false" /> <target name="-post-compile">
</target>
This will ensure that the properties are setup correctly but that your customized -->
build steps are used.
<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
--> -->
<setup /> <!-- version-tag: custom -->
<target name="javadoc"> <target name="javadoc">
<javadoc access="public" author="true" classpath="." destdir="doc" <javadoc access="public" author="true" classpath="." destdir="doc"
@ -79,4 +96,6 @@
</javadoc> </javadoc>
</target> </target>
<import file="${sdk.dir}/tools/ant/build.xml" />
</project> </project>

@ -0,0 +1,40 @@
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

@ -2,40 +2,48 @@
<project name="astrid" default="help"> <project name="astrid" default="help">
<!-- The local.properties file is created and updated by the 'android' tool. <!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked in in Version It contains the path to the SDK. It should *NOT* be checked into
Control Systems. --> Version Control Systems. -->
<property file="local.properties" /> <loadproperties srcFile="local.properties" />
<!-- The build.properties file can be created by you and is never touched <!-- The ant.properties file can be created by you. It is only edited by the
by the 'android' tool. This is the place to change some of the default property values 'android' tool to add properties to it.
used by the Ant rules. This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update: 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.dir source.dir
the name of the source directory. Default is 'src'. The name of the source directory. Default is 'src'.
out.dir out.dir
the name of the output directory. Default is 'bin'. The name of the output directory. Default is 'bin'.
Properties related to the SDK location or the project target should be updated For other overridable properties, look at the beginning of the rules
using the 'android' tool with the 'update' action. files in the SDK, at tools/ant/build.xml
This file is an integral part of the build system for your application and Properties related to the SDK location or the project target should
should be checked in in Version Control Systems. 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 into Version Control Systems.
--> -->
<property file="build.properties" /> <property file="ant.properties" />
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
<!-- The default.properties file is created and updated by the 'android' tool, as well This contains project specific properties such as project target, and library
as ADT. dependencies. Lower level build properties are stored in ant.properties
This file is an integral part of the build system for your application and (or in .classpath for Eclipse projects).
should be checked in in Version Control Systems. -->
<property file="default.properties" />
<!-- Required pre-setup import --> This file is an integral part of the build system for your
<import file="${sdk.dir}/tools/ant/pre_setup.xml" /> application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
unless="sdk.dir"
/>
<taskdef resource="net/sf/antcontrib/antlib.xml"> <taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath> <classpath>
@ -43,33 +51,14 @@
</classpath> </classpath>
</taskdef> </taskdef>
<taskdef name="setup" <!-- extension targets. Uncomment the ones where you want to do custom work
classname="com.android.ant.SetupTask" in between standard targets -->
classpathref="android.antlibs" />
<!-- Execute the Android Setup task that will setup some properties specific to the target,
and import the build rules files.
The rules file is imported from
<SDK>/platforms/<target_platform>/templates/android_rules.xml
To customize some build steps for your project:
- copy the content of the main node <project> from android_rules.xml
- paste it in this build.xml below the <setup /> task.
- disable the import by changing the setup task below to <setup import="false" />
This will ensure that the properties are setup correctly but that your customized
build steps are used.
-->
<setup />
<!-- pre-build steps -->
<target name="-pre-build" depends="clean, get-version, copy-sources, updatekeys, updatekeys-release, disable-market"> <target name="-pre-build" depends="get-version, copy-sources, updatekeys, updatekeys-release, disable-market">
<mkdir dir="gen" />
</target> </target>
<target name="copy-sources"> <target name="copy-sources">
<!-- amalgamate sources -->
<delete dir="${source.dir}" /> <delete dir="${source.dir}" />
<mkdir dir="${source.dir}" /> <mkdir dir="${source.dir}" />
<for list="${astrid.sources}" param="dir"> <for list="${astrid.sources}" param="dir">
@ -108,22 +97,6 @@
</exec> </exec>
</target> </target>
<target name="debug" depends="android_rules.debug"
description="Builds the application and signs it with a debug key.">
<delete file="${out.debug.unaligned.file}" />
</target>
<!-- post build: rename apk -->
<target name="release" depends="android_rules.release">
<mkdir dir="../release" />
<property name="out.final.package"
location="../release/${ant.project.name}-${manifest.version.code}-${manifest.version.name}-release.apk" />
<copy file="${out.release.file}"
tofile="${out.final.package}" />
<echo>Final Release Package: ${out.final.package}</echo>
</target>
<!-- update api keys --> <!-- update api keys -->
<target name="updatekeys" description="update api key values"> <target name="updatekeys" description="update api key values">
<property file="${apikey.keyfile}" /> <property file="${apikey.keyfile}" />
@ -150,7 +123,6 @@
replace="APP_ID = &quot;${apikey.facebook.id}&quot;;" /> replace="APP_ID = &quot;${apikey.facebook.id}&quot;;" />
</target> </target>
<!-- jar signing -->
<target name="-release-prompt-for-password" description="override to set signature"> <target name="-release-prompt-for-password" description="override to set signature">
<property file="${signjar.passfile}" /> <echo message="${signjar.passfile}" /> <property file="${signjar.passfile}" /> <echo message="${signjar.passfile}" />
<property name="key.alias" value="${signjar.keyalias}" /> <property name="key.alias" value="${signjar.keyalias}" />
@ -193,4 +165,61 @@
<move file="AndroidManifest_old.xml" tofile="AndroidManifest.xml" /> <move file="AndroidManifest_old.xml" tofile="AndroidManifest.xml" />
</target> </target>
<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: custom -->
<target name="debug" depends="-set-debug-files, -do-debug"
description="Builds the application and signs it with a debug key.">
<record-build-info />
<delete file="${out.packaged.file}" />
</target>
<target name="release"
depends="-set-release-mode, -release-obfuscation-check, -package, -release-prompt-for-password, -release-nosign"
if="has.keystore"
description="Builds the application. The generated apk file must be signed before
it is published.">
<property name="out.unaligned.file" location="${out.absolute.dir}/${ant.project.name}-release-unaligned.apk" />
<!-- Signs the APK -->
<echo>Signing final apk...</echo>
<signjar
jar="${out.packaged.file}"
signedjar="${out.unaligned.file}"
keystore="${key.store}"
storepass="${key.store.password}"
alias="${key.alias}"
keypass="${key.alias.password}"
verbose="${verbose}" />
<!-- Zip aligns the APK -->
<mkdir dir="../release" />
<property name="out.final.package"
location="../release/${ant.project.name}-${manifest.version.code}-${manifest.version.name}-release.apk" />
<zipalign-helper in.package="${out.unaligned.file}"
out.package="${out.final.package}" />
<echo>Final Release Package: ${out.final.package}</echo>
<record-build-info />
</target>
<import file="${sdk.dir}/tools/ant/build.xml" />
</project> </project>

@ -23,19 +23,24 @@
-keep public class * extends android.content.ContentProvider -keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper -keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference -keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-keepclasseswithmembernames class * { -keepclasseswithmembernames class * {
native <methods>; native <methods>;
} }
-keepclasseswithmembernames class * { -keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet); public <init>(android.content.Context, android.util.AttributeSet);
} }
-keepclasseswithmembernames class * { -keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int); public <init>(android.content.Context, android.util.AttributeSet, int);
} }
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
-keepclassmembers enum * { -keepclassmembers enum * {
public static **[] values(); public static **[] values();
public static ** valueOf(java.lang.String); public static ** valueOf(java.lang.String);
@ -44,6 +49,3 @@
-keep class * implements android.os.Parcelable { -keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *; public static final android.os.Parcelable$Creator *;
} }

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="facebook" default="help">
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<loadproperties srcFile="local.properties" />
<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.
For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml
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 into Version Control Systems.
-->
<property file="ant.properties" />
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
unless="sdk.dir"
/>
<!-- extension targets. Uncomment the ones where you want to do custom work
in between standard targets -->
<!--
<target name="-pre-build">
</target>
<target name="-pre-compile">
</target>
/* This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir} */
<target name="-post-compile">
</target>
-->
<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
</project>

@ -0,0 +1,40 @@
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="GreenDroid" default="help">
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<loadproperties srcFile="local.properties" />
<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.
For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml
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 into Version Control Systems.
-->
<property file="ant.properties" />
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
unless="sdk.dir"
/>
<!-- extension targets. Uncomment the ones where you want to do custom work
in between standard targets -->
<!--
<target name="-pre-build">
</target>
<target name="-pre-compile">
</target>
/* This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir} */
<target name="-post-compile">
</target>
-->
<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
</project>

@ -0,0 +1,40 @@
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
Loading…
Cancel
Save