2022-01-16 11:19:01 -05:00
|
|
|
buildscript {
|
2022-03-12 15:27:15 -05:00
|
|
|
ext.kotlin_version = '1.6.10'
|
2022-01-16 11:19:01 -05:00
|
|
|
repositories {
|
|
|
|
google()
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2023-01-03 09:13:18 -05:00
|
|
|
classpath 'com.android.tools.build:gradle:7.2.0'
|
2022-01-16 11:19:01 -05:00
|
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-29 18:50:38 -05:00
|
|
|
plugins {
|
2023-01-03 09:13:18 -05:00
|
|
|
id "org.mozilla.rust-android-gradle.rust-android" version "0.9.3"
|
2022-01-29 18:50:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
group 'com.veilid.veilid'
|
|
|
|
version '1.0-SNAPSHOT'
|
|
|
|
|
2022-01-16 11:19:01 -05:00
|
|
|
rootProject.allprojects {
|
|
|
|
repositories {
|
|
|
|
google()
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
apply plugin: 'com.android.library'
|
|
|
|
apply plugin: 'kotlin-android'
|
|
|
|
|
|
|
|
android {
|
2022-03-12 15:27:15 -05:00
|
|
|
compileSdkVersion 31
|
2022-01-16 11:19:01 -05: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 18:50:38 -05:00
|
|
|
minSdkVersion 24
|
2022-03-12 15:27:15 -05:00
|
|
|
targetSdkVersion 31
|
2022-01-29 18:50:38 -05: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"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-14 01:31:16 -04:00
|
|
|
ndkVersion '26.3.11579264'
|
2022-01-29 18:50:38 -05:00
|
|
|
|
|
|
|
// Required to copy libc++_shared.so
|
|
|
|
externalNativeBuild {
|
|
|
|
cmake {
|
|
|
|
path file('CMakeLists.txt')
|
|
|
|
}
|
2022-01-16 11:19:01 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2022-03-12 15:27:15 -05:00
|
|
|
implementation "androidx.security:security-crypto:1.1.0-alpha03"
|
2023-09-21 15:53:25 -04:00
|
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
2022-01-16 11:19:01 -05:00
|
|
|
}
|
2022-01-29 18:50:38 -05: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 11:48:22 -04:00
|
|
|
pythonCommand = "python3"
|
2022-01-29 18:50:38 -05: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"])
|
|
|
|
}
|
2024-04-14 01:31:16 -04:00
|
|
|
}
|