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