Android Ant Pack

Source: Internet
Author: User

1. First we'll look at the ${sdk.dir}/tools/ant/build.xml of the SDK in Android

This build has already implemented all of Eclipse's development operations.

2. We only need to configure our own information now.

2.1 Configuration information is

Key.store

Key.alias

Key.store.password

Key.alias.password

These are essential, otherwise how can ant help you to hit your company's bag?

2.2 Because Ant does not know where our SDK is placed. Then you don't know where the build.xml of the source is.

So let's make a statement and introduce the SDK

<!--environment variable reference prefix--
<property environment= "env"/>
<condition property= "Sdk.dir" value= "${env. Android_home} ">
<isset property= "env. Android_home "/>
</condition>

<!--control the current compilation system--
<loadproperties srcfile= "${project.dir}/project.properties"/>


<!--app Android-sdk's build file to help us package--
<import file= "${sdk.dir}/tools/ant/build.xml"/>

3. The two target of the "clean,release" defined by the source build.xml is ready to be packaged.

<target name= "Set.app.metadata" >
<replaceregexp
File= "Androidmanifest.xml"
Match= ' Meta-data android:name= "Umeng_channel" android:value= "(. *)" '
Replace= ' meta-data android:name= ' umeng_channel ' android:value= ' WIC ' encoding= ' UTF-8 '/>

</target>

<!--project construction, the project module between the directory structure and the development environment consistent--
<target name= "build.release" depends= "clean, Set.app.metadata, release" >
< directory replication for!--cleanup and new release packages build the release package to the specified directory--
<delete dir= "Publish"/>
<mkdir dir= "releaseapk"/>
<!--Copy the build release package to the specified directory--
<copy todir= "releaseapk" >
<fileset dir= "Bin" >
<include name= "*.apk"/>
</fileset>
</copy>
</target>

Android Ant Pack

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.