Extract tested domain layer, add a real build CI, fix missing gradlew#9
Merged
Conversation
Treats the repo as if written from scratch, while preserving the exact behaviour shown in the demo video. Real defect fixed - The root `gradlew` / `gradlew.bat` launcher scripts were missing, so the documented `./gradlew assembleDebug` could not run on a fresh clone. Restored them (gradlew is executable); CI now requires both to be present. Testable domain layer - Pull the BMI and calorie-scoring rules out of the Fragment/ViewModel layer into a pure, framework-free `domain/HealthMetrics`, so they can be unit tested on the JVM without a device. Behaviour is unchanged and pinned by `HealthMetricsTest` (7 tests). The BMI formula was duplicated across HomeViewModel and HomeFragment; both now delegate to one place. CI that actually verifies - The Verify workflow now builds the app (`assembleDebug`) and runs the JVM unit tests (`testDebugUnitTest`) on JDK 11 with the Android SDK, in addition to the existing structure/secrets checks. A throwaway FOOD_API_KEY satisfies the build-time guard. Cleanups - Remove the original library author's ERROR-level debug logging left in production (`"aa"`, `"pheynix"`, `"swifty"` tags) and now-unused TAG fields and Log imports; drop the dead open()/log branch in TodoActivity. - Fix the `todayKcalSCore` typo and drop the write-only `questionFlag` field. - Replace the 2+2 placeholder unit test. READMEs (KO/EN/ZH): add a Verify CI badge and show the new domain layer.
The Build job died in ~8s — before any Gradle/SDK download — which points to an 'actions created by GitHub only' policy rejecting android-actions/setup-android. Install the command-line tools directly (first-party actions + run steps only) so the assembleDebug + unit-test build can run.
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.
A from-scratch-quality pass over the 2021 app, preserving the exact behaviour shown in the demo video (no UI/feature changes).
Real defect fixed
gradlew/gradlew.batlauncher scripts were missing, so the documented./gradlew assembleDebugcould not run on a fresh clone. Restored them (gradlewexecutable). CI now requires both.Testable domain layer
domain/HealthMetricsso they can be unit tested on the JVM without a device.HealthMetricsTest(7 tests, verified locally). The BMI formula had been duplicated acrossHomeViewModelandHomeFragment; both now delegate to one place.CI that actually verifies
assembleDebug) and runs the JVM unit tests (testDebugUnitTest) on JDK 11 + Android SDK, on top of the existing structure/secrets checks. A throwawayFOOD_API_KEYsatisfies the build-time guard; it never reaches a real request.Cleanups (behaviour-neutral)
"aa","pheynix","swifty"tags), now-unusedTAGfields /Logimports, and the deadopen()log branch inTodoActivity.todayKcalSCoretypo and dropped the write-onlyquestionFlagfield.2 + 2placeholder unit test.READMEs (KO / EN / ZH)
domain/layer in the project tree. Content verified line-by-line across all three editions.https://claude.ai/code/session_011AjsUFiGcGPH71NuxTbHib
Generated by Claude Code