Update dev guide for new build system and new lib system.
Change-Id: I969e9659ca7f170c515caa1cddae39d91c2d8256
This commit is contained in:
committed by
Robert Ly
parent
ca35bc5acc
commit
47ef0c9954
@@ -18,6 +18,7 @@ parent.link=index.html
|
||||
<li><a href="#RunningOnEmulator">Running on the Emulator</a></li>
|
||||
<li><a href="#RunningOnDevice">Running on a Device</a></li>
|
||||
<li><a href="#Signing">Application Signing</a></li>
|
||||
<li><a href="#AntReference">Ant Command Reference</a></li>
|
||||
</ol>
|
||||
<h2>See also</h2>
|
||||
<ol>
|
||||
@@ -58,11 +59,11 @@ Emulator</a></li>
|
||||
|
||||
<p class="note"><strong>Note:</strong> When installing JDK on Windows, the default is to install
|
||||
in the "Program Files" directory. This location will cause <code>ant</code> to fail, because of
|
||||
the space. To fix the problem, you can specify the JAVA_HOME variable like this:
|
||||
the space. To fix the problem, you can specify the JAVA_HOME variable like this:
|
||||
<pre>set JAVA_HOME=c:\Progra~1\Java\<jdkdir></pre>
|
||||
|
||||
|
||||
<p>The easiest solution, however, is to install JDK in a non-space directory, for example:</p>
|
||||
|
||||
|
||||
<pre>c:\java\jdk1.6.0_02</pre>
|
||||
|
||||
<h2 id="DebugMode">Building in Debug Mode</h2>
|
||||
@@ -141,7 +142,7 @@ ant release
|
||||
|
||||
<p>If you would like, you can configure the Android build script to automatically sign and align
|
||||
your application package. To do so, you must provide the path to your keystore and the name of
|
||||
your key alias in your project's {@code build.properties} file. With this information provided,
|
||||
your key alias in your project's {@code ant.properties} file. With this information provided,
|
||||
the build script will prompt you for your keystore and alias password when you build in release
|
||||
mode and produce your final application package, which will be ready for distribution.</p>
|
||||
|
||||
@@ -152,7 +153,7 @@ ant release
|
||||
procedure manually, <a href="#ManualReleaseMode">build unsigned</a> and then continue with
|
||||
<a href="{@docRoot}guide/publishing/app-signing.html">Signing Your Applications</a>.</p>
|
||||
|
||||
<p>To specify your keystore and alias, open the project {@code build.properties} file (found in
|
||||
<p>To specify your keystore and alias, open the project {@code ant.properties} file (found in
|
||||
the root of the project directory) and add entries for {@code key.store} and {@code key.alias}.
|
||||
For example:</p>
|
||||
<pre>
|
||||
@@ -180,16 +181,16 @@ ant release
|
||||
|
||||
<p>This creates your Android application .apk file inside the project <code>bin/</code>
|
||||
directory, named <code><em><your_project_name></em>-release.apk</code>. This .apk file has
|
||||
been signed with the private key specified in {@code build.properties} and aligned with {@code
|
||||
been signed with the private key specified in {@code ant.properties} and aligned with {@code
|
||||
zipalign}. It's ready for installation and distribution.</p>
|
||||
|
||||
<h3 id="OnceBuilt">Once built and signed in release mode</h3>
|
||||
|
||||
<p>Once you have signed your application with a private key, you can install and run it on an
|
||||
<a href="#RunningOnEmulator">emulator</a> or <a href="#RunningOnDevice">device</a>. You can
|
||||
also try installing it onto a device from a web server. Simply upload the signed .apk to a web
|
||||
site, then load the .apk URL in your Android web browser to download the application and begin
|
||||
installation. (On your device, be sure you have enabled
|
||||
<a href="#RunningOnEmulator">emulator</a> or <a href="#RunningOnDevice">device</a>. You can
|
||||
also try installing it onto a device from a web server. Simply upload the signed .apk to a web
|
||||
site, then load the .apk URL in your Android web browser to download the application and begin
|
||||
installation. (On your device, be sure you have enabled
|
||||
<em>Settings > Applications > Unknown sources</em>.)</p>
|
||||
|
||||
<h2 id="RunningOnEmulator">Running on the Emulator</h2>
|
||||
@@ -260,10 +261,6 @@ adb -s emulator-5554 install <em>path/to/your/app</em>.apk
|
||||
device:</p>
|
||||
|
||||
<ul>
|
||||
<li>Ensure that your application is debuggable by setting the
|
||||
<code>android:debuggable</code> attribute of the <code><application></code>
|
||||
element to <code>true</code>. As of ADT 8.0, this is done by default when you build in debug mode.</li>
|
||||
|
||||
<li>Enable USB Debugging on your device. You can find the setting on most Android devices by
|
||||
going to <strong>Settings > Applications > Development > USB debugging</strong>.</li>
|
||||
|
||||
@@ -276,7 +273,7 @@ adb -s emulator-5554 install <em>path/to/your/app</em>.apk
|
||||
<p>Once your device is set up and connected via USB, navigate to your SDK's <code>platform-tools/</code>
|
||||
directory and install the <code>.apk</code> on the device:</p>
|
||||
<pre>
|
||||
adb -d install <em>path/to/your/app</em>.apk
|
||||
adb -d install <em>path/to/your/app</em>.apk
|
||||
</pre>
|
||||
|
||||
<p>The {@code -d} flag specifies that you want to use the attached device (in case you also have
|
||||
@@ -315,4 +312,60 @@ adb -d install <em>path/to/your/app</em>.apk
|
||||
<p>Please read <a href="{@docRoot}guide/publishing/app-signing.html">Signing Your
|
||||
Applications</a>, which provides a thorough guide to application signing on Android and what it
|
||||
means to you as an Android application developer. The document also includes a guide to exporting
|
||||
and signing your application with the ADT's Export Wizard.</p>
|
||||
and signing your application with the ADT's Export Wizard.</p>
|
||||
|
||||
<h2 id="AntReference">Ant Command Reference</h2>
|
||||
<dt><code>ant clean</code></dt>
|
||||
<dd>Cleans the project. If you include the <code>all</code> target before <code>clean</code>
|
||||
(<code>ant all clean</code>), other projects are also cleaned. For instance if you clean a
|
||||
test project, the tested project is also cleaned.</dd>
|
||||
|
||||
<dt><code>ant debug</code></dt>
|
||||
<dd>Builds a debug package. Works on application, library, and test projects and compiles
|
||||
dependencies as needed.</dd>
|
||||
|
||||
<dt id="emma"><code>ant emma debug</code></dt>
|
||||
<dd>Builds a test project while building the tested project with instrumentation turned on.
|
||||
This is used to run tests with code coverage enabled.</dd>
|
||||
|
||||
<dt><code>ant release</code></dt>
|
||||
<dd>Builds a release package.</dd>
|
||||
|
||||
<dt><code>ant instrument</code>
|
||||
</dt>
|
||||
<dd>Builds an instrumented debug package. This is generally called automatically when building a
|
||||
test project with code coverage enabled (with the <code>emma</code>
|
||||
target)</dd>
|
||||
|
||||
<dt><code>ant <build_target> install</code></dt>
|
||||
<dd>Builds and installs a package. Using <code>install</code> by itself fails.</dd>
|
||||
|
||||
<dt><code>ant installd</code></dt>
|
||||
<dd>Installs an already compiled debug package. This fails if the <code>.apk</code> is not
|
||||
already built.</dd>
|
||||
|
||||
<dt><code>ant installr</code></dt>
|
||||
<dd>Installs an already compiled release package. This fails if the <code>.apk</code> is not
|
||||
already built.</dd>
|
||||
|
||||
<dt><code>ant installt</code></dt>
|
||||
<dd>Installs an already compiled test package. Also installs the <code>.apk</code> of the
|
||||
tested application. This fails if the <code>.apk</code> is not already built.</dd>
|
||||
|
||||
<dt><code>ant installi</code></dt>
|
||||
<dd>Installs an already compiled instrumented package. This is generally not used manually as
|
||||
it's called when installing a test package. This fails if the <code>.apk</code> is not already
|
||||
built.</dd>
|
||||
|
||||
<dt><code>ant test</code></dt>
|
||||
<dd>Runs the tests (for test projects). The tested and test <code>.apk</code> files must be
|
||||
previously installed.</dd>
|
||||
|
||||
<dt><code>ant debug installt test</code></dt>
|
||||
<dd>Builds a test project and the tested project, installs both <code>.apk</code> files, and
|
||||
runs the tests.</dd>
|
||||
|
||||
<dt><code>ant emma debug installt test</code></dt>
|
||||
<dd>Builds a test project and the tested project, installs both <code>.apk</code> files, and
|
||||
runs the tests with code coverage enabled.</dd>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ page.title=Managing Projects
|
||||
</li>
|
||||
|
||||
<li><a href="#TestProjects">Test Projects</a></li>
|
||||
|
||||
|
||||
<li><a href="#testing">Testing a Library Project</a></li>
|
||||
</ol>
|
||||
</div>
|
||||
@@ -43,7 +43,7 @@ page.title=Managing Projects
|
||||
<dt><strong>Library Projects</strong></dt>
|
||||
|
||||
<dd>These projects contain shareable Android source code and resources that you can reference
|
||||
in Android projects. This is useful when you have common code that you want to reuse.
|
||||
in Android projects. This is useful when you have common code that you want to reuse.
|
||||
Library projects cannot be installed onto a device, however, they are
|
||||
pulled into the <code>.apk</code> file at build time.</dd>
|
||||
</dl>
|
||||
@@ -125,7 +125,7 @@ page.title=Managing Projects
|
||||
|
||||
<dt><code>menu/</code></dt>
|
||||
|
||||
<dd>For XML files that define application menus.
|
||||
<dd>For XML files that define application menus.
|
||||
See the <a href="{@docRoot}guide/topics/resources/menu-resource.html">Menus</a>
|
||||
resource type.</dd>
|
||||
|
||||
@@ -168,23 +168,33 @@ page.title=Managing Projects
|
||||
<a href="{@docRoot}guide/topics/manifest/manifest-intro.html">AndroidManifest.xml</a>
|
||||
documentation for more information</dd>
|
||||
|
||||
<dt><code>build.properties</code></dt>
|
||||
<dt><code>project.properties</code></dt>
|
||||
|
||||
<dd>This file contains project settings, such as the build target. This file is integral to
|
||||
the project, so maintain it in a source revision control system. To edit project
|
||||
properties in Eclipse, right-click the project folder and select
|
||||
<strong>Properties</strong>.</dd>
|
||||
|
||||
<dt><code>local.properties</code></dt>
|
||||
|
||||
<dd>Customizable computer-specific properties for the build system. If you use Ant to build
|
||||
the project, this contains the path to the SDK installation. Because the content of the file
|
||||
is specific to the local installation of the SDK, maintained it in a source
|
||||
revision control system. If you use Eclipse, this file is not used.</dd>
|
||||
|
||||
<dt><code>ant.properties</code></dt>
|
||||
|
||||
<dd>Customizable properties for the build system. You can edit this file to override default
|
||||
build settings used by Ant and provide a pointer to your keystore and key alias so that the
|
||||
build tools can sign your application when built in release mode. If you use Eclipse, this file
|
||||
is not used.</dd>
|
||||
build settings used by Ant and also provide the location of your keystore and key alias so that
|
||||
the build tools can sign your application when building in release mode. This file is integral
|
||||
to the project, so maintain it in a source revision control system. If you use Eclipse, this
|
||||
file is not used.</dd>
|
||||
|
||||
<dt><code>build.xml</code></dt>
|
||||
|
||||
<dd>The Ant build file for your project. This is only applicable for projects that
|
||||
you create on the command line.</dd>
|
||||
you build with Ant.</dd>
|
||||
|
||||
<dt><code>default.properties</code></dt>
|
||||
|
||||
<dd>This file contains project settings, such as the build target. This files is integral to
|
||||
the project, as such, it should be maintained in a Source Revision Control system. Do not edit
|
||||
the file manually.</dd>
|
||||
</dl>
|
||||
|
||||
<h2 id="LibraryProjects">Library Projects</h2>
|
||||
@@ -199,7 +209,7 @@ page.title=Managing Projects
|
||||
|
||||
<p>To download the sample applications and run them as projects in
|
||||
your environment, use the <em>Android SDK and AVD Manager</em> to download the "Samples for
|
||||
SDK API 8" component into your SDK.</p>
|
||||
SDK API 8" (or later) component into your SDK.</p>
|
||||
|
||||
<p>For more information and to browse the code of the samples, see
|
||||
the <a href="{@docRoot}resources/samples/TicTacToeMain/index.html">TicTacToeMain
|
||||
@@ -212,9 +222,10 @@ page.title=Managing Projects
|
||||
and, at build time, include its compiled sources in their <code>.apk</code> files. Multiple
|
||||
application projects can reference the same library project and any single application project
|
||||
can reference multiple library projects.</p>
|
||||
|
||||
<p class="note"><strong>Note:</strong> You need SDK Tools r8 or newer to fully support library projects
|
||||
for all Android platform versions. You can download the tools and platforms using the
|
||||
|
||||
<p class="note"><strong>Note:</strong> You need SDK Tools r14 or newer to use the new library
|
||||
project feature that generates each library project into its own JAR file.
|
||||
You can download the tools and platforms using the
|
||||
<em>Android SDK and AVD Manager</em>, as described in
|
||||
<a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a>.</p>
|
||||
|
||||
@@ -246,12 +257,12 @@ page.title=Managing Projects
|
||||
library in the dependent application and building that application.</p>
|
||||
|
||||
<p>When you build an application that depends on a library project, the SDK tools compile the
|
||||
library and merge its sources with those in the main project, then use the result to generate
|
||||
the <code>.apk</code>. In cases where a resource ID is defined in both the application and the
|
||||
library, the tools ensure that the resource declared in the application gets priority and that
|
||||
the resource in the library project is not compiled into the application <code>.apk</code>.
|
||||
This gives your application the flexibility to either use or redefine any resource behaviors or
|
||||
values that are defined in any library.</p>
|
||||
library into a temporary JAR file and uses it in the main project, then uses the
|
||||
result to generate the <code>.apk</code>. In cases where a resource ID is defined in both the
|
||||
application and the library, the tools ensure that the resource declared in the application gets
|
||||
priority and that the resource in the library project is not compiled into the application
|
||||
<code>.apk</code>. This gives your application the flexibility to either use or redefine any
|
||||
resource behaviors or values that are defined in any library.</p>
|
||||
|
||||
<p>To organize your code further, your application can add references to multiple library
|
||||
projects, then specify the relative priority of the resources in each library. This lets you
|
||||
@@ -259,15 +270,13 @@ page.title=Managing Projects
|
||||
libraries referenced from an application define the same resource ID, the tools select the
|
||||
resource from the library with higher priority and discard the other.</p>
|
||||
|
||||
<p>Once you have added references to library projects to your Android project,
|
||||
<p>Once you have added references to library projects to your Android project,
|
||||
you can set their relative priority. At build time, the
|
||||
libraries are merged with the application one at a time, starting from the lowest priority to
|
||||
the highest.</p>
|
||||
|
||||
<p>Note that a library project cannot itself reference another library project and that, at
|
||||
build time, library projects are <em>not</em> merged with each other before being merged with
|
||||
the application. However, note that a library can import an external library (JAR) in the
|
||||
normal way.</p>
|
||||
<p>Library projects can reference other library projects and can import an external library
|
||||
(JAR) in the normal way.</p>
|
||||
|
||||
<h3 id="considerations">Development considerations</h3>
|
||||
|
||||
@@ -283,22 +292,23 @@ page.title=Managing Projects
|
||||
defined in more than one project and will be merged, with the resource from the application or
|
||||
highest-priority library taking precedence.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li><p><strong>Use prefixes to avoid resource conflicts</strong></p>
|
||||
|
||||
<p>To avoid resource conflicts for common resource IDs, consider using a prefix or other
|
||||
consistent naming scheme that is unique to the project (or is unique across all projects).</p></li>
|
||||
|
||||
|
||||
<li><p><strong>You cannot export a library project to a JAR file</strong></p>
|
||||
|
||||
<p>A library cannot be distributed as a binary file (such as a jar file). This is because the
|
||||
library project is compiled by the main project to use the correct resource IDs.</p></li>
|
||||
<p>A library cannot be distributed as a binary file (such as a JAR file). This will
|
||||
be added in a future
|
||||
version of the SDK Tools.</p></li>
|
||||
|
||||
<li><p><strong>A library project can include a JAR library</strong></p>
|
||||
|
||||
<p>You can develop a library project that itself includes a JAR library, however you need to
|
||||
manually edit the dependent application project's build path and add a path to the JAR file.</p></li>
|
||||
|
||||
|
||||
<li><p><strong>A library project can depend on an external JAR library</strong></p>
|
||||
|
||||
<p>You can develop a library project that depends on an external library (for example, the Maps
|
||||
@@ -316,7 +326,7 @@ page.title=Managing Projects
|
||||
used by an application must be stored in the <code>assets/</code> directory of the application
|
||||
project itself. However, resource files saved in the
|
||||
<code>res/</code> directory are supported.</p></li>
|
||||
|
||||
|
||||
<li><p><strong>Platform version must be lower than or equal to the Android project</strong></p>
|
||||
|
||||
<p>A library is compiled as part of the dependent application project, so the API used in the
|
||||
@@ -327,12 +337,12 @@ page.title=Managing Projects
|
||||
higher than that of the application, the application project will not compile. It is
|
||||
perfectly acceptable to have a library that uses the Android 1.5 API (API level 3) and that is
|
||||
used in an Android 1.6 (API level 4) or Android 2.1 (API level 7) project, for instance.</p></li>
|
||||
|
||||
|
||||
<li> <p><strong>No restriction on library package names</strong></p>
|
||||
|
||||
<p>There is no requirement for the package name of a library to be the same as that of
|
||||
applications that use it.</p></li>
|
||||
|
||||
|
||||
<li><p><strong>Each library project creates its own R class </strong></p>
|
||||
|
||||
<p>When you build the dependent application project, library projects are compiled and
|
||||
@@ -340,7 +350,7 @@ page.title=Managing Projects
|
||||
to the library's package name. The <code>R</code> class generated from main
|
||||
project and the library project is created in all the packages that are needed including the main
|
||||
project's package and the libraries' packages.</p></li>
|
||||
|
||||
|
||||
<li><p><strong>Library project storage location</strong></p>
|
||||
|
||||
<p>There are no specific requirements on where you should store a library project, relative to a
|
||||
@@ -351,7 +361,7 @@ page.title=Managing Projects
|
||||
|
||||
<h2 id="TestProjects">Test Projects</h2>
|
||||
|
||||
<p>Test projects contain Android applications that you write using the
|
||||
<p>Test projects contain Android applications that you write using the
|
||||
<a href="{@docRoot}guide/topics/testing/index.html">Testing and
|
||||
Instrumentation framework</a>. The framework is an extension of the JUnit test framework and adds
|
||||
access to Android system objects. The file structure of a test project is the same as an
|
||||
@@ -387,24 +397,36 @@ page.title=Managing Projects
|
||||
<code><instrumentation></code></a>
|
||||
element that connects the test project with the application project.</dd>
|
||||
|
||||
<dt><code>build.properties</code></dt>
|
||||
<dt><code>project.properties</code></dt>
|
||||
|
||||
<dd>This file contains project settings, such as the build target and links to the project being
|
||||
tested. This file is integral to the project, so maintain it in a source
|
||||
revision control system. To edit project properties in Eclipse, right-click the project folder
|
||||
and select <strong>Properties</strong>.</dd>
|
||||
|
||||
<dt><code>local.properties</code></dt>
|
||||
|
||||
<dd>Customizable computer-specific properties for the build system. If you use Ant to build
|
||||
the project, this contains the path to the SDK installation. Because the content of the file
|
||||
is specific to the local installation of the SDK, it should not be maintained in a Source
|
||||
Revision Control system. If you use Eclipse, this file is not used.</dd>
|
||||
|
||||
<dt><code>ant.properties</code></dt>
|
||||
|
||||
<dd>Customizable properties for the build system. You can edit this file to override default
|
||||
build settings used by Ant and provide a pointer to your keystore and key alias so that the
|
||||
build tools can sign your application when built in release mode.</dd>
|
||||
build settings used by Ant and provide the location to your keystore and key alias, so that the
|
||||
build tools can sign your application when building in release mode. This file is integral to
|
||||
the project, so maintain it in a source revision control system.
|
||||
If you use Eclipse, this file is not used.</dd>
|
||||
|
||||
<dt><code>build.xml</code></dt>
|
||||
|
||||
<dd>The Ant build file for your project.</dd>
|
||||
<dd>The Ant build file for your project. This is only applicable for projects that
|
||||
you build with Ant.</dd>
|
||||
</dl>
|
||||
|
||||
<dt><code>default.properties</code></dt>
|
||||
|
||||
<dd>This file contains project settings, such as the build target. This files is integral to
|
||||
the project, as such, it should be maintained in a Source Revision Control system. It should
|
||||
never be edited manually — to edit project properties, right-click the project folder and
|
||||
select "Properties".</dd>
|
||||
</dl>For more information, see the <a href=
|
||||
"{@docRoot}guide/developing/testing/index.html">Testing</a> section.
|
||||
<p>For more information, see the <a href=
|
||||
"{@docRoot}guide/developing/testing/index.html">Testing</a> section.</p>
|
||||
|
||||
|
||||
<h2 id="testing">Testing a Library Project</h2>
|
||||
|
||||
@@ -37,8 +37,8 @@ file</a></li>
|
||||
|
||||
<p>The <code>android</code> tool provides you with commands to create all three types of
|
||||
projects. An Android project contains all of the files and resources that are needed to build a
|
||||
project into an .apk file for installation.
|
||||
|
||||
project into an .apk file for installation.
|
||||
|
||||
<ul>
|
||||
<li>An Android project contains all of the files and resources that are needed to build a project into
|
||||
an .apk file for installation. You need to create an Android project for any application that you
|
||||
@@ -107,13 +107,14 @@ android create project \
|
||||
"{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge</a> (adb) — located in the
|
||||
SDK <code>platform-tools/</code> directory — to send your application to the emulator (discussed
|
||||
later). So you need access between your project solution and the <code>platform-tools/</code> folder.</p>
|
||||
|
||||
|
||||
<p class="note"><strong>Tip:</strong> Add the <code>platform-tools/</code> as well as the <code>tools/</code> directory
|
||||
to your <code>PATH</code> environment variable.</p>
|
||||
|
||||
|
||||
<p class="caution"><strong>Caution:</strong> You should refrain from moving the location of the
|
||||
SDK directory, because this will break the build scripts. (They will need to be manually updated
|
||||
to reflect the new SDK location before they will work again.)</p>
|
||||
SDK directory, because this will break the SDK location property located in <code>local.properties</code>.
|
||||
If you need to update the SDK location, use the <code>android update project</code> command.
|
||||
See <a href="UpdatingAProject">Updating a Project</a> for more information.</p>
|
||||
|
||||
<h2 id="UpdatingAProject">Updating a Project</h2>
|
||||
|
||||
@@ -166,7 +167,7 @@ android create lib-project --name <your_project_name> \
|
||||
|
||||
<p>The <code>create lib-project</code> command creates a standard project structure that includes
|
||||
preset property that indicates to the build system that the project is a library. It does this by
|
||||
adding this line to the project's <code>default.properties</code> file:</p>
|
||||
adding this line to the project's <code>project.properties</code> file:</p>
|
||||
<pre class="no-pretty-print">
|
||||
android.library=true
|
||||
</pre>
|
||||
@@ -176,7 +177,7 @@ android.library=true
|
||||
|
||||
<p>If you want to convert an existing application project to a library project, so that other
|
||||
applications can use it, you can do so by adding a the <code>android.library=true</code> property
|
||||
to the application's <code>default.properties</code> file.</p>
|
||||
to the application's <code>project.properties</code> file.</p>
|
||||
|
||||
<h3 id="CreatingManifestFile">Creating the manifest file</h3>
|
||||
|
||||
@@ -225,13 +226,13 @@ android update lib-project \
|
||||
|
||||
<p>This command updates the application project's build properties to include a reference to the
|
||||
library project. Specifically, it adds an <code>android.library.reference.<em>n</em></code>
|
||||
property to the project's <code>default.properties</code> file. For example:</p>
|
||||
property to the project's <code>project.properties</code> file. For example:</p>
|
||||
<pre class="no-pretty-print">
|
||||
android.library.reference.1=path/to/library_projectA
|
||||
</pre>
|
||||
|
||||
<p>If you are adding references to multiple libraries, note that you can set their relative
|
||||
priority (and merge order) by manually editing the <code>default.properties</code> file and
|
||||
priority (and merge order) by manually editing the <code>project.properties</code> file and
|
||||
adjusting the each reference's <code>.<em>n</em></code> index as appropriate. For example, assume
|
||||
these references:</p>
|
||||
<pre class="no-pretty-print">
|
||||
|
||||
@@ -59,7 +59,7 @@ parent.link=index.html
|
||||
customizing the ProGuard configuration file.</p>
|
||||
|
||||
<p>To enable ProGuard so that it runs as part of an Ant or Eclipse build, set the
|
||||
<code>proguard.config</code> property in the <code><project_root>/default.properties</code>
|
||||
<code>proguard.config</code> property in the <code><project_root>/project.properties</code>
|
||||
file. The path can be an absolute path or a path relative to the project's root.</p>
|
||||
<p>If you left the <code>proguard.cfg</code> file in its default location (the project's root directory),
|
||||
you can specify its location like this:</p>
|
||||
|
||||
@@ -21,7 +21,7 @@ will automatically zipalign your .apk after it signs it with your private key.
|
||||
The build scripts used
|
||||
when compiling your application with Ant will also zipalign your .apk,
|
||||
as long as you have provided the path to your keystore and the key alias in
|
||||
your project {@code build.properties} file, so that the build tools
|
||||
your project {@code ant.properties} file, so that the build tools
|
||||
can sign the package first.</p>
|
||||
|
||||
<p class="caution"><strong>Caution:</strong> zipalign must only be performed
|
||||
|
||||
@@ -434,13 +434,13 @@ key and then align it using {@code zipalign}.</p>
|
||||
|
||||
<p>However, the Ant build script can also perform the signing
|
||||
and aligning for you, if you have provided the path to your keystore and the name of
|
||||
your key alias in the project's {@code build.properties} file. With this information provided,
|
||||
your key alias in the project's {@code ant.properties} file. With this information provided,
|
||||
the build script will prompt you for your keystore and alias password when you perform
|
||||
<code>ant release</code>, it will sign the package and then align it. The final output
|
||||
file in {@code bin/} will instead be
|
||||
<code><em><your_project_name></em>-release.apk</code>. With these steps
|
||||
automated for you, you're able to skip the manual procedures below (steps 3 and 4).
|
||||
To learn how to specify your keystore and alias in the {@code build.properties} file,
|
||||
To learn how to specify your keystore and alias in the {@code ant.properties} file,
|
||||
see <a href="{@docRoot}guide/developing/building/building-cmdline.html#ReleaseMode">
|
||||
Building and Running Apps on the Command Line</a>.</p>
|
||||
|
||||
|
||||
@@ -662,7 +662,7 @@ name, package, and set other fields as needed. </li>
|
||||
</ol>
|
||||
|
||||
<p> When created, the project is
|
||||
predefined as a library project in its <code>default.properties</code> file, so
|
||||
predefined as a library project in its <code>project.properties</code> file, so
|
||||
no further configuration is needed. </p>
|
||||
|
||||
<p>For more information about how to create an application project or work with
|
||||
@@ -712,7 +712,7 @@ application from the application's project properties.</div>
|
||||
|
||||
<p>If you are developing using the SDK command-line tools, navigate to the
|
||||
directory containing your application project and open the
|
||||
<code>default.properties</code> file. Add a line to the file that specifies the
|
||||
<code>project.properties</code> file. Add a line to the file that specifies the
|
||||
<code>android.library.reference.<n></code> key and the path to the
|
||||
library. For example: </p>
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ page.title=Eclipse 内で ADT を使用
|
||||
<dd>アプリケーションのリソース用(描画ファイル、レイアウト ファイル、文字列値など)のフォルダです。<a href="{@docRoot}guide/topics/resources/index.html">Resources and Assets</a>をご覧ください。</dd>
|
||||
<dt><code>AndroidManifest.xml</code></dt>
|
||||
<dd>このプロジェクトの Android マニフェストです。<a href="{@docRoot}guide/topics/manifest/manifest-intro.html">The AndroidManifest.xml File</a>をご覧ください。</dd>
|
||||
<dt><code>default.properties</code></dt>
|
||||
<dt><code>project.properties</code></dt>
|
||||
<dd>このファイルには、ビルド ターゲットのようなプロジェクトの設定が含まれます。このファイルはプロジェクトに不可欠なので、ソース リビジョン管理システムで管理する必要があります。このファイルを手動で編集しないでください。プロジェクトのプロパティを編集するには、プロジェクト フォルダを右クリックして、[プロパティ(Properties)] を選択します。</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
@@ -98,8 +98,8 @@ android create project \
|
||||
<ul>
|
||||
<li><code>AndroidManifest.xml</code> - アプリケーションのマニフェスト ファイル。指定したプロジェクトの Activity クラスと同期されます。</li>
|
||||
<li><code>build.xml</code> - Ant 用のビルド ファイルです。</li>
|
||||
<li><code>default.properties</code> - ビルド システム用のプロパティです。このファイルを変更しないでください。<em></em></li>
|
||||
<li><code>build.properties</code> - ビルド システム用のカスタマイズ可能なプロパティです。このファイルを編集して、Ant が使用するデフォルトのビルド設定をオーバーライドできます。</li>
|
||||
<li><code>project.properties</code> - ビルド システム用のプロパティです。このファイルを変更しないでください。<em></em></li>
|
||||
<li><code>ant.properties</code> - ビルド システム用のカスタマイズ可能なプロパティです。このファイルを編集して、Ant が使用するデフォルトのビルド設定をオーバーライドできます。</li>
|
||||
<li><code>src<em>/your/package/namespace/ActivityName</em>.java</code> - プロジェクトの作成時に指定した Activity クラスです。</li>
|
||||
<li><code>bin/</code> - ビルド スクリプト用の出力ディレクトリです。</li>
|
||||
<li><code>gen/</code> - <code>Ant</code> が生成するファイル(<code>R.java</code> など)が含まれます。 </li>
|
||||
|
||||
@@ -67,7 +67,7 @@ when building in debug mode.</li>
|
||||
information to sign the packages, since aligning has to happen after signing. In
|
||||
order to be able to sign packages, and therefore to align them, <em>Ant</em>
|
||||
needs to know the location of the keystore and the name of the key in
|
||||
<code>build.properties</code>. The name of the properties are
|
||||
<code>ant.properties</code>. The name of the properties are
|
||||
<code>key.store</code> and <code>key.alias</code> respectively. If those
|
||||
properties are present, the signing tool will prompt to enter the store/key
|
||||
passwords during the build, and the script will sign and then align the apk
|
||||
|
||||
Reference in New Issue
Block a user