Posts Tagged ‘Gradle’

Gradle Android Plugin 0.9.8

Posted: February 22, 2011 in Android, Java
Tags:

In Gradle android Plugin 0.9.8 you can now have AIDL files processed automatically(my code contribution) also some other neat additions. Another developer is working on support for the Test stuff, I think that might be 0.9.9 which is upcoming.

Advertisements

Android Gradle Plugin

Posted: June 6, 2010 in Android
Tags: ,

Some one created a gradle android plugin. The problem I see is that instead of adjusting sourceSets in the plugin from the defaults of src/main/java, etc they make the user of the plugin do a manual adjust of the src files, not good.

I use proguard settings specific to Android Java applications so change to fit your needs before using:

task generateProguardConfigFile << { logger.info('Creating andcooper.pro file for obfsucate task') /** * andcooper.pro must have the following text * (the variables are replaced as the fiel is created): * -libraryjars androidJar: externalLibsFolder * -injars outClassesLocation * -outjars obfuscateLocation/classes.min.jar * -keep public class * extends android.app.Activity * -optimizations !code/simplification/cast * -allowaccessmodification * * '\n' goes at end of each line */ andcooperProguardConfig = new file('andcooper.pro') andcooperProguardConfig.withWriter{ writer ->
writer << ‘-libraryjars ’ + androidJar + '; ' + externalLibsFolder + '\n' writer << ‘-injars ' + outClassesLocation + '\n' writer << '-outjars ' + obfuscateLocation + '/classes.min.jar' + '\n' writer << '-keep public class * extends android.app.Activity' + '\n' writer << '-optimizations !code/simplification/cast' + '\n' writer << '-allowaccessmodification' + '\n' } } task obfuscate << { ant.taskdef(resource: 'proguard/ant/task.properties', classpath: configurations.runtime.asPath ) ant.proguard(configuration: 'andcooper.pro') } [/sourcecode] Notice all I am doing is creating the proguard.pro file on-the-fly and than using that in my taskdef via the ANTBuilder.

Reblog this post [with Zemanta]