Skip to content

Extract tested domain layer, add a real build CI, fix missing gradlew#9

Merged
jumincho merged 2 commits into
mainfrom
claude/magical-maxwell-KUnI9
May 29, 2026
Merged

Extract tested domain layer, add a real build CI, fix missing gradlew#9
jumincho merged 2 commits into
mainfrom
claude/magical-maxwell-KUnI9

Conversation

@jumincho
Copy link
Copy Markdown
Owner

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

  • The root gradlew / gradlew.bat launcher scripts were missing, so the documented ./gradlew assembleDebug could not run on a fresh clone. Restored them (gradlew executable). CI now requires both.

Testable domain layer

  • Pulled 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, verified locally). The BMI formula had been 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 + Android SDK, on top of the existing structure/secrets checks. A throwaway FOOD_API_KEY satisfies the build-time guard; it never reaches a real request.

Cleanups (behaviour-neutral)

  • Removed the original library author's ERROR-level debug logging left in production ("aa", "pheynix", "swifty" tags), now-unused TAG fields / Log imports, and the dead open() log branch in TodoActivity.
  • Fixed the todayKcalSCore typo and dropped the write-only questionFlag field.
  • Replaced the 2 + 2 placeholder unit test.

READMEs (KO / EN / ZH)

  • Added a Verify CI badge and showed the new domain/ layer in the project tree. Content verified line-by-line across all three editions.

Note: this environment has no Android emulator, so runtime behaviour can't be exercised here — verification is by JVM unit tests + the CI compile/package. The change set is deliberately behaviour-preserving for exactly that reason.

https://claude.ai/code/session_011AjsUFiGcGPH71NuxTbHib


Generated by Claude Code

claude added 2 commits May 29, 2026 07:15
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.
@jumincho jumincho merged commit 5d38bbf into main May 29, 2026
2 checks passed
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.

2 participants