Skip to content

Instantly share code, notes, and snippets.

@maheshwarLigade
Forked from jackgris/build.gradle
Created February 2, 2016 05:25
Show Gist options
  • Select an option

  • Save maheshwarLigade/7143ae567fe8ac7c1e20 to your computer and use it in GitHub Desktop.

Select an option

Save maheshwarLigade/7143ae567fe8ac7c1e20 to your computer and use it in GitHub Desktop.

Revisions

  1. @jackgris jackgris created this gist Jun 6, 2014.
    86 changes: 86 additions & 0 deletions build.gradle
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,86 @@
    buildscript {
    repositories {
    mavenCentral()
    maven {
    url 'https://oss.sonatype.org/content/repositories/snapshots/'
    }
    }
    dependencies {
    classpath 'com.android.tools.build:gradle:0.9.+'
    classpath 'com.squareup.gradle:gradle-android-test-plugin:0.9.1-SNAPSHOT'
    }
    }
    apply plugin: 'android'
    apply plugin: 'android-test'

    repositories {
    mavenCentral()
    maven {
    url 'https://oss.sonatype.org/content/repositories/snapshots/'
    }
    }

    android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    defaultConfig {
    minSdkVersion 9
    targetSdkVersion 19
    }

    signingConfigs {
    debug {
    storeFile file("debug.keystore")
    }

    release {
    storeFile file("project.keystore")
    storePassword "1234"
    keyAlias "Project"
    keyPassword "1234"
    }
    }

    buildTypes {
    release {
    debuggable false
    runProguard true
    signingConfig signingConfigs.release
    proguardFile getDefaultProguardFile('proguard-android-optimize.txt')
    }
    }

    productFlavors {
    defaultFlavor {
    proguardFile 'proguard-rules.txt'
    }
    }

    sourceSets {
    main {
    java.srcDirs = ['src/main/java', 'src-gen/main/java']
    }
    instrumentTest.setRoot('src/test')
    }
    }

    dependencies {

    compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
    compile 'com.android.support:support-v4:19.1.+'
    compile 'de.greenrobot:greendao:1.3.7'
    compile 'com.google.android.gms:play-services:4.4.52'

    testCompile 'junit:junit:4.10'
    testCompile 'org.robolectric:robolectric:2.1.+'
    testCompile 'com.squareup:fest-android:1.0.+'

    instrumentTestCompile 'junit:junit:4.10'
    instrumentTestCompile 'org.robolectric:robolectric:2.1.+'
    instrumentTestCompile 'com.squareup:fest-android:1.0.+'
    }

    task wrapper(type: Wrapper) {
    gradleVersion = '1.8'
    }
    94 changes: 94 additions & 0 deletions proguard-rules
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,94 @@
    ####################################################################################################
    ####################################################################################################
    ####################################################################################################
    ######################################### PROGUARD #################################################
    ####################################################################################################
    ####################################################################################################
    ####################################################################################################

    # This is a configuration file for ProGuard.
    # http://proguard.sourceforge.net/index.html#manual/usage.html
    -dontusemixedcaseclassnames
    -dontskipnonpubliclibraryclasses
    -verbose

    # Optimization is turned off by default. Dex does not like code run
    # through the ProGuard optimize and preverify steps (and performs some
    # of these optimizations on its own).
    #-dontoptimize
    #-dontpreverify

    # If you want to enable optimization, you should include the
    # following:
    -optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
    -optimizationpasses 5
    -allowaccessmodification
    #
    # Note that you cannot just include these flags in your own
    # configuration file; if you are including this file, optimization
    # will be turned off. You'll need to either edit this file, or
    # duplicate the contents of this file and remove the include of this
    # file from your project's proguard.config path property.

    -keep public class * extends android.app.Activity
    -keep public class * extends android.app.Application
    -keep public class * extends android.app.Service
    -keep public class * extends android.content.BroadcastReceiver
    -keep public class * extends android.content.ContentProvider
    -keep public class * extends android.app.backup.BackupAgent
    -keep public class * extends android.preference.Preference
    -keep public class * extends android.support.v4.app.Fragment
    -keep public class * extends android.support.v4.app.DialogFragment
    -keep public class * extends com.actionbarsherlock.app.SherlockListFragment
    -keep public class * extends com.actionbarsherlock.app.SherlockFragment
    -keep public class * extends com.actionbarsherlock.app.SherlockFragmentActivity
    -keep public class * extends android.app.Fragment
    -keep public class com.android.vending.licensing.ILicensingService

    # For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
    -keepclasseswithmembernames class * {
    native <methods>;
    }

    -keep public class * extends android.view.View {
    public <init>(android.content.Context);
    public <init>(android.content.Context, android.util.AttributeSet);
    public <init>(android.content.Context, android.util.AttributeSet, int);
    public void set*(...);
    }

    -keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet);
    }

    -keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet, int);
    }

    -keepclassmembers class * extends android.app.Activity {
    public void *(android.view.View);
    }

    # For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
    -keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
    }

    -keep class * implements android.os.Parcelable {
    public static final android.os.Parcelable$Creator *;
    }

    -keepclassmembers class **.R$* {
    public static <fields>;
    }

    -keep class android.support.v4.app.** { *; }
    -keep interface android.support.v4.app.** { *; }
    -keep class com.actionbarsherlock.** { *; }
    -keep interface com.actionbarsherlock.** { *; }
    # The support library contains references to newer platform versions.
    # Don't warn about those in case this app is linking against an older
    # platform version. We know about them, and they are safe.
    -dontwarn android.support.**
    -dontwarn com.google.ads.**