plugins {
  id 'com.android.application' version '8.1.3'
}

android {
  namespace 'top.eiyooooo.easycontrol.server'
  compileSdk 34

  defaultConfig {
    minSdk 21
    targetSdk 34
    applicationId 'top.eiyooooo.easycontrol.server'
    versionCode 30000
    versionName '3.0.0'
  }

  buildTypes {
    release {
      ndk {
        abiFilters "arm64-v8a", "armeabi-v7a", "x86", "x86_64"
      }
      debuggable false
      proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
  }

  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }

  task copyRelease(type: Copy) {
    dependsOn 'assembleRelease'
    from file('build/outputs/apk/release/server-release-unsigned.apk')
    into file('../app/src/main/res/raw/')
    rename('server-release-unsigned.apk', 'easycontrol_server.jar')
  }

  task copyDebug(type: Copy) {
    dependsOn 'assembleDebug'
    from file("build/outputs/apk/debug/server-debug.apk")
    into file('../app/src/main/res/raw/')
    rename('server-debug.apk', 'easycontrol_server.jar')
  }

  buildFeatures {
    aidl true
  }
}

dependencies {
}