? ? ? ? ? ? ? metadatafile="${emma.coverage.absolute.file}">
? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ?
? ? ? ? ? ?
? ? ? ? ? ?
? ? ? ? ? ?
? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? Creating library output jar file...
? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? Custom jar packaging exclusion: ${android.package.excludes}
? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? includes="**/*.class"
? ? ? ? ? ? ? ? ? ? ? ? ? ? excludes="${project.app.package.path}/R.class ${project.app.package.path}/R$*.class ${project.app.package.path}/BuildConfig.class"/>
? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ?
? ? ? ? ? ?
? ? ? ?
? ?
?
ant.properties的例子, 和上面的xml是对应的
?
key.store=D:/workAndroid/files/android_key.store
key.alias=alia
key.store.password=111111
key.alias.password=111111
java.encoding=UTF-8
java.target=7
java.source=7
?
?
在生成的apk中使用版本号文件名, 而不是用默认的 xxx-release.apk
http://jeffreysambells.com/2013/02/14/build-your-android-apk-with-the-manifest-version-number
?
? ? ? ? ? ? depends="rename-release-with-version-number,android_rules.-set-release-mode">
? ? ? ?
? ?
? ?
? ? ? ?
? ? ? ?
? ? ? ? ? ? ? ? ? ? location="${out.absolute.dir}/${ant.project.name}-${themanifest.manifest.android:versionName}-release-unsigned.apk" />
? ? ? ? ? ? ? ? ? ? location="${out.absolute.dir}/${ant.project.name}-${themanifest.manifest.android:versionName}-release.apk" />
? ?
?
?
The -set-release-mode target overrides the same target in ${sdk.dir}/tools/ant/build.xml where the out.final.file file name is originally defined. To add the version number, I override -set-release-mode by calling my rename-release-with-version-number target in the dependencies and then calling the original android_rules.-set-release-mode to finish any other setup there.
The rename-release-with-version-number target simply reads in the manifest and adds the version number to both out.final.file and out.packaged.file.
Now the build APK is ProjectName-version-release.apk and it’s automatically used by the rest of the ant build process without clumsy file renaming.