// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        kotlin_version = '1.4.32'
    }
    repositories {
        mavenCentral()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.0.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "org.jacoco:org.jacoco.core:0.8.7"
        classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.8'
        classpath 'com.google.android.gms:oss-licenses-plugin:0.10.4'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
        classpath 'com.facebook.testing.screenshot:plugin:0.13.0'
        classpath "com.osacky.flank.gradle:fladle:0.15.1"
        classpath 'com.google.dagger:hilt-android-gradle-plugin:2.38.1'
    }
}

plugins {
    id 'com.osacky.fulladle' version '0.15.1'
}

fladle {
    serviceAccountCredentials = project.file("gcloud-service-key.json")
    projectId = "gratitude-journal-app"

    flankVersion = "21.05.0"

    directoriesToPull = [
            "/sdcard"
    ]

    filesToDownload = [
            "JUnitReport.xml",
            ".*/coverage/.*",
            ".*/sdcard/[^/]+\\.ec\$"
    ]

    environmentVariables = [
            coverage : "true",
            coverageFile: "/sdcard/coverage.ec"
    ]

    devices = [
            [ "model": "walleye", "version": "27", "locale": "en_US", "orientation": "portrait" ],
    ]
}

apply from: 'gradle/jacoco_ci.gradle'
apply from: 'gradle/common.gradle'

allprojects {
    repositories {
        google()
        mavenCentral()
        maven {
            url 'https://maven.google.com/'
        }
    }
}
