buildscript {
  if (project == rootProject) {
    repositories {
      google()
    }

    dependencies {
      classpath 'com.android.tools.build:gradle:3.0.0'
    }
  }
}

apply plugin: 'com.android.library'

def DEFAULT_COMPILE_SDK_VERSION             = 28
def DEFAULT_BUILD_TOOLS_VERSION             = "28.0.3"
def DEFAULT_TARGET_SDK_VERSION              = 28
def DEFAULT_GOOGLE_PLAY_SERVICES_VERSION    = "12.0.1"
def DEFAULT_SUPPORT_LIBRARY_VERSION         = "1.0.0"

android {
  compileSdkVersion rootProject.hasProperty('compileSdkVersion') ? rootProject.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
  buildToolsVersion rootProject.hasProperty('buildToolsVersion') ? rootProject.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION

  defaultConfig {
    minSdkVersion 16
    targetSdkVersion rootProject.hasProperty('targetSdkVersion') ? rootProject.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION

    versionCode 1
    versionName "1.0.0"
  }
  lintOptions {
    abortOnError false
    warning 'InvalidPackage'
  }
}

repositories {
  mavenCentral()
  mavenCentral()
  maven { url "https://jitpack.io" }
  maven {
    // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
    url "$rootDir/../node_modules/react-native/android"
  }
  maven {
    url 'https://raw.githubusercontent.com/saki4510t/libcommon/master/repository'
    allowInsecureProtocol = true
  }
}

dependencies {
  def googlePlayServicesVersion = rootProject.hasProperty('googlePlayServicesVersion')  ? rootProject.googlePlayServicesVersion : DEFAULT_GOOGLE_PLAY_SERVICES_VERSION
  def supportLibVersion = rootProject.hasProperty('supportLibVersion')  ? rootProject.supportLibVersion : DEFAULT_SUPPORT_LIBRARY_VERSION

  implementation 'com.facebook.react:react-native:+'
  // compileOnly 'com.facebook.infer.annotation:infer-annotation:+'
  implementation "com.google.zxing:core:3.2.1"
  implementation "com.drewnoakes:metadata-extractor:2.9.1"
  implementation "com.google.android.gms:play-services-vision:$googlePlayServicesVersion"
  implementation "androidx.exifinterface:exifinterface:$supportLibVersion"
  implementation "androidx.annotation:annotation:$supportLibVersion"
  implementation "androidx.legacy:legacy-support-v4:$supportLibVersion"

  implementation project(':libuvccamera')
  implementation project(':usbCameraCommon')
}
