diff options
| author | Gaurav Mathur <nobody@android.com> | 2009-05-18 15:26:51 -0700 |
|---|---|---|
| committer | The Android Open Source Project <initial-contribution@android.com> | 2009-05-18 15:26:51 -0700 |
| commit | 6ff7572fd50f148e96d87ecb347f138f69ea810d (patch) | |
| tree | 0b67965e9d0f816f9d36e41a3889780ee8112d3e /pdk | |
| parent | 37ad99b38686f4b31976eae75256a0ac0927ca62 (diff) | |
| download | android_development-6ff7572fd50f148e96d87ecb347f138f69ea810d.tar.gz android_development-6ff7572fd50f148e96d87ecb347f138f69ea810d.tar.bz2 android_development-6ff7572fd50f148e96d87ecb347f138f69ea810d.zip | |
AI 148967: Cloned from CL 148932 by 'g4 patch'.
Original change by dwarren@dwarren-pdk on 2009/05/15 16:17:05.
Adding Build Cookbook to PDK.
Automated import of CL 148967
Diffstat (limited to 'pdk')
| -rwxr-xr-x | pdk/docs/guide/build_cookbook.jd | 118 | ||||
| -rw-r--r-- | pdk/docs/guide/pdk_toc.cs | 1 |
2 files changed, 119 insertions, 0 deletions
diff --git a/pdk/docs/guide/build_cookbook.jd b/pdk/docs/guide/build_cookbook.jd new file mode 100755 index 000000000..ad5f8b89f --- /dev/null +++ b/pdk/docs/guide/build_cookbook.jd @@ -0,0 +1,118 @@ +page.title=<my_page_title> +pdk.version=<current_PDK_version> +@jd:body + +<a name="toc"/> +<div style="padding:10px"> +<a href="http://wiki.corp.google.com/twiki/bin/view/Main/AndroidBuildCookbook#Building_a_simple_APK">Building a simple APK</a><br> + <a href="http://wiki.corp.google.com/twiki/bin/view/Main/AndroidBuildCookbook#Building_a_APK_that_depends_on_a">Building a APK that depends on a static .jar file</a><br> + <a href="http://wiki.corp.google.com/twiki/bin/view/Main/AndroidBuildCookbook#Building_a_APK_that_should_be_si">Building a APK that should be signed with the platform key</a><br> + <a href="http://wiki.corp.google.com/twiki/bin/view/Main/AndroidBuildCookbook#Building_a_APK_that_should_be_si">Building a APK that should be signed with a specific vendor key</a><br> + <a href="http://wiki.corp.google.com/twiki/bin/view/Main/AndroidBuildCookbook#Adding_a_prebuilt_APK">Adding a prebuilt APK</a><br> + <a href="http://wiki.corp.google.com/twiki/bin/view/Main/AndroidBuildCookbook#Adding_a_Static_Java_Library">Adding a Static Java Library</a><br> + <a href="http://wiki.corp.google.com/twiki/bin/view/Main/AndroidBuildCookbook#LOCAL_MODULE_TAGS">Using LOCAL_MODULE_TAGS</a><br> + </div> + +<p>The Android Build Cookbook offers code snippets to help you quickly implement some common build tasks. For additional instruction, please see the other build documents in this section.</p> +<h2><a name="Building_a_simple_APK" id="Building_a_simple_APK"></a>Building a simple APK</h2> +<pre> + LOCAL_PATH := $(call my-dir) + include $(CLEAR_VARS) + + # Build all java files in the java subdirectory + LOCAL_SRC_FILES := $(call all-subdir-java-files) + + # Name of the APK to build + LOCAL_PACKAGE_NAME := LocalPackage + + # Tell it to build an APK + include $(BUILD_PACKAGE) +</pre> +<h2><a name="Building_a_APK_that_depends_on_a" id="Building_a_APK_that_depends_on_a"></a>Building a APK that depends on a static .jar file</h2> +<pre> + LOCAL_PATH := $(call my-dir) + include $(CLEAR_VARS) + + # List of static libraries to include in the package + LOCAL_STATIC_JAVA_LIBRARIES := static-library + + # Build all java files in the java subdirectory + LOCAL_SRC_FILES := $(call all-subdir-java-files) + + # Name of the APK to build + LOCAL_PACKAGE_NAME := LocalPackage + + # Tell it to build an APK + include $(BUILD_PACKAGE) +</pre> +<h2><a name="Building_a_APK_that_should_be_si" id="Building_a_APK_that_should_be_si">Building a APK that should be signed with the platform key</a></h2> +<pre> + LOCAL_PATH := $(call my-dir) + include $(CLEAR_VARS) + + # Build all java files in the java subdirectory + LOCAL_SRC_FILES := $(call all-subdir-java-files) + + # Name of the APK to build + LOCAL_PACKAGE_NAME := LocalPackage + + LOCAL_CERTIFICATE := platform + + # Tell it to build an APK + include $(BUILD_PACKAGE) +</pre> +<h2>Building a APK that should be signed with a specific vendor key</h2> +<pre> + LOCAL_PATH := $(call my-dir) + include $(CLEAR_VARS) + + # Build all java files in the java subdirectory + LOCAL_SRC_FILES := $(call all-subdir-java-files) + + # Name of the APK to build + LOCAL_PACKAGE_NAME := LocalPackage + + LOCAL_CERTIFICATE := vendor/example/certs/app + + # Tell it to build an APK + include $(BUILD_PACKAGE) +</pre> +<h2><a name="Adding_a_prebuilt_APK" id="Adding_a_prebuilt_APK"></a>Adding a prebuilt APK</h2> +<pre> + LOCAL_PATH := $(call my-dir) + include $(CLEAR_VARS) + + # Module name should match apk name to be installed. + LOCAL_MODULE := LocalModuleName + LOCAL_SRC_FILES := $(LOCAL_MODULE).apk + LOCAL_MODULE_CLASS := APPS + LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX) + + include $(BUILD_PREBUILT) +</pre> +<h2><a name="Adding_a_Static_Java_Library" id="Adding_a_Static_Java_Library"></a>Adding a Static Java Library</h2> +<pre> + LOCAL_PATH := $(call my-dir) + include $(CLEAR_VARS) + + # Build all java files in the java subdirectory + LOCAL_SRC_FILES := $(call all-subdir-java-files) + + # Any libraries that this library depends on + LOCAL_JAVA_LIBRARIES := android.test.runner + + # The name of the jar file to create + LOCAL_MODULE := sample + + # Build a static jar file. + include $(BUILD_STATIC_JAVA_LIBRARY) +</pre> +<h2><a name="Random_other_build_tidbits" id="Random_other_build_tidbits"></a>Random other build tidbits</h2> +<h3><a name="LOCAL_MODULE_TAGS" id="LOCAL_MODULE_TAGS"></a>LOCAL_MODULE_TAGS</h3> +<p>This variable controls what build flavors the package gets included in. For example:</p> +<ul type="disc"> + <li>user - means include this in user/userdebug builds</li> + <li>eng - means include this in eng builds</li> + <li>tests - means the target is a testing target and makes it available for tests</li> + <li>optional - don't include this</li> +</ul> diff --git a/pdk/docs/guide/pdk_toc.cs b/pdk/docs/guide/pdk_toc.cs index 44d94206c..ebc99577f 100644 --- a/pdk/docs/guide/pdk_toc.cs +++ b/pdk/docs/guide/pdk_toc.cs @@ -14,6 +14,7 @@ function nothing() {} <li><a href="<?cs var:toroot ?>guide/bring_up.html">Bring up</a></li> <li><a href="<?cs var:toroot ?>guide/keymaps_keyboard_input.html">Keymaps and Keyboard</a></li> <li><a href="<?cs var:toroot ?>guide/display_drivers.html">Display Drivers</a></li> + <li><a href="<?cs var:toroot ?>guide/build_cookbook.html">Build Cookbook</a></li> </ul> </li> |
