veilid/veilid-flutter/android/build.gradle

103 lines
2.4 KiB
Groovy
Raw Normal View History

2022-01-16 16:19:01 +00:00
buildscript {
2022-03-12 20:27:15 +00:00
ext.kotlin_version = '1.6.10'
2022-01-16 16:19:01 +00:00
repositories {
google()
mavenCentral()
}
dependencies {
2023-01-03 14:13:18 +00:00
classpath 'com.android.tools.build:gradle:7.2.0'
2022-01-16 16:19:01 +00:00
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
2022-01-29 23:50:38 +00:00
plugins {
2023-01-03 14:13:18 +00:00
id "org.mozilla.rust-android-gradle.rust-android" version "0.9.3"
2022-01-29 23:50:38 +00:00
}
group 'com.veilid.veilid'
version '1.0-SNAPSHOT'
2022-01-16 16:19:01 +00:00
rootProject.allprojects {
repositories {
google()
mavenCentral()
}
}
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
android {
2022-03-12 20:27:15 +00:00
compileSdkVersion 31
2022-01-16 16:19:01 +00:00
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
2022-01-29 23:50:38 +00:00
minSdkVersion 24
2022-03-12 20:27:15 +00:00
targetSdkVersion 31
2022-01-29 23:50:38 +00:00
versionCode 1
versionName "1.0"
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
// Required to copy libc++_shared.so
externalNativeBuild {
cmake {
arguments "-DANDROID_STL=c++_shared"
targets "cpplink"
}
}
}
2023-01-03 14:13:18 +00:00
ndkVersion '25.1.8937393'
2022-01-29 23:50:38 +00:00
// Required to copy libc++_shared.so
externalNativeBuild {
cmake {
path file('CMakeLists.txt')
}
2022-01-16 16:19:01 +00:00
}
}
dependencies {
2022-03-12 20:27:15 +00:00
implementation "androidx.security:security-crypto:1.1.0-alpha03"
2022-01-16 16:19:01 +00:00
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
2022-01-29 23:50:38 +00:00
apply plugin: 'org.mozilla.rust-android-gradle.rust-android'
cargo {
module = "../rust"
libname = "veilid_flutter"
targets = ["arm", "arm64", "x86", "x86_64"]
targetDirectory = "../../target"
2022-08-23 15:48:22 +00:00
pythonCommand = "python3"
2022-01-29 23:50:38 +00:00
profile = gradle.startParameter.taskNames.any{it.toLowerCase().contains("debug")} ? "debug" : "release"
}
afterEvaluate {
// The `cargoBuild` task isn't available until after evaluation.
android.libraryVariants.all { variant ->
def productFlavor = ""
variant.productFlavors.each {
productFlavor += "${it.name.capitalize()}"
}
def buildType = "${variant.buildType.name.capitalize()}"
tasks["generate${productFlavor}${buildType}Assets"].dependsOn(tasks["cargoBuild"])
}
}