Repository navigation
Scripts and CI find the Gradle build through one location - #523
Merged
Merged
Conversation
…k runner and CI devicelab reads GRADLE_DIR from lib/common.sh beside REPO_ROOT, and publishes, builds the demo, reads the catalog and local.properties, runs the MoQ smoke and applies a plant under it, while git stays at the repository root. bench derives the root build from its own place and the repository from git. ci.yml and device-run.yml each carry one GRADLE_DIR, and setup-android-sdk takes it as an input. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MJAhQmFgdRRAKUaMHibQLe
… usage outside a checkout Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MJAhQmFgdRRAKUaMHibQLe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #520
Scripts and CI now find the Gradle build through one location per script family. Today that location is the repository root, so nothing behaves differently. #521 flips one value per family.
What changed
devicelab:
lib/common.shdefinesGRADLE_DIR=""(relative to the repo root) andGRADLE_ROOTbesideREPO_ROOT. Everything that touches the Gradle build goes throughGRADLE_ROOT:lab(publish, demo build, APK path, and thegradle()log label)moq-smokecatalog_version's default catalogsdk_root'slocal.propertiesGit operations (
tree_state, the commit, the dirty check) stay atREPO_ROOT, because a run records the whole tree.Plants: a new
plant_git_applyrunsgit apply --directory=$GRADLE_DIRwhenGRADLE_DIRis non-empty. That covers check, apply, the-Rrevert, and selftest's--cachedcheck of every shipped plant. Thea/demo/…patches need no rewrite at the move. Thegit statuscleanliness checks around a plant are repo-wide, so they need no change.benchmark/bench: the Gradle build is derived from the script's own location asdirname $BENCH_HOME, so it moves withbenchmark/and has nothing to flip. The repository root now comes fromgit rev-parse --show-toplevel, so the dirty-tree warning still covers the whole repo after the move. It is resolved after argument parsing, so--helpstill works outside a checkout.CI:
ci.ymlanddevice-run.ymleach carry one workflow-levelenv.GRADLE_DIR: .../gradlewstep inci.ymlusesworking-directory: ${{ env.GRADLE_DIR }}, and the demo and benchmark steps use${{ env.GRADLE_DIR }}/demoand${{ env.GRADLE_DIR }}/benchmark.setup-android-sdktakes agradle-dirinput with no default. A caller that omits it fails, naming the input.superplayer-testmedia/path fromGRADLE_DIR. It produces the identical regex today; I checked it locally for both.andandroid.Leak hunt:
leak-hunt.ymlreaches Gradle only throughdevice-run.yml→devicelab/lab, so it is covered by the two values above. I checked this by inspection, since it needs a device.What #521 must flip
devicelab/lib/common.sh:GRADLE_DIR=""→GRADLE_DIR="android".github/workflows/ci.yml:env.GRADLE_DIR: .→android.github/workflows/device-run.yml:env.GRADLE_DIR: .→androidbenchmark/bench: nothing, because it derives the location from where it sits.Out of this unit and left for #521:
.github/dependabot.yml'sdirectoriesand.gitignore's/demo/build/.Tests
GRADLE_DIRsayslocal.propertiesare read from a nested build whenGRADLE_ROOTdiffers from the repo rootGRADLE_DIR=androidin a nested scratch repoGRADLE_DIRemptydevicelab/test/selftest: devicelab 161, jank 20, leak-hunt 34, startup 16, all passed../gradlew assemble check --max-workers=1: green,verifyDevicelabincluded.benchmark/bench --helpand an argument refusal both work. I also ran a copy ofbenchplaced atandroid/benchmark/benchin a scratch git repo with stubgradlews. It published fromandroid/, ran the matrix fromandroid/benchmark/, and the dirty-tree warning saw an untracked file at the repo root.moq-smokechanges were checked by inspection.Review
requiredis enforced, so it now names a missinggradle-direxplicitly; its stale description; andbenchdying on--helpoutside a checkout. Left as is:.in the workflows versus""in shell. Each is idiomatic for its own setting.common.shbefore checkout or setup.GRADLE_DIRin the path ERE.androidhas no metacharacters.GRADLE_DIR. That is Documents describe the android/ layout #522's docs work.dependabot.yml, which is recorded above as Move the Android builds under android/ #521's.🤖 Generated with Claude Code
https://claude.ai/code/session_01MJAhQmFgdRRAKUaMHibQLe