From bc2b77d269a9c8d18d3eb5e4a45fec2aa240de75 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 9 Oct 2025 16:33:42 +0200 Subject: [PATCH] Add a script to check stability of State classes tom script --- tools/compose/check_stability.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 tools/compose/check_stability.sh diff --git a/tools/compose/check_stability.sh b/tools/compose/check_stability.sh new file mode 100755 index 0000000000..c965c787cd --- /dev/null +++ b/tools/compose/check_stability.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +# Copyright 2025 New Vector Ltd. +# +# SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial +# Please see LICENSE files in the repository root for full details. + +set -e + +# Build the project with compose report +echo "Building the project with compose report..." +./gradlew assembleGplayDebug -PcomposeCompilerReports=true -PcomposeCompilerMetrics=true --stacktrace + +echo "Checking stability of State classes..." +# Using the find command, list all the files ending with -classes.txt +find . -type f -name "*-classes.txt" | while read -r file; do + # echo "Processing $file" + # Check that there is no line containing "unstable class .*State {" + if grep -E 'unstable class .*State \{' "$file"; then + echo "Found unstable State class in $file" + exit 1 + fi +done