Repository navigation
build: migrate to Gradle 9 and AGP 9 with new Compose Multiplatform s… - #77
MeshackKangi wants to merge 12 commits into
Conversation
…tructure - Update Gradle wrapper to 9.1.0 - Update Android Gradle Plugin to 9.0.1 - Restructure modules to follow new Compose Multiplatform directory structure: - ohs-player-library: KMP library with androidKotlinMultiplatformLibrary plugin - androidApp: Android application module - desktopApp: Desktop application module - webApp: Web/Wasm application module - Remove reference-app and ohs-player-reference-app modules - Update CI/CD workflows for new module paths - Preserve all source code, custom source sets (foregroundSync*), iOS framework config, igCodegen, and generateAuthConfig BREAKING CHANGE: Module structure changed from single reference-app to multi-module setup. Consumers must update build scripts to depend on :ohs-player-library instead of :reference-app.
|
@MeshackKangi Can you update your commit messages to this style https://cbea.ms/git-commit/ for consistency. |
The LoginRedirectActivity intent-filter hardcoded its scheme and host, so the OAuth redirect could drift from the OAUTH_REDIRECT_SCHEME / OAUTH_REDIRECT_HOST values the app actually authenticates with. Upstream fixed this in PR ohs-foundation#80 by injecting both as manifest placeholders. Port that fix into the split-module layout: the app module resolves the placeholders and supplies them via defaultConfig, and the library manifest references ${oauthRedirectScheme} / ${oauthRedirectHost}. The placeholders cannot live in the library module because the KMP androidLibrary { } DSL does not expose manifestPlaceholders. Hoist the library's OAuth config reads to script-level vals so the placeholders and generateAuthConfig source from the same values.
Upstream 1fac23e (PR ohs-foundation#80) added OAuth manifest placeholders to the old reference-app/ layout. That layout was split into androidApp and ohs-player-library on this branch, and the same fix was already ported into the new layout in 2f3bb13. Git's rename detection aligned upstream's reference-app/build.gradle.kts with ohs-player-library/build.gradle.kts and upstream's reference-app manifest with ohs-player-library's manifest, producing two content conflicts. Both were resolved in favour of HEAD: the upstream hunks target files that no longer exist, and their substance is already present in androidApp and ohs-player-library. The .github/workflows/release.yml, README.md, and local.properties.sample changes from upstream auto-merged and are kept.
main advanced by 59a2627 ("Move to kotlin-fhir rc03 and matching libraries (ohs-foundation#81)"), which bumped four dependencies in gradle/libs.versions.toml. Our branch had also edited the same block to upgrade spotless for the Gradle 9 migration, so Git could not auto-merge the file. Resolved per key: - ohsFhirDataCapture, ohsFhirEngine, ohsFhirModelR4, ohsPlayerClient: taken from main (2.0.0-alpha04, 2.0.0-alpha04, 1.0.0-rc03, 1.0.0-alpha03). These are the substance of ohs-foundation#81 and what the downstream issues assume. - spotless: kept at 8.10.1, which is newer than main's 8.6.0 and was chosen as part of the Gradle 9 migration. Verified locally: :androidApp:assembleDebug, spotlessCheck, :desktopApp:packageDeb, :webApp:jsBrowserDistribution and :webApp:wasmJsBrowserDistribution all pass. The merged manifest still resolves the LoginRedirectActivity placeholders to dev.ohs.player.reference.app / auth.
|
@MeshackKangi Please update and resolve merge conflicts. |
ellykits
left a comment
There was a problem hiding this comment.
Delete the ohs-player-library references in this PR. The player client library is now oferred as a maven central library
ellykits
left a comment
There was a problem hiding this comment.
Should we include a shared module? Or how is it named? How do you access the commonMain source files that were shared by the different apps @MeshackKangi?
Port 9fc1bc6 into the split-module layout. That commit changed files under reference-app/, which this branch replaced with androidApp and ohs-player-library, so Git reported modify/delete and file-location conflicts. - Binary-Immunization.json: use "occurrence" instead of "occurrenceDateTime". - FhirDateTimes.kt, FhirDateTimesTest.kt: add to ohs-player-library at the renamed paths. - PatientRepository.kt: sort immunizations by occurrenceDate descending. - resolvedFhirBaseUrl: normalise with a trailing slash, porting main's fix for ohs-foundation#84. Verified: :ohs-player-library:jvmTest, :androidApp:assembleDebug, spotlessCheck.
The generic player-client code now lives in dev.ohs.player:client on Maven Central, and ohs-player-library only holds reference-app code. The old name implies otherwise, so rename the module to reflect what it is. - Update settings.gradle.kts and the three app modules to depend on :reference-shared. - Update the desktop icon path to ../reference-shared/desktop-icons. - Update the generated-file headers inside generateAuthConfig to name :reference-shared. - Update CI task paths in .github/workflows/ci.yml. - Drop the four-line comment above the app module's OAuth config block; the section header already labels it. Verified: :reference-shared:jvmTest, :androidApp:assembleDebug, spotlessCheck, :desktopApp:packageDeb, web distributions, and the merged Android manifest placeholders.
|
The ohs-player-library module is renamed to reference-shared.Its |
ellykits
left a comment
There was a problem hiding this comment.
Rename module reference-shared to just shared Then share screenshots of app running on multiple platform. Otherwise the rest look good.
@ellykits This is done. The screenshots are right below. Wasm/JS's build succeeds but I cannot provide screenshots because of the existing issue #82. |


Migrate to Gradle 9 and AGP 9, split into modules
Gradle wrapper moves to 9.1.0 and AGP to 9.0.1. AGP 9 no longer
allows a module to apply both com.android.library and the Kotlin
Multiplatform plugin together, so the single reference-app module
is split into:
androidKotlinMultiplatformLibrary plugin
All source code, custom source sets (foregroundSync*), the iOS
framework config, igCodegen, and generateAuthConfig are preserved
as-is; only their module location changes.
CI and release workflows are updated for the new module paths.
BREAKING CHANGE: consumers depending on :reference-app must switch
to :ohs-player-library.