diff --git a/MacrobenchmarkSample/app/build.gradle.kts b/MacrobenchmarkSample/app/build.gradle.kts index 4176426a..9b8610b5 100644 --- a/MacrobenchmarkSample/app/build.gradle.kts +++ b/MacrobenchmarkSample/app/build.gradle.kts @@ -103,5 +103,5 @@ dependencies { implementation(libs.viewmodel) androidTestImplementation(libs.benchmark.junit) - baselineProfile(project(":baselineProfile")) + baselineProfile(project(":macrobenchmark")) } diff --git a/MacrobenchmarkSample/baseBenchmarks/.gitignore b/MacrobenchmarkSample/baseBenchmarks/.gitignore deleted file mode 100644 index 42afabfd..00000000 --- a/MacrobenchmarkSample/baseBenchmarks/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/MacrobenchmarkSample/baseBenchmarks/build.gradle.kts b/MacrobenchmarkSample/baseBenchmarks/build.gradle.kts deleted file mode 100644 index 9cc6bdf4..00000000 --- a/MacrobenchmarkSample/baseBenchmarks/build.gradle.kts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -plugins { - id("com.android.library") - id("kotlin-android") -} - -android { - namespace = "com.example.benchmark.macro.base" - compileSdk = 34 - - defaultConfig { - minSdk = 23 - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles("consumer-rules.pro") - } - - buildTypes { - release { - isMinifyEnabled = false - proguardFiles( - getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" - ) - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() - } -} - -dependencies { - - implementation(libs.androidx.junit) - implementation(libs.benchmark.junit) - implementation(libs.espresso) - implementation(libs.ui.automator) -} diff --git a/MacrobenchmarkSample/baseBenchmarks/consumer-rules.pro b/MacrobenchmarkSample/baseBenchmarks/consumer-rules.pro deleted file mode 100644 index e69de29b..00000000 diff --git a/MacrobenchmarkSample/baseBenchmarks/src/main/AndroidManifest.xml b/MacrobenchmarkSample/baseBenchmarks/src/main/AndroidManifest.xml deleted file mode 100644 index c4c8f418..00000000 --- a/MacrobenchmarkSample/baseBenchmarks/src/main/AndroidManifest.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/MacrobenchmarkSample/baselineProfile/build.gradle.kts b/MacrobenchmarkSample/baselineProfile/build.gradle.kts deleted file mode 100644 index 1a8faee9..00000000 --- a/MacrobenchmarkSample/baselineProfile/build.gradle.kts +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2023 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -plugins { - alias(libs.plugins.kotlin) - alias(libs.plugins.test) - alias(libs.plugins.baselineprofile) - -} - -android { - namespace = "com.example.benchmark.baselinprofile" - compileSdk = 34 - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() - } - - defaultConfig { - // Minimum supported version for Baseline Profiles. - // On lower APIs, apps are fully AOT compile, therefore Baseline Profiles aren't needed. - minSdk = 24 - targetSdk = 34 - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - } - - testOptions.managedDevices.devices { - create("pixel6Api31") { - device = "Pixel 6" - apiLevel = 31 - systemImageSource = "aosp" - } - } - - targetProjectPath = ":app" -} - -baselineProfile { - - // This specifies the managed devices to use that you run the tests on. The default - // is none. - managedDevices += "pixel6Api31" - - // This enables using connected devices to generate profiles. The default is true. - // When using connected devices, they must be rooted or API 33 and higher. - useConnectedDevices = false -} - -dependencies { - implementation(project(":baseBenchmarks")) - implementation(libs.benchmark.junit) - implementation(libs.androidx.junit) - implementation(libs.espresso) - implementation(libs.ui.automator) -} - diff --git a/MacrobenchmarkSample/baselineProfile/src/main/AndroidManifest.xml b/MacrobenchmarkSample/baselineProfile/src/main/AndroidManifest.xml deleted file mode 100644 index 15cc229e..00000000 --- a/MacrobenchmarkSample/baselineProfile/src/main/AndroidManifest.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/MacrobenchmarkSample/macrobenchmark/build.gradle.kts b/MacrobenchmarkSample/macrobenchmark/build.gradle.kts index 2ead2251..ea7ece26 100644 --- a/MacrobenchmarkSample/macrobenchmark/build.gradle.kts +++ b/MacrobenchmarkSample/macrobenchmark/build.gradle.kts @@ -1,8 +1,27 @@ +/* + * Copyright 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import com.android.build.api.dsl.ManagedVirtualDevice plugins { + //id("com.android.library") + id("kotlin-android") alias(libs.plugins.test) alias(libs.plugins.kotlin) + alias(libs.plugins.baselineprofile) } // [START macrobenchmark_setup_android] @@ -12,7 +31,9 @@ android { namespace = "com.example.macrobenchmark" defaultConfig { - minSdk = 23 // Minimum supported version for macrobenchmark + // Minimum supported version for Baseline Profiles. + // On lower APIs, apps are fully AOT compile, therefore Baseline Profiles aren't needed. + minSdk = 24 targetSdk = 34 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } @@ -20,11 +41,12 @@ android { targetProjectPath = ":app" compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } + kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() + jvmTarget = JavaVersion.VERSION_17.toString() } testOptions.managedDevices.devices { @@ -54,8 +76,18 @@ android { } // [END macrobenchmark_setup_android] +baselineProfile { + + // This specifies the managed devices to use that you run the tests on. The default + // is none. + managedDevices += "pixel6Api31" + + // This enables using connected devices to generate profiles. The default is true. + // When using connected devices, they must be rooted or API 33 and higher. + useConnectedDevices = false +} + dependencies { - implementation(project(":baseBenchmarks")) implementation(libs.benchmark.junit) implementation(libs.androidx.junit) implementation(libs.espresso) diff --git a/MacrobenchmarkSample/macrobenchmark/src/main/AndroidManifest.xml b/MacrobenchmarkSample/macrobenchmark/src/main/AndroidManifest.xml index 3c047cd7..768f6339 100644 --- a/MacrobenchmarkSample/macrobenchmark/src/main/AndroidManifest.xml +++ b/MacrobenchmarkSample/macrobenchmark/src/main/AndroidManifest.xml @@ -1,5 +1,6 @@ - - - - + + + + \ No newline at end of file diff --git a/MacrobenchmarkSample/baselineProfile/src/main/java/com/example/macrobenchmark/baselineprofile/BaselineProfileGeneratorScaffold.kt b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/baselineprofile/BaselineProfileGeneratorScaffold.kt similarity index 100% rename from MacrobenchmarkSample/baselineProfile/src/main/java/com/example/macrobenchmark/baselineprofile/BaselineProfileGeneratorScaffold.kt rename to MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/baselineprofile/BaselineProfileGeneratorScaffold.kt diff --git a/MacrobenchmarkSample/baselineProfile/src/main/java/com/example/macrobenchmark/baselineprofile/Common.kt b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/baselineprofile/Common.kt similarity index 100% rename from MacrobenchmarkSample/baselineProfile/src/main/java/com/example/macrobenchmark/baselineprofile/Common.kt rename to MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/baselineprofile/Common.kt diff --git a/MacrobenchmarkSample/baselineProfile/src/main/java/com/example/macrobenchmark/baselineprofile/ComposeActivityBaselineProfileGenerator.kt b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/baselineprofile/ComposeActivityBaselineProfileGenerator.kt similarity index 92% rename from MacrobenchmarkSample/baselineProfile/src/main/java/com/example/macrobenchmark/baselineprofile/ComposeActivityBaselineProfileGenerator.kt rename to MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/baselineprofile/ComposeActivityBaselineProfileGenerator.kt index fe3dcb3d..c6f2d3aa 100644 --- a/MacrobenchmarkSample/baselineProfile/src/main/java/com/example/macrobenchmark/baselineprofile/ComposeActivityBaselineProfileGenerator.kt +++ b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/baselineprofile/ComposeActivityBaselineProfileGenerator.kt @@ -21,8 +21,8 @@ import androidx.benchmark.macro.MacrobenchmarkScope import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.uiautomator.By import androidx.test.uiautomator.Direction -import com.example.benchmark.macro.base.util.findOrFail -import com.example.benchmark.macro.base.util.waitAndFind +import com.example.macrobenchmark.benchmark.util.findOrFail +import com.example.macrobenchmark.benchmark.util.waitAndFind import org.junit.Ignore import org.junit.runner.RunWith diff --git a/MacrobenchmarkSample/baselineProfile/src/main/java/com/example/macrobenchmark/baselineprofile/LoginBaselineProfileGenerator.kt b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/baselineprofile/LoginBaselineProfileGenerator.kt similarity index 100% rename from MacrobenchmarkSample/baselineProfile/src/main/java/com/example/macrobenchmark/baselineprofile/LoginBaselineProfileGenerator.kt rename to MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/baselineprofile/LoginBaselineProfileGenerator.kt diff --git a/MacrobenchmarkSample/baselineProfile/src/main/java/com/example/macrobenchmark/baselineprofile/RecyclerViewActivityBaselineProfileGenerator.kt b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/baselineprofile/RecyclerViewActivityBaselineProfileGenerator.kt similarity index 100% rename from MacrobenchmarkSample/baselineProfile/src/main/java/com/example/macrobenchmark/baselineprofile/RecyclerViewActivityBaselineProfileGenerator.kt rename to MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/baselineprofile/RecyclerViewActivityBaselineProfileGenerator.kt diff --git a/MacrobenchmarkSample/baselineProfile/src/main/java/com/example/macrobenchmark/baselineprofile/StartupOnlyBaselineProfileGenerator.kt b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/baselineprofile/StartupOnlyBaselineProfileGenerator.kt similarity index 100% rename from MacrobenchmarkSample/baselineProfile/src/main/java/com/example/macrobenchmark/baselineprofile/StartupOnlyBaselineProfileGenerator.kt rename to MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/baselineprofile/StartupOnlyBaselineProfileGenerator.kt diff --git a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/LoginBenchmark.kt b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/LoginBenchmark.kt similarity index 92% rename from MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/LoginBenchmark.kt rename to MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/LoginBenchmark.kt index f20917e5..e94c0af7 100644 --- a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/LoginBenchmark.kt +++ b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/LoginBenchmark.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.example.macrobenchmark +package com.example.macrobenchmark.benchmark import android.content.Intent import android.os.Bundle @@ -26,9 +26,9 @@ import androidx.benchmark.macro.StartupTimingMetric import androidx.benchmark.macro.junit4.MacrobenchmarkRule import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.uiautomator.By -import com.example.benchmark.macro.base.util.DEFAULT_ITERATIONS -import com.example.benchmark.macro.base.util.TARGET_PACKAGE -import com.example.macrobenchmark.permissions.allowNotifications +import com.example.macrobenchmark.benchmark.util.DEFAULT_ITERATIONS +import com.example.macrobenchmark.benchmark.util.TARGET_PACKAGE +import com.example.macrobenchmark.benchmark.permissions.allowNotifications import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith diff --git a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/clickslatency/ClickLatencyBenchmark.kt b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/clickslatency/ClickLatencyBenchmark.kt similarity index 97% rename from MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/clickslatency/ClickLatencyBenchmark.kt rename to MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/clickslatency/ClickLatencyBenchmark.kt index e44073c8..30b55ec6 100644 --- a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/clickslatency/ClickLatencyBenchmark.kt +++ b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/clickslatency/ClickLatencyBenchmark.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.example.macrobenchmark.clickslatency; +package com.example.macrobenchmark.benchmark.clickslatency; import android.content.Intent import androidx.benchmark.macro.CompilationMode @@ -26,8 +26,8 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.LargeTest import androidx.test.uiautomator.By import androidx.test.uiautomator.Until -import com.example.benchmark.macro.base.util.DEFAULT_ITERATIONS -import com.example.benchmark.macro.base.util.TARGET_PACKAGE +import com.example.macrobenchmark.benchmark.util.DEFAULT_ITERATIONS +import com.example.macrobenchmark.benchmark.util.TARGET_PACKAGE import junit.framework.TestCase.fail import org.junit.Rule import org.junit.Test diff --git a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/frames/FrameTimingBenchmark.kt b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/frames/FrameTimingBenchmark.kt similarity index 95% rename from MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/frames/FrameTimingBenchmark.kt rename to MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/frames/FrameTimingBenchmark.kt index ba928b49..4f032aae 100644 --- a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/frames/FrameTimingBenchmark.kt +++ b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/frames/FrameTimingBenchmark.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.example.macrobenchmark.frames +package com.example.macrobenchmark.benchmark.frames import android.content.Intent import androidx.benchmark.macro.CompilationMode @@ -25,8 +25,8 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.LargeTest import androidx.test.uiautomator.By import androidx.test.uiautomator.Direction -import com.example.benchmark.macro.base.util.DEFAULT_ITERATIONS -import com.example.benchmark.macro.base.util.TARGET_PACKAGE +import com.example.macrobenchmark.benchmark.util.DEFAULT_ITERATIONS +import com.example.macrobenchmark.benchmark.util.TARGET_PACKAGE import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith diff --git a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/frames/NestedRecyclerFrameTimingBenchmarks.kt b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/frames/NestedRecyclerFrameTimingBenchmarks.kt similarity index 93% rename from MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/frames/NestedRecyclerFrameTimingBenchmarks.kt rename to MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/frames/NestedRecyclerFrameTimingBenchmarks.kt index 5c8e3c7c..e8cb0ea0 100644 --- a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/frames/NestedRecyclerFrameTimingBenchmarks.kt +++ b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/frames/NestedRecyclerFrameTimingBenchmarks.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.example.macrobenchmark.frames +package com.example.macrobenchmark.benchmark.frames import androidx.benchmark.macro.* import androidx.benchmark.macro.junit4.MacrobenchmarkRule @@ -23,9 +23,9 @@ import androidx.test.filters.LargeTest import androidx.test.uiautomator.By import androidx.test.uiautomator.Direction import androidx.test.uiautomator.Until -import com.example.benchmark.macro.base.util.DEFAULT_ITERATIONS -import com.example.benchmark.macro.base.util.TARGET_PACKAGE -import com.example.benchmark.macro.base.util.waitAndFind +import com.example.macrobenchmark.benchmark.util.DEFAULT_ITERATIONS +import com.example.macrobenchmark.benchmark.util.TARGET_PACKAGE +import com.example.macrobenchmark.benchmark.util.waitAndFind import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith diff --git a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/frames/NonExportedActivityBenchmark.kt b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/frames/NonExportedActivityBenchmark.kt similarity index 94% rename from MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/frames/NonExportedActivityBenchmark.kt rename to MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/frames/NonExportedActivityBenchmark.kt index 4c714e30..ccb1855a 100644 --- a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/frames/NonExportedActivityBenchmark.kt +++ b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/frames/NonExportedActivityBenchmark.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.example.macrobenchmark.frames +package com.example.macrobenchmark.benchmark.frames import androidx.benchmark.macro.CompilationMode import androidx.benchmark.macro.FrameTimingMetric @@ -26,8 +26,8 @@ import androidx.test.filters.LargeTest import androidx.test.uiautomator.By import androidx.test.uiautomator.Direction import androidx.test.uiautomator.Until -import com.example.benchmark.macro.base.util.DEFAULT_ITERATIONS -import com.example.benchmark.macro.base.util.TARGET_PACKAGE +import com.example.macrobenchmark.benchmark.util.DEFAULT_ITERATIONS +import com.example.macrobenchmark.benchmark.util.TARGET_PACKAGE import junit.framework.TestCase.fail import org.junit.Rule import org.junit.Test diff --git a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/frames/TextInputFrameTimingBenchmark.kt b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/frames/TextInputFrameTimingBenchmark.kt similarity index 91% rename from MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/frames/TextInputFrameTimingBenchmark.kt rename to MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/frames/TextInputFrameTimingBenchmark.kt index 5961bf7c..b4d3b467 100644 --- a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/frames/TextInputFrameTimingBenchmark.kt +++ b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/frames/TextInputFrameTimingBenchmark.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.example.macrobenchmark.frames +package com.example.macrobenchmark.benchmark.frames import android.content.Intent import androidx.benchmark.macro.CompilationMode @@ -24,8 +24,8 @@ import androidx.benchmark.macro.junit4.MacrobenchmarkRule import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.LargeTest import androidx.test.uiautomator.By -import com.example.benchmark.macro.base.util.DEFAULT_ITERATIONS -import com.example.benchmark.macro.base.util.TARGET_PACKAGE +import com.example.macrobenchmark.benchmark.util.DEFAULT_ITERATIONS +import com.example.macrobenchmark.benchmark.util.TARGET_PACKAGE import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith diff --git a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/permissions/Permissions.kt b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/permissions/Permissions.kt similarity index 96% rename from MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/permissions/Permissions.kt rename to MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/permissions/Permissions.kt index 067451ab..7a374c43 100644 --- a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/permissions/Permissions.kt +++ b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/permissions/Permissions.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.example.macrobenchmark.permissions +package com.example.macrobenchmark.benchmark.permissions import android.Manifest.permission import android.os.Build.VERSION.SDK_INT diff --git a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/scroll/ScrollBenchmark.kt b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/scroll/ScrollBenchmark.kt similarity index 92% rename from MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/scroll/ScrollBenchmark.kt rename to MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/scroll/ScrollBenchmark.kt index 617700b1..cd7d690b 100644 --- a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/scroll/ScrollBenchmark.kt +++ b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/scroll/ScrollBenchmark.kt @@ -14,10 +14,9 @@ * limitations under the License. */ -package com.example.macrobenchmark.scroll +package com.example.macrobenchmark.benchmark.scroll import android.content.Intent -import androidx.benchmark.macro.BaselineProfileMode import androidx.benchmark.macro.CompilationMode import androidx.benchmark.macro.ExperimentalMetricApi import androidx.benchmark.macro.FrameTimingMetric @@ -25,13 +24,12 @@ import androidx.benchmark.macro.StartupTimingMetric import androidx.benchmark.macro.TraceSectionMetric import androidx.benchmark.macro.junit4.MacrobenchmarkRule import androidx.test.ext.junit.runners.AndroidJUnit4 -import androidx.test.filters.LargeTest import androidx.test.filters.SdkSuppress import androidx.test.uiautomator.By import androidx.test.uiautomator.Direction import androidx.test.uiautomator.Until -import com.example.benchmark.macro.base.util.DEFAULT_ITERATIONS -import com.example.benchmark.macro.base.util.TARGET_PACKAGE +import com.example.macrobenchmark.benchmark.util.DEFAULT_ITERATIONS +import com.example.macrobenchmark.benchmark.util.TARGET_PACKAGE import junit.framework.TestCase import org.junit.Rule import org.junit.Test diff --git a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/startup/FullyDrawnStartupBenchmark.kt b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/startup/FullyDrawnStartupBenchmark.kt similarity index 90% rename from MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/startup/FullyDrawnStartupBenchmark.kt rename to MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/startup/FullyDrawnStartupBenchmark.kt index f3693d97..576f577a 100644 --- a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/startup/FullyDrawnStartupBenchmark.kt +++ b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/startup/FullyDrawnStartupBenchmark.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.example.macrobenchmark.startup +package com.example.macrobenchmark.benchmark.startup import android.content.Intent import androidx.benchmark.macro.StartupMode @@ -24,8 +24,8 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.LargeTest import androidx.test.uiautomator.By import androidx.test.uiautomator.Until -import com.example.benchmark.macro.base.util.DEFAULT_ITERATIONS -import com.example.benchmark.macro.base.util.TARGET_PACKAGE +import com.example.macrobenchmark.benchmark.util.DEFAULT_ITERATIONS +import com.example.macrobenchmark.benchmark.util.TARGET_PACKAGE import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith diff --git a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/startup/SampleStartupBenchmark.kt b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/startup/SampleStartupBenchmark.kt similarity index 89% rename from MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/startup/SampleStartupBenchmark.kt rename to MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/startup/SampleStartupBenchmark.kt index d3e8c4cb..2f299059 100644 --- a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/startup/SampleStartupBenchmark.kt +++ b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/startup/SampleStartupBenchmark.kt @@ -14,14 +14,14 @@ * limitations under the License. */ -package com.example.macrobenchmark.startup +package com.example.macrobenchmark.benchmark.startup import androidx.benchmark.macro.StartupTimingMetric import androidx.benchmark.macro.junit4.MacrobenchmarkRule import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.LargeTest -import com.example.benchmark.macro.base.util.DEFAULT_ITERATIONS -import com.example.benchmark.macro.base.util.TARGET_PACKAGE +import com.example.macrobenchmark.benchmark.util.DEFAULT_ITERATIONS +import com.example.macrobenchmark.benchmark.util.TARGET_PACKAGE import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith diff --git a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/startup/SmallListStartupBenchmark.kt b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/startup/SmallListStartupBenchmark.kt similarity index 93% rename from MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/startup/SmallListStartupBenchmark.kt rename to MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/startup/SmallListStartupBenchmark.kt index 366441fa..47cf897a 100644 --- a/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/startup/SmallListStartupBenchmark.kt +++ b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/startup/SmallListStartupBenchmark.kt @@ -14,15 +14,15 @@ * limitations under the License. */ -package com.example.macrobenchmark.startup +package com.example.macrobenchmark.benchmark.startup import android.content.Intent import androidx.benchmark.macro.StartupMode import androidx.benchmark.macro.StartupTimingMetric import androidx.benchmark.macro.junit4.MacrobenchmarkRule import androidx.test.filters.LargeTest -import com.example.benchmark.macro.base.util.DEFAULT_ITERATIONS -import com.example.benchmark.macro.base.util.TARGET_PACKAGE +import com.example.macrobenchmark.benchmark.util.DEFAULT_ITERATIONS +import com.example.macrobenchmark.benchmark.util.TARGET_PACKAGE import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith diff --git a/MacrobenchmarkSample/baseBenchmarks/src/main/java/com/example/benchmark/macro/base/startup/StartupBenchmark.kt b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/startup/StartupBenchmark.kt similarity index 94% rename from MacrobenchmarkSample/baseBenchmarks/src/main/java/com/example/benchmark/macro/base/startup/StartupBenchmark.kt rename to MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/startup/StartupBenchmark.kt index 0db23f1b..0da8cfb8 100644 --- a/MacrobenchmarkSample/baseBenchmarks/src/main/java/com/example/benchmark/macro/base/startup/StartupBenchmark.kt +++ b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/startup/StartupBenchmark.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.example.benchmark.macro.base.startup +package com.example.macrobenchmark.benchmark.startup import androidx.benchmark.macro.BaselineProfileMode import androidx.benchmark.macro.CompilationMode @@ -23,8 +23,8 @@ import androidx.benchmark.macro.StartupTimingMetric import androidx.benchmark.macro.junit4.MacrobenchmarkRule import androidx.test.filters.SdkSuppress import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner -import com.example.benchmark.macro.base.util.DEFAULT_ITERATIONS -import com.example.benchmark.macro.base.util.TARGET_PACKAGE +import com.example.macrobenchmark.benchmark.util.DEFAULT_ITERATIONS +import com.example.macrobenchmark.benchmark.util.TARGET_PACKAGE import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith diff --git a/MacrobenchmarkSample/baseBenchmarks/src/main/java/com/example/benchmark/macro/base/util/Utils.kt b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/util/Utils.kt similarity index 98% rename from MacrobenchmarkSample/baseBenchmarks/src/main/java/com/example/benchmark/macro/base/util/Utils.kt rename to MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/util/Utils.kt index d76937b3..dbee5033 100644 --- a/MacrobenchmarkSample/baseBenchmarks/src/main/java/com/example/benchmark/macro/base/util/Utils.kt +++ b/MacrobenchmarkSample/macrobenchmark/src/main/java/com/example/macrobenchmark/benchmark/util/Utils.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.example.benchmark.macro.base.util +package com.example.macrobenchmark.benchmark.util import android.util.Log import androidx.test.uiautomator.BySelector diff --git a/MacrobenchmarkSample/settings.gradle.kts b/MacrobenchmarkSample/settings.gradle.kts index 5843fc40..f5541302 100644 --- a/MacrobenchmarkSample/settings.gradle.kts +++ b/MacrobenchmarkSample/settings.gradle.kts @@ -16,7 +16,6 @@ rootProject.name = "macrobenchmark" include(":app") -include(":baseBenchmarks") include(":macrobenchmark") @@ -34,4 +33,3 @@ dependencyResolutionManagement { gradlePluginPortal() } } -include(":baselineProfile")