From fe61c2f3f42282d0243de2425fd5e7c54696bfa0 Mon Sep 17 00:00:00 2001 From: Johannes Vedder Date: Sat, 20 Jul 2024 15:29:23 +0200 Subject: [PATCH 1/4] chore: include fvm tool --- .fvmrc | 3 +++ .gitignore | 3 +++ CONTRIBUTING.md | 14 +++++++++++++- melos.yaml | 2 +- 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 .fvmrc diff --git a/.fvmrc b/.fvmrc new file mode 100644 index 000000000..cf7449069 --- /dev/null +++ b/.fvmrc @@ -0,0 +1,3 @@ +{ + "flutter": "3.22.3" +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 281657cd5..86286736e 100644 --- a/.gitignore +++ b/.gitignore @@ -161,3 +161,6 @@ generated/ # Megalinter megalinter-reports/ + +# FVM Version Cache +.fvm/ \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2245ff520..169f99921 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ ## Getting Started 1. [Setup Flutter](https://flutter.dev/docs/get-started/install) -2. Make sure both flutter and dart are in your PATH. Run `dart --version` and +2. Make sure `flutter` and `dart` are both in your PATH. Run `dart --version` and `flutter --version` to check. 3. Clone this repository and `cd` into it. 4. Install [Melos](https://melos.invertase.dev/) by running: `dart pub global @@ -90,6 +90,18 @@ features or bug fixes, create a new branch and open a pull request. Please make sure to follow these guidelines when contributing to the project. +## Flutter Version Management + +The StudyU monorepo uses the [FVM](https://fvm.app/) tool to manage the Flutter +SDK version. This allows us to have a consistent Flutter version across all +packages. The Flutter SDK version is specified in the `.fvm` file in the root +directory. To install the Flutter SDK version, run `fvm install` in the root directory. +You might also want to integrate FVM within your IDE. For Android Studio you can change the Flutter +SDK path in the settings for the Flutter plugin. Open the Android Studio settings and navigate to +Languages & Frameworks -> Flutter -> Flutter SDK path and set the path to the FVM Flutter SDK +(`/.fvm/flutter_sdk`). For VS Code, have a look at +the [FVM documentation](https://fvm.app/documentation/guides/vscode). + ## Database and Backend We are using a self-hosted instance of [Supabase](https://supabase.com/) as a diff --git a/melos.yaml b/melos.yaml index 2450bc0d3..9132358c8 100644 --- a/melos.yaml +++ b/melos.yaml @@ -1,6 +1,6 @@ name: studyu - repository: https://github.com/hpi-studyu/studyu +sdkPath: .fvm/flutter_sdk packages: - app From 84e0d4731c434fcaca8fdd7b1b6b88d4d0e29f61 Mon Sep 17 00:00:00 2001 From: Johannes Vedder Date: Sat, 20 Jul 2024 15:36:43 +0200 Subject: [PATCH 2/4] chore: flutter v3.22.3 update --- app/android/Gemfile.lock | 4 +-- app/pubspec.lock | 8 +++--- app/pubspec.yaml | 6 ++--- core/pubspec.lock | 4 +-- .../participant/participant_legend.dart | 3 +-- .../participant/participant_squares.dart | 25 ++++++++++--------- designer_v2/pubspec.lock | 12 ++++----- flutter_common/pubspec.lock | 8 +++--- pubspec.lock | 4 +-- 9 files changed, 37 insertions(+), 37 deletions(-) diff --git a/app/android/Gemfile.lock b/app/android/Gemfile.lock index 550f7ffaa..24ee86810 100644 --- a/app/android/Gemfile.lock +++ b/app/android/Gemfile.lock @@ -10,8 +10,8 @@ GEM artifactory (3.0.17) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.956.0) - aws-sdk-core (3.201.1) + aws-partitions (1.957.0) + aws-sdk-core (3.201.2) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.8) diff --git a/app/pubspec.lock b/app/pubspec.lock index c6b9a3cc5..edb8376e6 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -1105,10 +1105,10 @@ packages: dependency: transitive description: name: shared_preferences_platform_interface - sha256: "22e2ecac9419b4246d7c22bfbbda589e3acf5c0351137d87dd2939d984d37c3b" + sha256: "034650b71e73629ca08a0bd789fd1d83cc63c2d1e405946f7cef7bc37432f93a" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.4.0" shared_preferences_web: dependency: transitive description: @@ -1308,10 +1308,10 @@ packages: dependency: transitive description: name: url_launcher_android - sha256: eac82dc8e5f48818054f46021e9e5f34c239f8d301e7e29165b977c8d1189fed + sha256: "95d8027db36a0e52caf55680f91e33ea6aa12a3ce608c90b06f4e429a21067ac" url: "https://pub.dev" source: hosted - version: "6.3.4" + version: "6.3.5" url_launcher_ios: dependency: transitive description: diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 2c4eec9c7..18b5145e9 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -20,7 +20,7 @@ dependencies: flutter_local_notifications: ^17.2.1+2 flutter_localizations: sdk: flutter - flutter_timezone: ^2.0.1 + flutter_timezone: ^2.1.0 flutter_web_plugins: sdk: flutter flutter_widget_from_html: ^0.15.1 @@ -36,8 +36,8 @@ dependencies: quiver: ^3.2.1 rainbow_color: ^2.0.1 record: ^5.1.2 - sentry_flutter: ^8.3.0 - sentry_logging: ^8.3.0 + sentry_flutter: ^8.4.0 + sentry_logging: ^8.4.0 shared_preferences: ^2.2.3 studyu_core: ^4.4.4 studyu_flutter_common: ^1.8.5 diff --git a/core/pubspec.lock b/core/pubspec.lock index b224d0bd0..35073fc8d 100644 --- a/core/pubspec.lock +++ b/core/pubspec.lock @@ -226,10 +226,10 @@ packages: dependency: transitive description: name: graphs - sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.2" http: dependency: transitive description: diff --git a/designer_v2/lib/features/monitor/participant/participant_legend.dart b/designer_v2/lib/features/monitor/participant/participant_legend.dart index 21e30b56a..190aad98a 100644 --- a/designer_v2/lib/features/monitor/participant/participant_legend.dart +++ b/designer_v2/lib/features/monitor/participant/participant_legend.dart @@ -1,9 +1,8 @@ import 'package:flutter/material.dart'; import 'package:studyu_designer_v2/common_views/striped_gradient.dart'; +import 'package:studyu_designer_v2/features/monitor/participant/colors.dart'; import 'package:studyu_designer_v2/localization/app_translation.dart'; -import 'colors.dart'; - class ParticipantLegend extends StatelessWidget { const ParticipantLegend(); diff --git a/designer_v2/lib/features/monitor/participant/participant_squares.dart b/designer_v2/lib/features/monitor/participant/participant_squares.dart index 7e6fb94eb..312d8cf49 100644 --- a/designer_v2/lib/features/monitor/participant/participant_squares.dart +++ b/designer_v2/lib/features/monitor/participant/participant_squares.dart @@ -76,13 +76,14 @@ class ParticipantSquares extends StatelessWidget { : totalCompletedDays; phases.add( StudyPhase( - intervention: Intervention.withId()..name = 'Baseline', - missedTasksPerDay: monitorItem.missedTasksPerDay.sublist( - startInx, - endInx, - ), - completedTasksPerDay: - monitorItem.completedTasksPerDay.sublist(startInx, endInx)), + intervention: Intervention.withId()..name = 'Baseline', + missedTasksPerDay: monitorItem.missedTasksPerDay.sublist( + startInx, + endInx, + ), + completedTasksPerDay: + monitorItem.completedTasksPerDay.sublist(startInx, endInx), + ), ); } @@ -114,11 +115,11 @@ class ParticipantSquares extends StatelessWidget { phases.add( StudyPhase( - intervention: intervention, - missedTasksPerDay: - monitorItem.missedTasksPerDay.sublist(start, end), - completedTasksPerDay: - monitorItem.completedTasksPerDay.sublist(start, end)), + intervention: intervention, + missedTasksPerDay: monitorItem.missedTasksPerDay.sublist(start, end), + completedTasksPerDay: + monitorItem.completedTasksPerDay.sublist(start, end), + ), ); } assert( diff --git a/designer_v2/pubspec.lock b/designer_v2/pubspec.lock index 5bc88cde4..81298002b 100644 --- a/designer_v2/pubspec.lock +++ b/designer_v2/pubspec.lock @@ -507,10 +507,10 @@ packages: dependency: transitive description: name: graphs - sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.2" gtk: dependency: transitive description: @@ -1040,10 +1040,10 @@ packages: dependency: transitive description: name: shared_preferences_platform_interface - sha256: "22e2ecac9419b4246d7c22bfbbda589e3acf5c0351137d87dd2939d984d37c3b" + sha256: "034650b71e73629ca08a0bd789fd1d83cc63c2d1e405946f7cef7bc37432f93a" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.4.0" shared_preferences_web: dependency: transitive description: @@ -1291,10 +1291,10 @@ packages: dependency: transitive description: name: url_launcher_android - sha256: eac82dc8e5f48818054f46021e9e5f34c239f8d301e7e29165b977c8d1189fed + sha256: "95d8027db36a0e52caf55680f91e33ea6aa12a3ce608c90b06f4e429a21067ac" url: "https://pub.dev" source: hosted - version: "6.3.4" + version: "6.3.5" url_launcher_ios: dependency: transitive description: diff --git a/flutter_common/pubspec.lock b/flutter_common/pubspec.lock index 8d1459afa..abf763e1e 100644 --- a/flutter_common/pubspec.lock +++ b/flutter_common/pubspec.lock @@ -500,10 +500,10 @@ packages: dependency: transitive description: name: shared_preferences_platform_interface - sha256: "22e2ecac9419b4246d7c22bfbbda589e3acf5c0351137d87dd2939d984d37c3b" + sha256: "034650b71e73629ca08a0bd789fd1d83cc63c2d1e405946f7cef7bc37432f93a" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.4.0" shared_preferences_web: dependency: transitive description: @@ -640,10 +640,10 @@ packages: dependency: transitive description: name: url_launcher_android - sha256: eac82dc8e5f48818054f46021e9e5f34c239f8d301e7e29165b977c8d1189fed + sha256: "95d8027db36a0e52caf55680f91e33ea6aa12a3ce608c90b06f4e429a21067ac" url: "https://pub.dev" source: hosted - version: "6.3.4" + version: "6.3.5" url_launcher_ios: dependency: transitive description: diff --git a/pubspec.lock b/pubspec.lock index a902d7924..1100f981c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -101,10 +101,10 @@ packages: dependency: transitive description: name: graphs - sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.2" http: dependency: transitive description: From 9472b430bc1ea317573d58f08e2a47b7196d9cb1 Mon Sep 17 00:00:00 2001 From: Johannes Vedder Date: Sat, 20 Jul 2024 15:47:59 +0200 Subject: [PATCH 3/4] ci: add fvm config action --- .github/workflows/init-workspace/action.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/init-workspace/action.yml b/.github/workflows/init-workspace/action.yml index 565c0c76e..3f2dc5aa3 100644 --- a/.github/workflows/init-workspace/action.yml +++ b/.github/workflows/init-workspace/action.yml @@ -5,12 +5,20 @@ description: Initialize workspace for all packages runs: using: "composite" steps: - - name: Set up Flutter - uses: subosito/flutter-action@v2 + - uses: kuhnroyal/flutter-fvm-config-action@v2 + id: fvm-config-action + + - uses: subosito/flutter-action@v2 with: - channel: stable - # Increase this version manually when we add support for a new Flutter release - flutter-version: '3.22.x' + flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} + channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }} + id: flutter-action + + - run: | + echo CACHE-PATH=${{ steps.flutter-action.outputs.CACHE-PATH }} + mkdir -p .fvm + ln -s ${{ steps.flutter-action.outputs.CACHE-PATH }} .fvm/flutter_sdk + shell: bash - name: Install melos run: dart pub global activate melos From fb4059c39a1f2972b44ee7d6cd3d3e1c5c7148df Mon Sep 17 00:00:00 2001 From: Johannes Vedder Date: Sun, 21 Jul 2024 12:54:07 +0200 Subject: [PATCH 4/4] ci: fix e2e_tests.yml push trigger --- .github/workflows/e2e_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index a6f2c9094..a43b84dda 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -4,6 +4,7 @@ on: push: paths: - ".github/workflows/e2e_tests.yml" + - ".github/workflows/init-workspace/action.yml" - 'designer_v2/**' - 'core/**' - 'flutter_common/**'