Skip to content

Commit 1da560f

Browse files
Revert "Configure baseline profiles in the baselineProfile lambda" (#1398)
This reverts commit 7980c1d.
1 parent 7980c1d commit 1da560f

File tree

8 files changed

+12
-33
lines changed

8 files changed

+12
-33
lines changed

app-nia-catalog/dependencies/releaseRuntimeClasspath.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0
6868
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.7.0
6969
androidx.lifecycle:lifecycle-viewmodel:2.7.0
7070
androidx.loader:loader:1.0.0
71-
androidx.metrics:metrics-performance:1.0.0-beta01
71+
androidx.metrics:metrics-performance:1.0.0-alpha04
7272
androidx.profileinstaller:profileinstaller:1.3.1
7373
androidx.savedstate:savedstate-ktx:1.2.1
7474
androidx.savedstate:savedstate:1.2.1

app/build.gradle.kts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ android {
5252
// To publish on the Play store a private signing key is required, but to allow anyone
5353
// who clones the code to sign and run the release variant, use the debug signing key.
5454
// TODO: Abstract the signing configuration to a separate file to avoid hardcoding this.
55-
signingConfig = signingConfigs.getByName("debug")
55+
signingConfig = signingConfigs.named("debug").get()
56+
// Ensure Baseline Profile is fresh for release builds.
57+
baselineProfile.automaticGenerationDuringBuild = true
5658
}
5759
}
5860

@@ -69,20 +71,6 @@ android {
6971
namespace = "com.google.samples.apps.nowinandroid"
7072
}
7173

72-
baselineProfile {
73-
saveInSrc = false
74-
// Don't build on every iteration of a full assemble.
75-
// Instead enable generation directly for the release build variant.
76-
automaticGenerationDuringBuild = false
77-
mergeIntoMain = true
78-
variants {
79-
create("release") {
80-
// Ensure Baseline Profile is fresh for release builds.
81-
automaticGenerationDuringBuild = true
82-
}
83-
}
84-
}
85-
8674
dependencies {
8775
implementation(projects.feature.interests)
8876
implementation(projects.feature.foryou)

app/dependencies/prodReleaseRuntimeClasspath.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.0-alpha04
102102
androidx.lifecycle:lifecycle-viewmodel:2.8.0-alpha04
103103
androidx.loader:loader:1.0.0
104104
androidx.localbroadcastmanager:localbroadcastmanager:1.0.0
105-
androidx.metrics:metrics-performance:1.0.0-beta01
105+
androidx.metrics:metrics-performance:1.0.0-alpha04
106106
androidx.navigation:navigation-common-ktx:2.7.4
107107
androidx.navigation:navigation-common:2.7.4
108108
androidx.navigation:navigation-compose:2.7.4
-1.66 KB
Loading

benchmarks/build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import com.android.build.api.dsl.ManagedVirtualDevice
1716
import com.google.samples.apps.nowinandroid.configureFlavors
1817

1918
plugins {
@@ -47,7 +46,7 @@ android {
4746
}
4847

4948
testOptions.managedDevices.devices {
50-
create<ManagedVirtualDevice>("pixel6Api33") {
49+
create<com.android.build.api.dsl.ManagedVirtualDevice>("pixel6Api33") {
5150
device = "Pixel 6"
5251
apiLevel = 33
5352
systemImageSource = "aosp"

benchmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/foryou/ForYouActions.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ fun MacrobenchmarkScope.forYouWaitForContent() {
4141
*/
4242
fun MacrobenchmarkScope.forYouSelectTopics(recheckTopicsIfChecked: Boolean = false) {
4343
val topics = device.findObject(By.res("forYou:topicSelection"))
44-
val noChildren = topics.childCount == 0
45-
if (noChildren) {
46-
// TODO: Ensure ForYou has topics.
47-
fail("No topics found, can't scroll for baseline profile generation.")
48-
}
4944

5045
// Set gesture margin from sides not to trigger system gesture navigation
5146
val horizontalMargin = 10 * topics.visibleBounds.width() / 100
@@ -56,6 +51,9 @@ fun MacrobenchmarkScope.forYouSelectTopics(recheckTopicsIfChecked: Boolean = fal
5651
var visited = 0
5752

5853
while (visited < 3) {
54+
if (topics.childCount == 0) {
55+
fail("No topics found, can't generate profile for ForYou page.")
56+
}
5957
// Selecting some topics, which will populate items in the feed.
6058
val topic = topics.children[index % topics.childCount]
6159
// Find the checkable element to figure out whether it's checked or not

benchmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/interests/InterestsActions.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import androidx.test.uiautomator.By
2121
import androidx.test.uiautomator.Until
2222
import com.google.samples.apps.nowinandroid.flingElementDownUp
2323
import com.google.samples.apps.nowinandroid.waitForObjectOnTopAppBar
24-
import org.junit.Assert.fail
2524

2625
fun MacrobenchmarkScope.goToInterestsScreen() {
2726
device.findObject(By.text("Interests")).click()
@@ -36,12 +35,7 @@ fun MacrobenchmarkScope.goToInterestsScreen() {
3635
fun MacrobenchmarkScope.interestsScrollTopicsDownUp() {
3736
device.wait(Until.hasObject(By.res("interests:topics")), 5_000)
3837
val topicsList = device.findObject(By.res("interests:topics"))
39-
if (topicsList != null) {
40-
// TODO: Ensure topics are availble.
41-
device.flingElementDownUp(topicsList)
42-
} else {
43-
fail("No topics found, can't scroll during baseline profile generation.")
44-
}
38+
device.flingElementDownUp(topicsList)
4539
}
4640

4741
fun MacrobenchmarkScope.interestsWaitForTopics() {

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ androidxDataStore = "1.0.0"
1818
androidxEspresso = "3.5.1"
1919
androidxHiltNavigationCompose = "1.2.0"
2020
androidxLifecycle = "2.7.0"
21-
androidxMacroBenchmark = "1.2.4"
22-
androidxMetrics = "1.0.0-beta01"
21+
androidxMacroBenchmark = "1.2.2"
22+
androidxMetrics = "1.0.0-alpha04"
2323
androidxNavigation = "2.7.4"
2424
androidxProfileinstaller = "1.3.1"
2525
androidxTestCore = "1.5.0"

0 commit comments

Comments
 (0)