plugins {
  id 'org.jetbrains.kotlin.multiplatform' version '1.3.71'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'

android {
  compileSdkVersion 29

  defaultConfig {
    applicationId "com.felipecsl.knes"
    minSdkVersion 16
    targetSdkVersion 29
    versionCode 1
    versionName "1.0"
    ndk {
      abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
    }
    externalNativeBuild {
      cmake {
        arguments '-DANDROID_STL=c++_shared'
      }
    }
  }
  externalNativeBuild {
    cmake {
      path 'CMakeLists.txt'
    }
  }
  sourceSets {
    main.java.srcDirs += 'src/main/kotlin'
    test.java.srcDirs += 'src/test/kotlin'
  }
  testOptions {
    unitTests {
      includeAndroidResources = true
    }
  }
}

kotlin {
  sourceSets {
    commonMain {
      dependencies {
        implementation project(':lib')
      }
    }
  }

  targets {
    fromPreset(presets.android, 'androidApp')
  }
}

dependencies {
  implementation 'com.google.android.material:material:1.1.0'
  implementation 'androidx.appcompat:appcompat:1.1.0'
  implementation 'androidx.cardview:cardview:1.0.0'
  implementation 'com.google.oboe:oboe:1.3.0'
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
  testImplementation 'junit:junit:4.12'
  testImplementation 'com.google.truth:truth:1.0.1'
  testImplementation 'org.mockito:mockito-core:1.10.19'
  testImplementation "org.robolectric:robolectric:3.8"
}