Skip to content

Commit f64f1c0

Browse files
Remove legacy benchmark build type (#1207)
* Remove legacy benchmark build type Now that we have the baseline profile gradle plugin, there is no need for a benchmark build type. The plugin does the setup and configuration and runs against the correct app flavor. * Remove explicit benchmark build type from benchmark module * Remove stale build task exclusions * Fix tracing import location FYI @mlykotom
1 parent b85d149 commit f64f1c0

File tree

8 files changed

+5
-39
lines changed

8 files changed

+5
-39
lines changed

.github/workflows/Build.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,9 @@ jobs:
109109
- name: Build all build type and flavor permutations
110110
run: ./gradlew :app:assemble :benchmarks:assemble
111111
-x pixel6Api33ProdNonMinifiedReleaseAndroidTest
112-
-x pixel6Api33ProdNonMinifiedBenchmarkAndroidTest
113112
-x pixel6Api33DemoNonMinifiedReleaseAndroidTest
114-
-x pixel6Api33DemoNonMinifiedBenchmarkAndroidTest
115113
-x collectDemoNonMinifiedReleaseBaselineProfile
116-
-x collectDemoNonMinifiedBenchmarkBaselineProfile
117114
-x collectProdNonMinifiedReleaseBaselineProfile
118-
-x collectProdNonMinifiedBenchmarkBaselineProfile
119115

120116
- name: Upload build outputs (APKs)
121117
uses: actions/upload-artifact@v4

app-nia-catalog/dependencies/releaseRuntimeClasspath.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ androidx.profileinstaller:profileinstaller:1.3.1
7070
androidx.savedstate:savedstate-ktx:1.2.1
7171
androidx.savedstate:savedstate:1.2.1
7272
androidx.startup:startup-runtime:1.1.1
73-
androidx.tracing:tracing:1.0.0
73+
androidx.tracing:tracing-ktx:1.3.0-alpha02
74+
androidx.tracing:tracing:1.3.0-alpha02
7475
androidx.vectordrawable:vectordrawable-animated:1.1.0
7576
androidx.vectordrawable:vectordrawable:1.1.0
7677
androidx.versionedparcelable:versionedparcelable:1.1.1

app/build.gradle.kts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,6 @@ android {
5757
// Ensure Baseline Profile is fresh for release builds.
5858
baselineProfile.automaticGenerationDuringBuild = true
5959
}
60-
create("benchmark") {
61-
// Enable all the optimizations from release build through initWith(release).
62-
initWith(release)
63-
matchingFallbacks.add("release")
64-
// Debug key signing is available to everyone.
65-
signingConfig = signingConfigs.getByName("debug")
66-
// Only use benchmark proguard rules
67-
proguardFiles("benchmark-rules.pro")
68-
isMinifyEnabled = true
69-
applicationIdSuffix = NiaBuildType.BENCHMARK.applicationIdSuffix
70-
}
7160
}
7261

7362
packaging {

app/dependencies/prodReleaseRuntimeClasspath.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ androidx.savedstate:savedstate:1.2.1
105105
androidx.sqlite:sqlite-framework:2.4.0
106106
androidx.sqlite:sqlite:2.4.0
107107
androidx.startup:startup-runtime:1.1.1
108-
androidx.tracing:tracing-ktx:1.1.0
109-
androidx.tracing:tracing:1.1.0
108+
androidx.tracing:tracing-ktx:1.3.0-alpha02
109+
androidx.tracing:tracing:1.3.0-alpha02
110110
androidx.vectordrawable:vectordrawable-animated:1.1.0
111111
androidx.vectordrawable:vectordrawable:1.1.0
112112
androidx.versionedparcelable:versionedparcelable:1.1.1

benchmarks/build.gradle.kts

Lines changed: 0 additions & 18 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.google.samples.apps.nowinandroid.NiaBuildType
1716
import com.google.samples.apps.nowinandroid.configureFlavors
1817

1918
plugins {
@@ -35,23 +34,6 @@ android {
3534
buildConfig = true
3635
}
3736

38-
buildTypes {
39-
// This benchmark buildType is used for benchmarking, and should function like your
40-
// release build (for example, with minification on). It's signed with a debug key
41-
// for easy local/CI testing.
42-
create("benchmark") {
43-
// Keep the build type debuggable so we can attach a debugger if needed.
44-
isDebuggable = true
45-
signingConfig = signingConfigs.getByName("debug")
46-
matchingFallbacks.add("release")
47-
buildConfigField(
48-
"String",
49-
"APP_BUILD_TYPE_SUFFIX",
50-
"\"${NiaBuildType.BENCHMARK.applicationIdSuffix ?: ""}\""
51-
)
52-
}
53-
}
54-
5537
// Use the same flavor dimensions as the application to allow generating Baseline Profiles on prod,
5638
// which is more close to what will be shipped to users (no fake data), but has ability to run the
5739
// benchmarks on demo, so we benchmark on stable data.

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import java.io.ByteArrayOutputStream
3030
val PACKAGE_NAME = buildString {
3131
append("com.google.samples.apps.nowinandroid")
3232
append(BuildConfig.APP_FLAVOR_SUFFIX)
33-
append(BuildConfig.APP_BUILD_TYPE_SUFFIX)
3433
}
3534

3635
fun UiDevice.flingElementDownUp(element: UiObject2) {

build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/NiaBuildType.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,4 @@ package com.google.samples.apps.nowinandroid
2222
enum class NiaBuildType(val applicationIdSuffix: String? = null) {
2323
DEBUG(".debug"),
2424
RELEASE,
25-
BENCHMARK(".benchmark")
2625
}

feature/foryou/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ import androidx.compose.ui.tooling.preview.PreviewParameter
8181
import androidx.compose.ui.unit.dp
8282
import androidx.compose.ui.unit.max
8383
import androidx.compose.ui.unit.sp
84-
import androidx.tracing.trace
8584
import androidx.hilt.navigation.compose.hiltViewModel
8685
import androidx.lifecycle.compose.collectAsStateWithLifecycle
86+
import androidx.tracing.trace
8787
import com.google.accompanist.permissions.ExperimentalPermissionsApi
8888
import com.google.accompanist.permissions.PermissionStatus.Denied
8989
import com.google.accompanist.permissions.rememberPermissionState

0 commit comments

Comments
 (0)