diff options
author | Xavier Ducrohet <xav@android.com> | 2010-04-28 16:28:35 -0700 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2010-05-03 18:01:55 -0700 |
commit | 114ca22329320d7f43af219b473d4c2461e82e7d (patch) | |
tree | 798e22bf687d807b8162d7d21788173cbb015752 /templates | |
parent | 74ab7fbdb2cbe6f9df3ee627a7751b0a3eafbb2a (diff) | |
download | replicant_sdk-114ca22329320d7f43af219b473d4c2461e82e7d.zip replicant_sdk-114ca22329320d7f43af219b473d4c2461e82e7d.tar.gz replicant_sdk-114ca22329320d7f43af219b473d4c2461e82e7d.tar.bz2 |
First step of multiple apk support.
- New export type project to handle exporting a single app represented
by multiple projects (for different minSdkVersion for instance).
- Cleaned-up the current Ant tasks and Eclipse builder to not
deal with ApkSettings anymore. It's not possible to generate
more than one APK in a single pass. The export project will
handle this and call out the normal build system to export
each variant. Make older (deprecated) attribute actually
output a warning.
- Ant rules r3 now with support for multi apk export. Lots
of clean up, add new properties to be overriden by the
multi-apk export task, make older one overrideable too.
- Better handling of older rules, older tasks, etc...
in the SetupTask used by the normal build.
- Add split by ABI to ApkSettings and use it in the
new multi apk export.
- New custom task for multi-apk export. Replaces
SetupTask for export-type projects. Calls out to the
project's build.xml after setting/overriding properties.
This also override the project's versionCode with a
new composite one made of different values.
Also uses a different build.xml, so added a new template:
build.export.template.
Very much a work in progress. Still to do:
Add other types of APK split, create/update export projects,
export the build log, ...
Also, we need to refactor the normal build rules to avoid
so much duplication!
Change-Id: I57a565c60d097a5eabb40108ae1fa8cb209f2380
Diffstat (limited to 'templates')
-rw-r--r-- | templates/build.export.template | 53 | ||||
-rw-r--r-- | templates/build.template | 3 |
2 files changed, 53 insertions, 3 deletions
diff --git a/templates/build.export.template b/templates/build.export.template new file mode 100644 index 0000000..bdf3032 --- /dev/null +++ b/templates/build.export.template @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project name="Main" 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 in in + Version Control Systems. --> + <property file="local.properties" /> + + <!-- ? --> + <property file="export.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.dir}/tools/lib/anttasks.jar" /> + <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" /> + <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" /> + <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" /> + <pathelement path="${sdk.dir}/tools/lib/jarutils.jar" /> + </path> + + <taskdef name="android-export" + classname="com.android.ant.MultiApkExportTask" + classpathref="android.antlibs" /> + + <property name="out.dir" value="bin" /> + <property name="out.absolute.dir" location="${out.dir}" /> + + <target name="-dirs"> + <echo>Creating output directories if needed...</echo> + <mkdir dir="${out.absolute.dir}" /> + </target> + + <target name="release" depends="-dirs"> + <android-export target="release" /> + </target> + + <target name="clean"> + <delete dir="${out.absolute.dir}" verbose="${verbose}" /> + <android-export target="clean"/> + </target> + + <target name="help"> + <!-- displays starts at col 13 + |13 80| --> + <echo>Android Ant Build. Available targets:</echo> + <echo> help: Displays this help.</echo> + <echo> clean: Removes output files created by other targets.</echo> + <echo> release: Builds the application. The generated apk file must be</echo> + <echo> signed before it is published.</echo> + </target> +</project> diff --git a/templates/build.template b/templates/build.template index 549ce7c..29faaa5 100644 --- a/templates/build.template +++ b/templates/build.template @@ -12,9 +12,6 @@ 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.dir The name of the source directory. Default is 'src'. out.dir |