buildscript {
    dependencies {
        repositories {
            google()
            jcenter()
            mavenCentral()

            // NOTE: This is only needed when developing the plugin!
            mavenLocal()
        }

        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'eu.f3rog.blade:plugin:2.7.2-beta3'
    }
}

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

android {
    compileSdkVersion 28
    buildToolsVersion "28.0.3"

    defaultConfig {
        applicationId "eu.f3rog.blade.sample"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
    }
    signingConfigs {
        release {
            storeFile project.file('sample.jks')
            storePassword 'blade-test'
            keyAlias 'test'
            keyPassword 'blade-test'
        }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    productFlavors {
        flavorDimensions "environment"
        mock {
            dimension = "environment"
            applicationIdSuffix = ".mock"
        }
        prod {
            dimension = "environment"
        }
    }

    // Loop variants
    android.variantFilter { variant ->
        // Loop flavors
        variant.getFlavors().each { flavor ->
            if (flavor.name.equals('mock') && variant.buildType.name.equals('release')) {
                variant.setIgnore(true)
            }
        }
    }
}

dependencies {
    implementation 'androidx.appcompat:appcompat:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
    implementation 'com.google.android.material:material:1.0.0'

    /* Dagger2 - needed for MVP module */
    implementation 'com.google.dagger:dagger:2.11'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.11'
    /* ButterKnife */
    implementation 'com.jakewharton:butterknife:9.0.0-rc1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'
    /* Rx */
    implementation 'io.reactivex:rxandroid:1.2.1'
    implementation 'io.reactivex:rxjava:1.2.5'
    /* REST API */
    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'

    testImplementation 'junit:junit:4.12'
}
