Merge pull request #814 from android/baseline-profile-api-change

Baseline Profiles API change
pull/823/head
Alex Vanyo 2 years ago committed by GitHub
commit 89c4653115
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,7 +16,6 @@
package com.google.samples.apps.nowinandroid.baselineprofile package com.google.samples.apps.nowinandroid.baselineprofile
import androidx.benchmark.macro.ExperimentalBaselineProfilesApi
import androidx.benchmark.macro.junit4.BaselineProfileRule import androidx.benchmark.macro.junit4.BaselineProfileRule
import com.google.samples.apps.nowinandroid.PACKAGE_NAME import com.google.samples.apps.nowinandroid.PACKAGE_NAME
import com.google.samples.apps.nowinandroid.bookmarks.goToBookmarksScreen import com.google.samples.apps.nowinandroid.bookmarks.goToBookmarksScreen
@ -31,13 +30,12 @@ import org.junit.Test
/** /**
* Generates a baseline profile which can be copied to `app/src/main/baseline-prof.txt`. * Generates a baseline profile which can be copied to `app/src/main/baseline-prof.txt`.
*/ */
@ExperimentalBaselineProfilesApi
class BaselineProfileGenerator { class BaselineProfileGenerator {
@get:Rule val baselineProfileRule = BaselineProfileRule() @get:Rule val baselineProfileRule = BaselineProfileRule()
@Test @Test
fun generate() = fun generate() =
baselineProfileRule.collectBaselineProfile(PACKAGE_NAME) { baselineProfileRule.collect(PACKAGE_NAME) {
// This block defines the app's critical user journey. Here we are interested in // This block defines the app's critical user journey. Here we are interested in
// optimizing for app startup. But you can also navigate and scroll // optimizing for app startup. But you can also navigate and scroll
// through your most important UI. // through your most important UI.

@ -33,7 +33,7 @@ class AndroidApplicationConventionPlugin : Plugin<Project> {
extensions.configure<ApplicationExtension> { extensions.configure<ApplicationExtension> {
configureKotlinAndroid(this) configureKotlinAndroid(this)
defaultConfig.targetSdk = 33 defaultConfig.targetSdk = 34
configureGradleManagedDevices(this) configureGradleManagedDevices(this)
} }
extensions.configure<ApplicationAndroidComponentsExtension> { extensions.configure<ApplicationAndroidComponentsExtension> {

@ -38,7 +38,7 @@ class AndroidLibraryConventionPlugin : Plugin<Project> {
extensions.configure<LibraryExtension> { extensions.configure<LibraryExtension> {
configureKotlinAndroid(this) configureKotlinAndroid(this)
defaultConfig.targetSdk = 33 defaultConfig.targetSdk = 34
configureFlavors(this) configureFlavors(this)
configureGradleManagedDevices(this) configureGradleManagedDevices(this)
} }

@ -33,7 +33,7 @@ internal fun Project.configureKotlinAndroid(
commonExtension: CommonExtension<*, *, *, *>, commonExtension: CommonExtension<*, *, *, *>,
) { ) {
commonExtension.apply { commonExtension.apply {
compileSdk = 33 compileSdk = 34
defaultConfig { defaultConfig {
minSdk = 21 minSdk = 21

@ -15,7 +15,7 @@ androidxDataStore = "1.0.0"
androidxEspresso = "3.5.0" androidxEspresso = "3.5.0"
androidxHiltNavigationCompose = "1.0.0" androidxHiltNavigationCompose = "1.0.0"
androidxLifecycle = "2.6.0-alpha05" androidxLifecycle = "2.6.0-alpha05"
androidxMacroBenchmark = "1.1.1" androidxMacroBenchmark = "1.2.0-alpha16"
androidxMetrics = "1.0.0-alpha03" androidxMetrics = "1.0.0-alpha03"
androidxNavigation = "2.5.3" androidxNavigation = "2.5.3"
androidxProfileinstaller = "1.2.1" androidxProfileinstaller = "1.2.1"

Loading…
Cancel
Save