2024-07-03 11:00:45 -04:00
|
|
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
|
|
|
2023-08-16 17:58:25 -04:00
|
|
|
plugins {
|
2024-03-01 10:38:03 -05:00
|
|
|
alias(libs.plugins.androidLibrary)
|
|
|
|
alias(libs.plugins.jetbrainsKotlinAndroid)
|
|
|
|
alias(libs.plugins.androidBenchmark)
|
2023-08-16 17:58:25 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
|
|
|
namespace 'com.vitorpamplona.amethyst.benchmark'
|
2024-07-03 13:49:18 -04:00
|
|
|
compileSdk libs.versions.android.compileSdk.get().toInteger()
|
2023-08-16 17:58:25 -04:00
|
|
|
|
2023-11-26 21:10:15 -05:00
|
|
|
defaultConfig {
|
2024-07-03 13:49:18 -04:00
|
|
|
minSdk libs.versions.android.minSdk.get().toInteger()
|
|
|
|
targetSdk libs.versions.android.targetSdk.get().toInteger()
|
2024-03-18 18:06:37 -04:00
|
|
|
|
2023-11-26 21:10:15 -05:00
|
|
|
// Enable measuring on an emulator, or devices with low battery
|
2024-03-18 18:06:37 -04:00
|
|
|
testInstrumentationRunner 'androidx.benchmark.junit4.AndroidBenchmarkRunner'
|
2023-11-26 21:10:15 -05:00
|
|
|
testInstrumentationRunnerArguments["androidx.benchmark.suppressErrors"] = "EMULATOR,LOW-BATTERY"
|
|
|
|
}
|
|
|
|
|
2023-08-16 17:58:25 -04:00
|
|
|
compileOptions {
|
2023-08-18 19:32:30 -04:00
|
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
|
|
targetCompatibility JavaVersion.VERSION_17
|
2023-08-16 17:58:25 -04:00
|
|
|
}
|
|
|
|
|
2024-03-18 18:06:37 -04:00
|
|
|
sourceSets.androidTest.assets.srcDirs += ["../quartz/src/androidTest/assets"]
|
2023-08-16 17:58:25 -04:00
|
|
|
|
2024-02-22 13:59:59 -05:00
|
|
|
testBuildType = "benchmark"
|
2023-08-16 17:58:25 -04:00
|
|
|
buildTypes {
|
|
|
|
debug {
|
|
|
|
// Since debuggable can"t be modified by gradle for library modules,
|
|
|
|
// it must be done in a manifest - see src/androidTest/AndroidManifest.xml
|
2024-07-09 10:45:51 -04:00
|
|
|
minifyEnabled false
|
2023-08-16 17:58:25 -04:00
|
|
|
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "benchmark-proguard-rules.pro"
|
|
|
|
}
|
|
|
|
release {
|
2024-01-06 11:13:57 -05:00
|
|
|
isDefault = false
|
2024-01-06 10:53:54 -05:00
|
|
|
minifyEnabled true
|
|
|
|
}
|
|
|
|
create("benchmark") {
|
2023-08-16 17:58:25 -04:00
|
|
|
isDefault = true
|
2024-01-06 10:53:54 -05:00
|
|
|
initWith(getByName("release"))
|
|
|
|
signingConfig signingConfigs.debug
|
2023-08-16 17:58:25 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-07-03 11:00:45 -04:00
|
|
|
kotlin {
|
|
|
|
compilerOptions {
|
|
|
|
jvmTarget = JvmTarget.JVM_17
|
|
|
|
freeCompilerArgs.add("-Xstring-concat=inline")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-16 17:58:25 -04:00
|
|
|
dependencies {
|
2024-03-19 17:33:54 -04:00
|
|
|
androidTestImplementation platform(libs.androidx.compose.bom)
|
2024-03-01 10:38:03 -05:00
|
|
|
androidTestImplementation libs.androidx.runner
|
|
|
|
androidTestImplementation libs.androidx.junit
|
|
|
|
androidTestImplementation libs.junit
|
|
|
|
androidTestImplementation libs.androidx.benchmark.junit4
|
2023-08-16 17:58:25 -04:00
|
|
|
androidTestImplementation project(path: ':quartz')
|
2024-02-05 18:18:33 -05:00
|
|
|
androidTestImplementation project(path: ':commons')
|
2024-06-24 07:36:11 -03:00
|
|
|
androidTestImplementation project(path: ':ammolite')
|
2023-08-16 17:58:25 -04:00
|
|
|
|
2024-03-08 18:41:07 -05:00
|
|
|
androidTestImplementation libs.androidx.compose.foundation
|
|
|
|
|
2023-08-16 17:58:25 -04:00
|
|
|
// 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
|
|
|
|
}
|