标签:android ant 打包 android ant android ant 环境变量配置 android ant打包及其环境变量配 andtoid java 打包
之前打包项目使用蓝贝壳打包,或者用Eclipse自带的环境打包,或者直接扔给第三方给别人打包(这里是指的爱加密打包)。接下来老于就带你们走进ant打包的时代。
每次完成一个应用后。就要上市场。上市场呢就要有很多的渠道。有很多的渠道呢。意味着要打很多个渠道包。我哩个去。
记得有个项目。100多个渠道。打到手软。回去飞机打不起来了。android就是这么屌丝。不像ios高富帅一样。就打几个而已。<?xml version="1.0" encoding="UTF-8"?> <project name="BABYRECORD" default="release"> <property file="local.properties" /> <property file="ant.properties" /> <property environment="env" /> <condition property="sdk.dir" value="${env.ANDROID_HOME}"> <isset property="env.ANDROID_HOME" /> </condition> <property name="outdir" value="bin" /> <property name="outdir-classes" value="${outdir}/classes" /> <property name="proguard-home" value="D:\\proguard4.2\\lib\\" /> <property name="sdk-folder" value="D:\android-sdk_r16-windows\android-sdk_r16-windows\android-sdk-windows" /> <property name="android-jar" value="${sdk-folder}\platforms\android-3\android.jar" /> <loadproperties srcFile="project.properties" /> <fail message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable." unless="sdk.dir" /> <import file="custom_rules.xml" optional="true" /> <import file="${sdk.dir}/tools/ant/build.xml" /> <property name="out.unaligned.dir" value="F:\BABYRECORD_${app_version}\" /> <mkdir dir="${out.unaligned.dir}" /> <target name="modify_update_file"> <echo>*********************** make channel ${channel}</echo> <replaceregexp file="AndroidManifest.xml" match='channel' replace='${channel}' byline="false" encoding="utf-8" /> <property name="out.unaligned.file" location="${out.unaligned.dir}\babyrecord_${app_version}_release_build${app_date}_${channel}.apk"/> <antcall target="release" /> </target> <target name="make_one_channels" depends="savemanifest,modify_update_file,release,replacemanifest,deletebin" description="description"> </target> <target name="replacemanifest"> <echo>*********************** replacemanifest</echo> <delete file="${basedir}\AndroidManifest.xml"/> <copy file="..\temp\build\META-INF\AndroidManifest.xml" todir="${basedir}" encoding="utf-8"/> </target> <target name="savemanifest"> <echo>*********************** savemanifest</echo> <copy file="${basedir}\AndroidManifest.xml" todir="..\temp\build\META-INF" encoding="utf-8" /> </target> <target name="deletebin"> <delete dir="${basedir}\bin\*" /> </target> <taskdef name="foreach" classname="net.sf.antcontrib.logic.ForEach" classpath="D:\android-sdk_r16-windows\android-sdk_r16-windows\android-sdk-windows\tools\ant-contrib-1.0b3.jar" /> <target name="make_channels"> <foreach target="make_one_channels" list="${market_channels}" delimiter="," param="channel"> </foreach> </target> </project>
标签:android ant 打包 android ant android ant 环境变量配置 android ant打包及其环境变量配 andtoid java 打包
原文地址:http://blog.csdn.net/androidstarjack/article/details/46423807