Files
amethyst/benchmark/build.gradle.kts
T
Claude 59fd1f2244 build: use directories.add for benchmark androidTest resources
srcDirs(vararg) on AGP 9 source-set Resources is deprecated; switch to
the directories MutableSet API. Preserves the original behavior of
including quartz/src/androidDeviceTest/resources in :benchmark's
androidTest java resources (verified bip39.vectors.json shows up in
processBenchmarkAndroidTestJavaRes output).
2026-05-20 15:56:53 +00:00

81 lines
2.6 KiB
Kotlin

import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
alias(libs.plugins.androidLibrary)
alias(libs.plugins.androidBenchmark)
}
android {
namespace = "com.vitorpamplona.amethyst.benchmark"
compileSdk = libs.versions.android.compileSdk.get().toInt()
defaultConfig {
minSdk = libs.versions.android.minSdk.get().toInt()
// Enable measuring on an emulator, or devices with low battery
testInstrumentationRunner = "androidx.benchmark.junit4.AndroidBenchmarkRunner"
testInstrumentationRunnerArguments["androidx.benchmark.suppressErrors"] = "EMULATOR,LOW-BATTERY"
}
testOptions {
targetSdk = libs.versions.android.targetSdk.get().toInt()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
sourceSets {
getByName("androidTest") {
resources.directories.add(file("../quartz/src/androidDeviceTest/resources").path)
}
}
testBuildType = "benchmark"
buildTypes {
getByName("debug") {
// Since debuggable can"t be modified by gradle for library modules,
// it must be done in a manifest - see src/androidTest/AndroidManifest.xml
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "benchmark-proguard-rules.pro")
}
getByName("release") {
isDefault = false
isMinifyEnabled = true
}
create("benchmark") {
isDefault = true
initWith(getByName("release"))
signingConfig = signingConfigs.getByName("debug")
}
}
}
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)
}
}
dependencies {
implementation(libs.androidx.core.ktx)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.runner)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.androidx.benchmark.junit4)
androidTestImplementation(project(":quartz"))
androidTestImplementation(project(":commons"))
// Custom C secp256k1 (libschnorr256k1) for the 3-way Android benchmark
androidTestImplementation(libs.schnorr256k1.kmp)
androidTestImplementation(libs.androidx.compose.foundation)
// Add your dependencies here. Note that you cannot benchmark code
// in an app module this way - you will need to move any code you
// want to benchmark to a library module:
// https://developer.android.com/studio/projects/android-library#Convert
}