2022-11-29 12:16:28 -05:00

107 lines
3.2 KiB
Groovy

plugins {
id 'com.android.application'
}
android {
compileSdkVersion 33
buildToolsVersion "33.0.1"
defaultConfig {
applicationId "com.veilid.veilidtools_tests"
minSdkVersion 24
targetSdkVersion 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
// Required to copy libc++_shared.so
externalNativeBuild {
cmake {
arguments "-DANDROID_STL=c++_shared"
targets "cpplink"
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
ndkVersion '25.1.8937393'
// Required to copy libc++_shared.so
externalNativeBuild {
cmake {
version '3.22.1'
path file('CMakeLists.txt')
}
}
namespace 'com.veilid.veilidtools_tests'
testOptions {
managedDevices {
devices {
pixel2api30 (com.android.build.api.dsl.ManagedVirtualDevice) {
// Use device profiles you typically see in Android Studio.
device = "Pixel 2"
// ATD currently support only API level 30.
apiLevel = 30
// You can also specify "google-atd" if you require Google
// Play Services.
systemImageSource = "aosp-atd"
// Whether the image must be a 64 bit image.
require64Bit = false
}
}
}
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.security:security-crypto:1.1.0-alpha04'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
androidTestImplementation 'androidx.test:runner:1.5.1'
androidTestImplementation 'androidx.test:rules:1.5.0'
}
apply plugin: 'org.mozilla.rust-android-gradle.rust-android'
cargo {
module = "../../../../../"
libname = "veilid_tools"
targets = ["arm", "arm64", "x86", "x86_64"]
targetDirectory = "../../../../../../target"
prebuiltToolchains = true
profile = gradle.startParameter.taskNames.any{it.toLowerCase().contains("debug")} ? "debug" : "release"
pythonCommand = "python3"
features {
defaultAnd("android_tests", "rt-tokio")
}
}
afterEvaluate {
// The `cargoBuild` task isn't available until after evaluation.
android.applicationVariants.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"])
}
}