Skip to content

feat: add Baseline Profiles support#134

Merged
Lemkinator merged 21 commits into
mainfrom
step/10-baseline-profiles
May 23, 2026
Merged

feat: add Baseline Profiles support#134
Lemkinator merged 21 commits into
mainfrom
step/10-baseline-profiles

Conversation

@Lemkinator
Copy link
Copy Markdown
Owner

@Lemkinator Lemkinator commented May 23, 2026

Summary

  • Adds :baselineprofile producer module (com.android.test) with BaselineProfileGenerator that drives app cold-start for ART ahead-of-time compilation
  • Wires androidx.baselineprofile plugin into :app with dexLayoutOptimization = true and profileinstaller runtime dep
  • Adds .github/workflows/baseline-profile.yml — weekly scheduled + manual-dispatch workflow using android-emulator-runner

AGP 9.x caveats (documented in plan)

  • benchmark-macro 1.4.x is incompatible with AGP 9.2.x — only 1.5.0-alpha06+ works; pinned with # Why pinned: comment
  • Do not apply kotlin.android to com.android.test — AGP 9.x has built-in Kotlin support; applying it explicitly throws AgpWithBuiltInKotlinAppliedCheck
  • Scope AndroidX exclusions to :app only — the root build.gradle.kts AndroidX exclusions (needed for oneui-design) now guarded with if (project.name == "app") to avoid stripping benchmark/UiAutomator transitive deps in :baselineprofile

Test plan

  • ./gradlew :app:assembleDebug — BUILD SUCCESSFUL
  • ./gradlew lintDebug — BUILD SUCCESSFUL, no NewerVersionAvailable
  • ./gradlew spotlessCheck — passes
  • ./gradlew detekt — passes
  • Baseline profile tasks registered: generateBaselineProfile, generateReleaseBaselineProfile, copyReleaseBaselineProfileIntoSrc, mergeReleaseBaselineProfile

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Adds a :baselineprofile (com.android.test) module with BaselineProfileGenerator to produce AndroidX baseline profiles for ART AOT.
    • Wires androidx.baselineprofile plugin into :app (dexLayoutOptimization = true) and adds profileinstaller runtime.
    • Adds GitHub Actions workflow (.github/workflows/baseline-profile.yml) to generate/upload baseline profiles (weekly + manual); updates emulator target to Pixel 9 / API 35.
  • Build / Config

    • Adds module to settings, version-catalog entries (benchmark-macro, profileinstaller, uiautomator) and plugin aliases.
    • Centralizes SDK/JVM versions into libs.versions.toml and sources compile/target SDK and jvmTarget from the catalog.
    • Adjusts root Gradle AndroidX exclusion guard to only apply to com.android.application modules (avoids affecting com.android.test).
    • Pins benchmark-macro to 1.5.0-alpha06+ due to AGP 9.x incompatibility; documents AGP 9.x caveats and Kotlin plugin guidance.
  • CI / Hygiene

    • Updates .gitignore and removes/cleans several .idea files.
    • CI/workflow tweaks (emulator API/device, stacktrace in Gradle runner).
  • Tests / Verification

    • Local verification reported: assembleDebug, lintDebug, spotlessCheck, detekt passed; baseline-profile Gradle tasks observed (generate..., merge..., copy...).

Review Change Stack

Add a dedicated :baselineprofile producer module (com.android.test) with
BaselineProfileGenerator, wire the androidx.baselineprofile plugin into
:app with dexLayoutOptimization enabled, and add a weekly CI workflow for
automated profile generation.

AGP 9.x notes: requires benchmark-macro 1.5.0-alpha06+ (1.4.x incompatible);
do NOT apply kotlin.android alongside com.android.test (AGP 9 has built-in
Kotlin); scope AndroidX exclusions to :app only to avoid stripping benchmark
and UiAutomator transitive deps in the new module.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 23, 2026

Warning

Review limit reached

@Lemkinator, we couldn't start this review because you've used your available PR reviews for now.

Your plan currently allows 1 review/hour. Refill in 44 minutes and 22 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 20f548f5-6db2-425a-af6a-322c9e711e91

📥 Commits

Reviewing files that changed from the base of the PR and between b4524de and ba91803.

📒 Files selected for processing (2)
  • baselineprofile/build.gradle.kts
  • gradle.properties
📝 Walkthrough

Walkthrough

Adds baseline profile generation: new :baselineprofile test module, version-catalog and root-plugin updates, app wiring for baseline profiles, refined root build exclusions, a GitHub Actions workflow to generate and upload the profile, and .gitignore updates.

Changes

Android Baseline Profile Generation Feature

Layer / File(s) Summary
Gradle version catalog and root plugin registration
gradle/libs.versions.toml, build.gradle.kts
Adds benchmark-macro, profileinstaller, and uiautomator entries and library aliases; registers android-test and baselineprofile plugins with apply false; moves Java jvmTarget to version catalog and narrows AndroidX exclusion scope.
Gradle module and baselineprofile build setup
settings.gradle.kts, baselineprofile/build.gradle.kts, baselineprofile/src/main/AndroidManifest.xml
Includes :baselineprofile; creates baselineprofile build script with Android test & baselineprofile plugins, SDK targets, instrumentation runner, dependencies, and a minimal manifest; disables emulator display.
Baseline profile test implementation
baselineprofile/src/main/java/de/lemke/geticon/baselineprofile/BaselineProfileGenerator.kt
Adds JUnit/AndroidX benchmark test using BaselineProfileRule to start the app and collect a baseline profile for package de.lemke.geticon.
App module baseline profile integration
app/build.gradle.kts
Opts into ExperimentalRoborazziApi, applies baselineprofile plugin, reads compile/target SDK from the version catalog, adds profileinstaller dependency, configures baselineProfile { dexLayoutOptimization = true }, updates Detekt jvmTarget, and tweaks Kover exclude pattern.
GitHub Actions baseline profile generation workflow
.github/workflows/baseline-profile.yml
New baseline-profile workflow (manual + cron) sets up JDK/Gradle, enables KVM, runs emulator runner to generate baseline profile via Gradle (API 35, pixel_9), and uploads app/src/main/baseline-prof.txt.
IDE ignore updates
.gitignore
Switches to an .idea/ allowlist approach and adds github.properties plus keystore/Firebase ignores.
Renovate androidx-test grouping
renovate.json
Includes androidx.test.uiautomator:** in the androidx-test package grouping.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through Gradle trees so wide,
A tiny module planted with pride,
Workflows hum and profiles bloom,
Artifacts tucked safe in a digital room,
A jaunty hop — performance supplied!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: adding baseline profiles support to the Android project, which is the main focus of the PR with new baselineprofile module, workflow, and Gradle configuration.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch step/10-baseline-profiles

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/baseline-profile.yml:
- Around line 16-17: The checkout step currently uses actions/checkout@v6
without disabling credential persistence; update the Checkout step that uses
actions/checkout@v6 to include with: persist-credentials: false so the job does
not retain the runner's Git credentials after checkout (reference the Checkout
step and the persist-credentials setting).
- Line 17: Update the workflow to pin all third‑party actions to immutable
commit SHAs instead of mutable tags and disable credential persistence for the
checkout step: replace usages of actions/checkout@v6, actions/setup-java,
gradle/actions/setup-gradle, reactivecircus/android-emulator-runner and
actions/upload-artifact with their respective full commit SHAs, and add a with:
persist-credentials: false entry to the actions/checkout step so credentials are
not persisted to the workspace.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b901ca7d-bd5c-41e5-a098-8b2cccde29d0

📥 Commits

Reviewing files that changed from the base of the PR and between b95bbab and 7af6c18.

📒 Files selected for processing (8)
  • .github/workflows/baseline-profile.yml
  • app/build.gradle.kts
  • baselineprofile/build.gradle.kts
  • baselineprofile/src/main/AndroidManifest.xml
  • baselineprofile/src/main/java/de/lemke/geticon/baselineprofile/BaselineProfileGenerator.kt
  • build.gradle.kts
  • gradle/libs.versions.toml
  • settings.gradle.kts

Comment thread .github/workflows/baseline-profile.yml
Comment thread .github/workflows/baseline-profile.yml
@Lemkinator
Copy link
Copy Markdown
Owner Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new :baselineprofile module to generate baseline profiles for the application, including the necessary Gradle configurations, dependencies, and a generator test class. Feedback suggests that the logic for AndroidX exclusions in the root build script is currently too restrictive and should be refactored to exclude the :baselineprofile module specifically, rather than only targeting the :app module, to prevent issues in future library modules.

Comment thread build.gradle.kts Outdated
Lemkinator and others added 6 commits May 23, 2026 13:02
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ofile

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
….properties

- Untrack copilot migration XMLs, markdown.xml, migrations.xml (user-specific IDE state)
- Add patterns for markdown.xml, migrations.xml, copilot.data.migration*.xml
- Add github.properties (contains GH credentials per CLAUDE.md — must not be committed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace ~30 patchwork ignore patterns with /.idea/ + explicit whitelist.
New .idea/ files from IDE updates are silently ignored by default.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.gitignore:
- Around line 2-14: The current .gitignore ignores the whole /.idea/ directory
so later negate patterns like !/.idea/.gitignore won’t re-include children;
change the top rule to ignore contents (use "/.idea/*" instead of "/.idea/") and
ensure you also include an explicit allow rule for the directory itself (add
"!/.idea/") before or after your specific allowlist entries like
"!/.idea/.gitignore", "!/.idea/.name", etc., so Git can descend into the
directory and the specific files are re-included.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 91c3bdaa-3229-4e00-8ca6-49b5d4d4d8ae

📥 Commits

Reviewing files that changed from the base of the PR and between 7af6c18 and 88d060a.

📒 Files selected for processing (10)
  • .github/workflows/baseline-profile.yml
  • .gitignore
  • .idea/copilot.data.migration.agent.xml
  • .idea/copilot.data.migration.ask.xml
  • .idea/copilot.data.migration.ask2agent.xml
  • .idea/copilot.data.migration.edit.xml
  • .idea/gradle.xml
  • .idea/markdown.xml
  • .idea/migrations.xml
  • gradle/libs.versions.toml
💤 Files with no reviewable changes (8)
  • .idea/copilot.data.migration.ask.xml
  • .idea/copilot.data.migration.edit.xml
  • .idea/markdown.xml
  • .idea/copilot.data.migration.agent.xml
  • .idea/gradle.xml
  • .idea/migrations.xml
  • .idea/copilot.data.migration.ask2agent.xml
  • gradle/libs.versions.toml

Comment thread .gitignore Outdated
Lemkinator and others added 4 commits May 23, 2026 13:53
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
/.idea/ ignores the directory itself — git won't descend into it so
!/.idea/<file> negation patterns are silently no-ops. /.idea/* ignores
only the contents, preserving git's ability to apply ! rules.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Defensive pattern — explicitly re-includes subdirectory contents in case
future broader ignore patterns or git version edge cases would swallow them.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Lemkinator
Copy link
Copy Markdown
Owner Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new :baselineprofile module to support baseline profile generation and installation, aimed at improving app performance. It includes updates to the build configuration, dependency management via libs.versions.toml, and a refinement of AndroidX exclusions to prevent conflicts between oneui-design and standard testing libraries. Feedback suggests using a more robust check for the application plugin in the root build script instead of relying on a hardcoded module name.

Comment thread build.gradle.kts Outdated
Lemkinator and others added 8 commits May 23, 2026 14:33
Replaces project.name == "app" with plugins.withId("com.android.application").
Semantically correct: targets all application modules (all use oneui-design forks);
com.android.test modules like :baselineprofile are not matched and retain AOSP AndroidX.
withId() is a callback — safe against configuration-order issues unlike hasPlugin().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
compileSdk, targetSdk, jvmTarget moved from hardcoded literals to
version catalog entries. minSdk stays per-module (26/28 differ).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Lemkinator
Copy link
Copy Markdown
Owner Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new :baselineprofile module to support performance optimization via baseline profiles. Key changes include migrating SDK and JVM targets to the version catalog, refactoring AndroidX dependency exclusions to support test modules, and cleaning up project configuration files. Review feedback highlights a regression in the kover configuration where a literal dollar sign requires escaping in a Kotlin string template to avoid interpolation errors. Additionally, it is suggested to simplify the multi-line assignments for compileSdk and targetSdk in the app's build script to ensure consistency with the rest of the project.

Comment thread app/build.gradle.kts
Comment thread app/build.gradle.kts
Comment thread app/build.gradle.kts
@Lemkinator Lemkinator merged commit 1f1fffa into main May 23, 2026
4 checks passed
@Lemkinator Lemkinator deleted the step/10-baseline-profiles branch May 23, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant