diff options
author | Xavier Ducrohet <xav@android.com> | 2012-02-27 11:43:02 -0800 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2012-02-27 11:44:17 -0800 |
commit | da1c452fe47ca12fa89156531e78a3ab218fdbe9 (patch) | |
tree | 919fb2e862fd754e12f50f8c2a9ae2332c669ee9 /files | |
parent | 9109f4c300ac241beaa6adec77844b81e8fc2552 (diff) | |
download | sdk-da1c452fe47ca12fa89156531e78a3ab218fdbe9.zip sdk-da1c452fe47ca12fa89156531e78a3ab218fdbe9.tar.gz sdk-da1c452fe47ca12fa89156531e78a3ab218fdbe9.tar.bz2 |
Ensure R/Manifest/BuildConfig classes are not added to the library jar file.
First, their are not needed there, second they can create a dx conflict
if the library uses the same package as the app.
Change-Id: I67b3f478d5d7ab79d02b6ece8b1eae31b8ed104e
Diffstat (limited to 'files')
-rw-r--r-- | files/ant/build.xml | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/files/ant/build.xml b/files/ant/build.xml index 05dfdec..a54efbb 100644 --- a/files/ant/build.xml +++ b/files/ant/build.xml @@ -108,6 +108,10 @@ classname="com.android.ant.IfElseTask" classpathref="android.antlibs" /> + <taskdef name="propertybyreplace" + classname="com.android.ant.PropertyByReplaceTask" + classpathref="android.antlibs" /> + <!-- Emma configuration --> <property name="emma.dir" value="${sdk.dir}/tools/lib" /> <path id="emma.lib"> @@ -690,8 +694,12 @@ <echo>Custom jar packaging exclusion: ${android.package.excludes}</echo> </then> </if> + + <propertybyreplace name="manifest.package.path" input="${manifest.package}" replace="." with="/" /> + <jar destfile="${out.library.jar.file}"> - <fileset dir="${out.classes.absolute.dir}" excludes="**/R.class **/R$*.class"/> + <fileset dir="${out.classes.absolute.dir}" + excludes="${manifest.package.path}/R.class ${manifest.package.path}/R$*.class ${manifest.package.path}/Manifest.class ${manifest.package.path}/Manifest$*.class ${manifest.package.path}/BuildConfig.class"/> <fileset dir="${source.absolute.dir}" excludes="**/*.java ${android.package.excludes}" /> </jar> </then> |