apply plugin: 'com.android.library'

android {
  compileSdkVersion Integer.parseInt(project.COMPILE_SDK_VERSION)
  buildToolsVersion BUILD_TOOLS_VERSION

  defaultConfig {
    minSdkVersion project.MINIMUM_SDK_VERSION
  }

  lintOptions {
    abortOnError false
  }

  buildTypes {
    debug {
      minifyEnabled false
    }
    release {
      minifyEnabled false
      shrinkResources false
    }
  }

  flavorDimensions "mode"
  productFlavors {
    prod {
      dimension "mode"
      matchingFallbacks = ['internal']
    }
    internal {
      dimension "mode"
      matchingFallbacks = ['prod']
    }
  }

  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }

  testOptions {
    unitTests.all {
      testLogging {
        events "passed", "skipped", "failed", "standardOut", "standardError"
        outputs.upToDateWhen { false }
        showStandardStreams = true
      }
    }
  }

  packagingOptions {
    exclude 'META-INF/services/javax.annotation.processing.Processor'
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/MANIFEST.MF'
    exclude 'META-INF/LGPL2.1'
  }

  lintOptions {
    abortOnError false
  }
}

dependencies {
  implementation fileTree(include: ['*.jar'], dir: 'libs')
  api project(path: ':dataprovider')
  implementation project(path: ':crashreports')
  implementation project(path: ':aptoide-analytics-default-implementation')
  implementation project(path: ':utils')
  api project(path: ':aptoide-authentication-rx')

  testImplementation "junit:junit:${JUNIT_VERSION}"
  testImplementation "org.mockito:mockito-core:${MOCKITO_CORE_VERSION}"
  implementation "androidx.appcompat:appcompat:${APPCOMPAT_VERSION}"

  implementation "com.jakewharton.rxrelay:rxrelay:${RX_RELAY}"
  implementation "io.reactivex:rxjava:${RXJAVA_VERSION}"
  implementation "nl.littlerobots.rxlint:rxlint:${Rx_lint_version}"
  implementation "com.artemzin.rxjava:proguard-rules:${RXJAVA_PROGUARD_RULES_VERSION}"
  // Parceler - https://github.com/johncarl81/parceler
  implementation "org.parceler:parceler-api:${PARCELER_VERSION}"
  annotationProcessor "org.parceler:parceler:${PARCELER_VERSION}"
}
