From 00ff4322058aed8717ed98617f7c48f904f6d60f Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Wed, 21 Oct 2026 21:35:17 +0300 Subject: [PATCH] Test the UI module's source against the checkout's core in CI sdk-java-ui now depends on a released core, so no build compiled or tested it against the sdk-java of the same checkout any more. It uses the core's internal classes, so a core change could break it unnoticed until the next UI release. The testUiWithLocalCore project property swaps the released core for the sdk-java project, and the cross-platform job sets it for the UI tests. Releasing a ui- tag still tests the UI against the released core it names. The property tests the UI source, not the released java-ui jar on a newer core. Also wraps the changelog line markdownlint (MD013) reported as too long. --- .github/workflows/cross-platform-tests.yml | 5 +++++ sdk-java-ui/CHANGELOG.md | 3 ++- sdk-java-ui/build.gradle | 12 ++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cross-platform-tests.yml b/.github/workflows/cross-platform-tests.yml index b3bed7bc..a8c42104 100644 --- a/.github/workflows/cross-platform-tests.yml +++ b/.github/workflows/cross-platform-tests.yml @@ -56,9 +56,14 @@ jobs: # # Deliberately without -Dcountly.ui.pageLoadTests: that enables the one class showing a # transparent stage, which segfaults the JVM everywhere it has been tried. + # + # testUiWithLocalCore (see sdk-java-ui/build.gradle) runs the UI on this checkout's core. The + # release of a ui- tag still tests it against the released core it names. - name: Run the JavaFX UI tests if: always() shell: bash + env: + ORG_GRADLE_PROJECT_testUiWithLocalCore: 'true' run: | if [ "$RUNNER_OS" = "Linux" ]; then sudo apt-get update -qq && sudo apt-get install -y -qq xvfb diff --git a/sdk-java-ui/CHANGELOG.md b/sdk-java-ui/CHANGELOG.md index 26be802d..cdfbb57d 100644 --- a/sdk-java-ui/CHANGELOG.md +++ b/sdk-java-ui/CHANGELOG.md @@ -1,5 +1,6 @@ ## XX.XX.XX -* ! Minor breaking change ! `ly.count.sdk:java-ui` now has its own version numbers and is released only when it changes, so its version no longer follows the core SDK `ly.count.sdk:java`. It names the core version it needs, currently 26.8.0; if your project also declares `ly.count.sdk:java`, use that version or a newer one. +* ! Minor breaking change ! `ly.count.sdk:java-ui` now has its own version numbers and is released only when it changes, so its version no longer follows the core SDK `ly.count.sdk:java`. + It names the core version it needs, currently 26.8.0; if your project also declares `ly.count.sdk:java`, use that version or a newer one. ## 26.8.0 * First release, together with the Java SDK 26.8.0. See the Java SDK's [CHANGELOG](../CHANGELOG.md) for what it displays. diff --git a/sdk-java-ui/build.gradle b/sdk-java-ui/build.gradle index 613e3463..3a690707 100644 --- a/sdk-java-ui/build.gradle +++ b/sdk-java-ui/build.gradle @@ -71,6 +71,18 @@ dependencies { testImplementation 'org.mockito:mockito-core:4.11.0' } +// -PtestUiWithLocalCore=true builds and tests this module's source against the sdk-java project +// instead of the released core above. This module uses the core's internal classes, so a core +// change that breaks it fails CI before the core is released. It does not test the released +// java-ui jar on a newer core. +if (findProperty('testUiWithLocalCore') == 'true') { + configurations.configureEach { + resolutionStrategy.dependencySubstitution { + substitute module('ly.count.sdk:java') using project(':sdk-java') + } + } +} + // Coverage. Reports land in build/reports/jacoco/test/ (HTML to read, XML for tooling). // "./gradlew coverage" from the repo root runs this and prints a summary. apply plugin: 'jacoco'