Mike Herasimov
Mike Herasimov

Reputation: 1359

Android Studio: gradle's experimental plugin and ProGuard's files

I use gradle's experimental plugin in order to add some NDK code. before usage of NDK support my buildTypes section was next

buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

as you can see here I use optimized options of ProGuard. And when I started to use gradle's experimental plugin I changed those lines to

buildTypes {
        release {
            minifyEnabled true
            proguardFiles.add(file('proguard-rules.pro'))
        }
    }

The question is next: is it ok to use such options when I want to use 'proguard-android-optimize.txt' file?

If not then how I could define that I want to use 'proguard-android-optimize.txt' file with gradle's experimental plugin?

Upvotes: 1

Views: 620

Answers (1)

Darren Taft
Darren Taft

Reputation: 198

I came across this issue recently, and found that Gradle Experimental doesn't appear to include any version of ProGuard config by default, and there's no "getDefaultProguardFile()" method to call.

I've had to resort to adding the 'proguard-android-optimize.txt' file to my project for now (and referencing it in my build.gradle), as my project won't build without at least the basic rules being specified.

I'm using Gradle Experimental 0.7.2.

Upvotes: 2

Related Questions