group 'ai.longev.flutter.flutter_ble'
version '1.0-SNAPSHOT'

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
        classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.8'
    }
}

rootProject.allprojects {
    repositories {
        google()
        jcenter()
    }
}

apply plugin: 'com.android.library'
apply plugin: 'com.google.protobuf'


android {
    compileSdkVersion 28

    defaultConfig {
        minSdkVersion 19
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    lintOptions {
        disable 'InvalidPackage'
    }
    sourceSets {
        main {
            proto {
                srcDir '../protos'
            }
        }
    }
    dependencies {
        // Required for local unit tests (JUnit 4 framework)
        implementation 'androidx.core:core:1.0.2'
    }
}


protobuf {
    // Configure the protoc executable
    protoc {
        // Download from repositories
        artifact = 'com.google.protobuf:protoc:3.7.0'
    }
    plugins {
        javalite {  artifact = 'com.google.protobuf:protoc-gen-javalite:3.0.0'}
        grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.19.0' }
    }
    generateProtoTasks {
        all().each { task ->
            task.plugins {
                javalite {}
                grpc {
                    // Options added to --grpc_out
                    option 'lite'
                }
            }
        }
    }
}

dependencies {
    implementation 'com.google.protobuf:protobuf-lite:3.0.1'

}