description = 'react-native-pdf-multi-view'

buildscript {
    repositories {
        mavenCentral()
        google()
    }

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

repositories {
    mavenCentral()
    maven {
        url 'https://jitpack.io'
        content {
            // Use Jitpack only for AndroidPdfViewer; the rest is hosted at mavenCentral.
            includeGroup "com.github.TalbotGooday"
        }
    }
}

apply plugin: 'com.android.library'

def _ext = rootProject.ext

def _reactNativeVersion = _ext.has('reactNative') ? _ext.reactNative : '+'
def _compileSdkVersion = _ext.has('compileSdkVersion') ? _ext.compileSdkVersion : 28
def _buildToolsVersion = _ext.has('buildToolsVersion') ? _ext.buildToolsVersion : '28.0.3'
def _minSdkVersion = _ext.has('minSdkVersion') ? _ext.minSdkVersion : 16
def _targetSdkVersion = _ext.has('targetSdkVersion') ? _ext.targetSdkVersion : 28



android {
    compileSdkVersion _compileSdkVersion
    buildToolsVersion _buildToolsVersion

    defaultConfig {
        minSdkVersion _minSdkVersion
        targetSdkVersion _targetSdkVersion
    }

    lintOptions {
        abortOnError true
    }

    packagingOptions {
       pickFirst 'lib/x86/libc++_shared.so'
       pickFirst 'lib/x86_64/libjsc.so'
       pickFirst 'lib/x86_64/libc++_shared.so'
       pickFirst 'lib/arm64-v8a/libjsc.so'
       pickFirst 'lib/arm64-v8a/libc++_shared.so'
       pickFirst 'lib/armeabi-v7a/libc++_shared.so'
    }
}

dependencies {
    implementation "com.facebook.react:react-native:${_reactNativeVersion}"
    // NOTE: The original repo at com.github.barteksc is abandoned by the maintainer; there will be no more updates coming from that repo.
    //       It was taken over by com.github.TalbotGooday; from now on please use this repo until (if ever) the Barteksc repo is resumed.
    implementation 'com.github.TalbotGooday:AndroidPdfViewer:3.1.0-beta.3'
    implementation 'com.google.code.gson:gson:2.8.5'
}
