buildscript {
  ext.kotlinVersion = '1.4.31'
  if (project == rootProject) {
        repositories {
            google()
            jcenter()
        }

        dependencies {
          classpath "com.android.tools.build:gradle:4.2.2"
          classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
        }
    }
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

def safeExtGet(prop, fallback) {
    rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

android {
    compileSdkVersion safeExtGet('PayUPaymentGateway_compileSdkVersion', 30)
    buildToolsVersion safeExtGet('PayUPaymentGateway_buildToolsVersion', '30.0.2')
    defaultConfig {
        minSdkVersion safeExtGet('PayUPaymentGateway_minSdkVersion', 21)
        targetSdkVersion safeExtGet('PayUPaymentGateway_targetSdkVersion', 30)
        versionCode 1
        versionName "1.0"
    }

    buildTypes {
      release {
        minifyEnabled false
      }
    }

    lintOptions {
        disable 'GradleCompatible'
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

repositories {
  mavenLocal()
  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://phonepe.mycloudrepo.io/public/repositories/phonepe-intentsdk-android"}
  google()
  mavenCentral()
}

dependencies {
    implementation "com.facebook.react:react-native:+"
    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'androidx.core:core-ktx:1.6.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'in.payu:payu-checkout-pro:1.7.6'
    implementation 'in.payu:olamoney:1.1.0'
    implementation 'in.payu:phonepe-intent:1.6.1'
    implementation 'in.payu:payu-gpay:1.4.0'
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
}
