Skip to content

build: migrate to Gradle 9 and AGP 9 with new Compose Multiplatform s… - #77

Open
MeshackKangi wants to merge 12 commits into
ohs-foundation:mainfrom
MeshackKangi:migrate-gradle9
Open

MeshackKangi wants to merge 12 commits into
ohs-foundation:mainfrom
MeshackKangi:migrate-gradle9

Conversation

@MeshackKangi

@MeshackKangi MeshackKangi commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

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:

  • ohs-player-library: the KMP library, using the new
    androidKotlinMultiplatformLibrary plugin
  • androidApp: the Android application module
  • desktopApp: the desktop application module
  • webApp: the web/Wasm application module

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.

dev and others added 5 commits September 8, 2026 15:03
…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.
@ellykits

Copy link
Copy Markdown
Contributor

@MeshackKangi Can you update your commit messages to this style https://cbea.ms/git-commit/ for consistency.

dev added 2 commits September 23, 2026 17:56
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.
@ellykits

Copy link
Copy Markdown
Contributor

@MeshackKangi Please update and resolve merge conflicts.

@ellykits ellykits left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Delete the ohs-player-library references in this PR. The player client library is now oferred as a maven central library

@ellykits ellykits left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.
@MeshackKangi

Copy link
Copy Markdown
Member Author

The ohs-player-library module is renamed to reference-shared.Its commonMain source set is at reference-shared/src/commonMain/kotlin/, and androidApp, desktopApp, and webApp each depend on it via implementation(project(":reference-shared")).

@ellykits ellykits left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rename module reference-shared to just shared Then share screenshots of app running on multiple platform. Otherwise the rest look good.

@MeshackKangi

Copy link
Copy Markdown
Member Author

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.
I can work on issue #82 after this is merged.

@MeshackKangi

MeshackKangi commented Oct 29, 2026 •

Copy link
Copy Markdown
Member Author

Android

Migration

Deskop

migration-test 1-c5b4ea159a3f" />

This branch has not been deployed

No deployments
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