Add a custom task:

task androidReleaseJar(type: Jar, dependsOn: assembleRelease) {
       from "$buildDir/intermediates/classes/release/"
       exclude '**/BuildConfig.class'
       exclude '**/R.class'}

Reference:
1.https://github.com/facebook/rebound/blob/master/build.gradle

2.https://github.com/keyboardsurfer/Crouton/blob/master/library/build.gradle

3.
https://github.com/SnowdreamFramework/android-log/commit/4297a0244c972e3fcb9042b5e12181b21c33b524

2015-03-01 14:51 GMT+08:00 杨辉 <[email protected]>:

> Hello, everybody:
> I want to Exclude BuildConfig.class and R.class from Android library jar
> in Gradle,What can i do?
>
> as i know from
> http://stackoverflow.com/questions/24931126/exclude-buildconfig-class-from-android-library-jar-in-gradle,
>  android.packageBuildConfig
> = false is useful,but ,it was depreated in 1.0.
>
>
>
>
> --
> 杨辉
> Impossible is nothing!
>
>
>
>
> ------------------------------------------------------------------------------------
> HDExplorer APK (A Nice File Manager,Simplicity but not simple.)
>
> Google Market:
> https://market.android.com/details?id=com.hd.explorer
>
> Google Code:
> http://code.google.com/p/hdexplorer/
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to