apply plugin: 'com.android.application'
apply plugin: 'hugo'

android {
    compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
    buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION

    defaultConfig {
        minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION)
        targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)

        applicationId "io.github.froger.hellomultidex"
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    dexOptions {
        preDexLibraries = false
    }
}

repositories {
    maven { url 'https://repo.commonsware.com.s3.amazonaws.com' }
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
    maven { url 'https://maven.fabric.io/repo' }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    compile 'com.android.support:support-v4:21.+'
    compile 'com.android.support:support-v13:21.+'
    compile 'com.android.support:appcompat-v7:21.0.+'
    compile 'com.android.support:palette-v7:+'
    compile 'com.android.support:recyclerview-v7:+'
    compile 'com.google.android.gms:play-services:6.1.+'
    compile 'com.google.guava:guava:18.0'
    compile 'com.google.code.gson:gson:2.3'

    compile 'com.netflix.rxjava:rxjava-android:0.20.5'

    provided 'com.squareup.dagger:dagger-compiler:1.2.2'
    compile 'com.squareup.retrofit:retrofit:1.7.0'
    compile 'com.squareup.dagger:dagger:1.2.2'
    compile 'com.squareup.picasso:picasso:2.3.4'
    compile 'com.squareup:otto:1.3.5'

    compile 'com.jakewharton:butterknife:5.1.2'
    compile 'com.jakewharton.timber:timber:2.4.0'

    compile 'com.newrelic.agent.android:android-agent:3.+'
    compile('com.crashlytics.sdk.android:crashlytics:2.0.0@aar') {
        transitive = true;
    }

    compile 'com.soundcloud.android:android-crop:0.9.10@aar'
    compile 'se.emilsjolander:stickylistheaders:2.5.1'
    compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
    compile 'com.facebook.rebound:rebound:0.3.6'
}

afterEvaluate {
    tasks.matching {
        it.name.startsWith('dex')
    }.each { dx ->
        if (dx.additionalParameters == null) {
            dx.additionalParameters = []
        }
        dx.additionalParameters += '--multi-dex'
        dx.additionalParameters += "--main-dex-list=$projectDir/multidex.keep".toString()
    }
}
