Gradle's java-plugin can't configure proguard

I have a proguard task as follows:

‘’’ task myProguardTask(type: proguard.gradle.ProGuardTask) {

configuration(file: ‘scripts/tools/obfuscation.config’)

injars(file: ‘test.jar’)

libraryjars(file: ‘android.jar’)

outjars(file: ‘test_out.jar’) } ‘’’

but gradle always output errors on line " configuration(file: ‘scripts/tools/obfuscation.config’)"

‘scripts/tools/obfuscation.config’ is the path to my configuration file. As the docs says , ‘configuration’ is a closure setting.

I don’t think you are configuring the task correctly. Try this one:

task myProguardTask(type: proguard.gradle.ProGuardTask) {
     configuration file('scripts/tools/obfuscation.config')
    injars file('test.jar')
         libraryjars file('android.jar')
      outjars file('test_out.jar')

Thanks for quick reply. I had made two mistake in my gradle script.

  1. As you said, I passed the wrong params type to configuration 2. Only proguard version >= 4.9 has gradle task

Thax again.