Files
amethyst/benchmark/build.gradle.kts
Claude c80f40bb42 refactor: move the quartz microbenchmarks to the Quartz repository
The 33 benchmarks under com.vitorpamplona.quartz.benchmark only exercise
Quartz, so they now live in the Quartz repository's benchmark module, with
their history. This module keeps the benchmarks of Amethyst's own commons
code (Blurhash, ThumbHash, Robohash, RichTextParser, MetaTagsParser,
ExpandableTextCutOffCalculator).

- Drop schnorr256k1-kmp, used only by the moved secp256k1 benchmark.
- MetaTagsParserBenchmark's page moves into the module's own androidTest
  resources, so the benchmark APK no longer packs the testdata/ corpora.
- Remove the testdata/ files nothing here reads any more; Quartz has its
  own copies. The startup corpus (relayBench) and nostr_vitor_short.json
  (geode's RelayFixtures) stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014ZR5ZBfhFzRiXubJc5Evyv
2026-10-15 11:53:27 +00:00

73 lines
2.4 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
}
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(libs.quartz)
androidTestImplementation(project(":commons"))
androidTestImplementation(project(":commonsUI"))
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
}