diff --git a/android/build.gradle.kts b/android/build.gradle.kts index 73ff4d9d..e022e078 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -23,7 +23,6 @@ plugins { alias(libs.plugins.anvil) alias(libs.plugins.modulegraphassert) alias(libs.plugins.whetstone) - alias(libs.plugins.baselineprofile) alias(libs.plugins.licensee) alias(libs.plugins.tracelog) alias(libs.plugins.kotlin.composeCompiler) @@ -47,13 +46,6 @@ extensions.configure { aboutLibraries.collect.gitHubApiToken = providers.environmentVariable("GITHUB_TOKEN").orNull -baselineProfile { - mergeIntoMain = true - saveInSrc = true - // dependencyProject is deprecated, needs new APIs in the baseline profile plugin. - @Suppress("deprecation") from(projects.benchmark.dependencyProject) -} - composeCompiler { featureFlags.addAll( ComposeFeatureFlag.OptimizeNonSkippingGroups, @@ -145,7 +137,6 @@ dependencies { kapt(libs.dagger.compiler) addTestDependencies(project) - androidTestImplementation(libs.androidx.test.espresso.core) androidTestImplementation(libs.androidx.test.uiautomator) androidTestImplementation(libs.leakcanary.android.test) } diff --git a/benchmark/.gitignore b/benchmark/.gitignore deleted file mode 100644 index 42afabfd..00000000 --- a/benchmark/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/benchmark/build.gradle.kts b/benchmark/build.gradle.kts deleted file mode 100644 index 52153ccc..00000000 --- a/benchmark/build.gradle.kts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright © Harsh Shandilya. - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - */ -@file:Suppress("UnstableApiUsage") - -plugins { - id(libs.plugins.android.test.get().pluginId) - id("dev.msfjarvis.claw.kotlin-android") - alias(libs.plugins.baselineprofile) - alias(libs.plugins.dependencyAnalysis) -} - -android { - namespace = "dev.msfjarvis.claw.benchmark" - - compileSdk = 34 - defaultConfig { - minSdk = 28 - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - create("benchmark") { - isDebuggable = true - signingConfig = signingConfigs["debug"] - matchingFallbacks += "release" - } - } - targetProjectPath = ":android" -} - -baselineProfile { - useConnectedDevices = true - enableEmulatorDisplay = false -} - -dependencies { - implementation(libs.androidx.benchmark.macro.junit4) - implementation(libs.androidx.profileinstaller) - implementation(libs.androidx.test.core) - implementation(libs.androidx.test.espresso.core) - implementation(libs.androidx.test.ext.junit) - implementation(libs.androidx.test.rules) - implementation(libs.androidx.test.runner) - implementation(libs.androidx.test.uiautomator) -} diff --git a/benchmark/src/main/AndroidManifest.xml b/benchmark/src/main/AndroidManifest.xml deleted file mode 100644 index ad7b85d3..00000000 --- a/benchmark/src/main/AndroidManifest.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileBenchmark.kt b/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileBenchmark.kt deleted file mode 100644 index 0de18c41..00000000 --- a/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileBenchmark.kt +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright © Harsh Shandilya. - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - */ -package dev.msfjarvis.claw.benchmark - -import androidx.benchmark.macro.BaselineProfileMode -import androidx.benchmark.macro.CompilationMode -import androidx.benchmark.macro.FrameTimingMetric -import androidx.benchmark.macro.StartupMode -import androidx.benchmark.macro.StartupTimingMetric -import androidx.benchmark.macro.junit4.MacrobenchmarkRule -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.uiautomator.UiDevice -import org.junit.Before -import org.junit.Rule -import org.junit.Test - -class BaselineProfileBenchmark { - @get:Rule val benchmarkRule = MacrobenchmarkRule() - private lateinit var device: UiDevice - - @Before - fun setUp() { - val instrumentation = InstrumentationRegistry.getInstrumentation() - device = UiDevice.getInstance(instrumentation) - } - - @Test - fun noCompilation() { - exploreUI(CompilationMode.None()) - } - - @Test - fun fullyCompiled() { - exploreUI(CompilationMode.Full()) - } - - @Test - fun baselineProfile() { - exploreUI(CompilationMode.Partial(baselineProfileMode = BaselineProfileMode.Require)) - } - - private fun exploreUI(compilationMode: CompilationMode) { - benchmarkRule.measureRepeated( - packageName = PACKAGE_NAME, - metrics = listOf(FrameTimingMetric(), StartupTimingMetric()), - compilationMode = compilationMode, - startupMode = StartupMode.COLD, - iterations = 10, - ) { - device.executeShellCommand("pm clear $PACKAGE_NAME") - - startActivityAndWait() - - device.waitForIdle() - - device.savePosts() - - device.exploreScreens() - - device.returnToHottestScreen() - } - } -} diff --git a/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileGenerator.kt b/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileGenerator.kt deleted file mode 100644 index f0eb81f6..00000000 --- a/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileGenerator.kt +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright © Harsh Shandilya. - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - */ -package dev.msfjarvis.claw.benchmark - -import androidx.benchmark.macro.junit4.BaselineProfileRule -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.uiautomator.UiDevice -import org.junit.Before -import org.junit.Rule -import org.junit.Test - -class BaselineProfileGenerator { - @get:Rule val baselineProfileRule = BaselineProfileRule() - private lateinit var device: UiDevice - - @Before - fun setUp() { - val instrumentation = InstrumentationRegistry.getInstrumentation() - device = UiDevice.getInstance(instrumentation) - } - - @Test - fun generateBaselineProfile() = - baselineProfileRule.collect( - packageName = PACKAGE_NAME, - maxIterations = 8, - includeInStartupProfile = true, - ) { - device.executeShellCommand("pm clear $PACKAGE_NAME") - - startActivityAndWait() - - device.waitForIdle() - - device.savePosts() - - device.exploreScreens() - - device.returnToHottestScreen() - } -} diff --git a/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BenchmarkUtils.kt b/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BenchmarkUtils.kt deleted file mode 100644 index 4f4ce0c9..00000000 --- a/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BenchmarkUtils.kt +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright © Harsh Shandilya. - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - */ -package dev.msfjarvis.claw.benchmark - -import androidx.test.uiautomator.By -import androidx.test.uiautomator.BySelector -import androidx.test.uiautomator.UiDevice -import androidx.test.uiautomator.UiObject2 -import androidx.test.uiautomator.Until - -const val PACKAGE_NAME = "dev.msfjarvis.claw.android" -private const val AWAIT_TIMEOUT = 10_000L -private const val SAVE_BUTTON_ID = "save_button" -private const val NAV_ID_HOTTEST = "HOTTEST" -private const val NAV_ID_NEWEST = "NEWEST" -private const val NAV_ID_SAVED = "SAVED" - -fun UiDevice.savePosts() { - waitForObject(By.res(SAVE_BUTTON_ID)).click() -} - -fun UiDevice.exploreScreens() { - listOf(NAV_ID_HOTTEST, NAV_ID_NEWEST, NAV_ID_SAVED).forEach { tag -> - waitForObject(By.res(tag)).click() - waitForIdle() - } -} - -fun UiDevice.returnToHottestScreen() { - waitForObject(By.res(NAV_ID_HOTTEST)).click() -} - -private fun UiDevice.waitForObject(selector: BySelector, timeout: Long = AWAIT_TIMEOUT): UiObject2 { - if (wait(Until.hasObject(selector), timeout)) { - return findObject(selector) - } - - error("Object with selector [$selector] not found") -} diff --git a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/KotlinCommonPlugin.kt b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/KotlinCommonPlugin.kt index 43f8fa0c..c6f5c069 100644 --- a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/KotlinCommonPlugin.kt +++ b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/KotlinCommonPlugin.kt @@ -23,7 +23,7 @@ class KotlinCommonPlugin : Plugin { override fun apply(project: Project) { if (project.isolated.rootProject == project.isolated) { LintConfig.configureRootProject(project) - } else if (project.name != "benchmark") { + } else { LintConfig.configureSubProject(project) } project.tasks.run { diff --git a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/SentryPlugin.kt b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/SentryPlugin.kt index ce8c4d3a..9445a624 100644 --- a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/SentryPlugin.kt +++ b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/SentryPlugin.kt @@ -46,7 +46,6 @@ class SentryPlugin : Plugin { autoUploadNativeSymbols.set(false) includeNativeSources.set(false) ignoredVariants.set(emptySet()) - ignoredBuildTypes.set(setOf("benchmark")) ignoredFlavors.set(emptySet()) tracingInstrumentation { enabled.set(true) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3895c404..2fe39abd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,6 @@ aboutLibraries = "12.2.1" agp = "8.12.0-alpha03" android-junit5 = "1.12.2.0" androidx-test = "1.7.0-alpha03" -benchmark = "1.4.0-beta02" coil3 = "3.2.0" coroutines = "1.10.2" dagger = "2.56.2" @@ -32,7 +31,6 @@ workmanager = "2.10.1" aboutLibraries-m3 = { module = "com.mikepenz:aboutlibraries-compose-m3", version.ref = "aboutLibraries" } android-security-lints = "com.android.security.lint:lint:1.0.3" androidx-activity-compose = "androidx.activity:activity-compose:1.11.0-rc01" -androidx-benchmark-macro-junit4 = { module = "androidx.benchmark:benchmark-macro-junit4", version.ref = "benchmark" } androidx-browser = "androidx.browser:browser:1.9.0-alpha04" androidx-compose-animation = { module = "androidx.compose.animation:animation" } androidx-compose-bom = "androidx.compose:compose-bom-alpha:2025.06.00" @@ -60,11 +58,6 @@ androidx-navigation3-runtime = { module = "androidx.navigation3:navigation3-runt androidx-navigation3-ui = { module = "androidx.navigation3:navigation3-ui", version.ref = "navigation3" } androidx-paging-compose = "androidx.paging:paging-compose:3.3.6" androidx-profileinstaller = "androidx.profileinstaller:profileinstaller:1.4.1" -androidx-test-core = { module = "androidx.test:core", version.ref = "androidx-test" } -androidx-test-espresso-core = "androidx.test.espresso:espresso-core:3.7.0-alpha03" -androidx-test-ext-junit = "androidx.test.ext:junit:1.3.0-alpha03" -androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidx-test" } -androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidx-test" } androidx-test-uiautomator = "androidx.test.uiautomator:uiautomator:2.4.0-alpha04" androidx-work-runtime = { module = "androidx.work:work-runtime", version.ref = "workmanager" } build-agp = { module = "com.android.tools.build:gradle", version.ref = "agp" } @@ -129,7 +122,6 @@ android-junit5 = { id = "de.mannodermaus.android-junit5", version.ref = "android android-lint = { id = "com.android.lint", version.ref = "agp" } android-test = { id = "com.android.test", version.ref = "agp" } anvil = "com.squareup.anvil:2.5.1" -baselineprofile = { id = "androidx.baselineprofile", version.ref = "benchmark" } dependencyAnalysis = "com.autonomousapps.dependency-analysis:2.18.0" invert = "com.squareup.invert:0.0.3-dev" kotlin-composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } diff --git a/settings.gradle.kts b/settings.gradle.kts index e242362d..98012d42 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -127,14 +127,4 @@ rootProject.name = "Claw" enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") -include( - "android", - "api", - "benchmark", - "common", - "core", - "database:core", - "database:impl", - "model", - "web", -) +include("android", "api", "common", "core", "database:core", "database:impl", "model", "web")