Skip to content

Commit 4601192

Browse files
committed
Upgrade signals app flutter version
1 parent e80955e commit 4601192

File tree

17 files changed

+154
-124
lines changed

17 files changed

+154
-124
lines changed

scripts/update_flutter.sh

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,31 @@
33
# This script loops through subdirectories to find Flutter projects,
44
# cleans them by removing platform-specific folders,
55
# recreates the Flutter project files, and then removes an unnecessary test file.
6+
#
7+
# Usage:
8+
# ./scripts/update_flutter.sh # Process all Flutter projects
9+
# ./scripts/update_flutter.sh signals # Process only the 'signals' directory
610

7-
# Find all directories one level deep from the current location.
8-
for dir in */; do
11+
# Check if a specific directory was provided as an argument
12+
if [ $# -eq 1 ]; then
13+
# Process only the specified directory
14+
target_dir="$1"
15+
if [ ! -d "$target_dir" ]; then
16+
echo "❌ Error: Directory '$target_dir' does not exist."
17+
exit 1
18+
fi
19+
# Add trailing slash if not present
20+
if [[ ! "$target_dir" == */ ]]; then
21+
target_dir="${target_dir}/"
22+
fi
23+
directories=("$target_dir")
24+
else
25+
# Find all directories one level deep from the current location
26+
directories=(*/)
27+
fi
28+
29+
# Process the directories
30+
for dir in "${directories[@]}"; do
931
# Ensure we are only processing actual directories.
1032
if [ -d "$dir" ]; then
1133
echo "🔎 Processing directory: $dir"
@@ -14,40 +36,48 @@ for dir in */; do
1436

1537
# 1. Check if pubspec.yaml exists and contains a 'flutter:' dependency.
1638
if [ -f "$pubspec_file" ] && grep -q "flutter:" "$pubspec_file"; then
17-
echo " ✅ Found pubspec.yaml with a Flutter dependency."
39+
echo "✅ Found pubspec.yaml with a Flutter dependency."
1840

1941
# 2. Check if it's a valid project by looking for platform folders.
2042
if [ -d "${dir}ios" ] || [ -d "${dir}android" ] || [ -d "${dir}web" ] || \
2143
[ -d "${dir}macos" ] || [ -d "${dir}windows" ] || [ -d "${dir}linux" ]; then
2244

23-
echo " ✅ Found platform folders. Proceeding with cleanup..."
45+
echo "✅ Found platform folders. Proceeding with cleanup..."
2446

2547
# Using a subshell to change directory, so we don't have to 'cd ..'
2648
(
2749
cd "$dir" || exit
2850

2951
# 3. Remove the old platform folders.
30-
echo " Removing platform folders: ios, android, web, macos, windows, linux"
52+
echo "Removing platform folders: ios, android, web, macos, windows, linux"
3153
rm -rf ios android web macos windows linux
3254

3355
# 4. Recreate the Flutter project in the current directory.
34-
echo " 🚀 Running 'fvm flutter create .'"
56+
echo "🚀 Running 'fvm flutter create .'"
3557
fvm flutter create .
3658

3759
# 5. Remove the default widget test file.
3860
widget_test_file="test/widget_test.dart"
3961
if [ -f "$widget_test_file" ]; then
40-
echo " 🗑️ Removing generated file: $widget_test_file"
62+
echo "🗑️ Removing generated file: $widget_test_file"
4163
rm "$widget_test_file"
4264
fi
4365

44-
echo " ✨ Successfully processed project in $dir"
66+
# Clean the project
67+
echo "🧹 Cleaning the project"
68+
fvm flutter clean
69+
70+
# Install dependencies
71+
echo "🔎 Installing dependencies"
72+
fvm flutter pub get
73+
74+
echo "✨ Successfully processed project in $dir"
4575
)
4676
else
47-
echo " ⏭️ Skipping: No platform folders found."
77+
echo "⏭️ Skipping: No platform folders found."
4878
fi
4979
else
50-
echo " ⏭️ Skipping: Not a Flutter project."
80+
echo "⏭️ Skipping: Not a Flutter project."
5181
fi
5282
echo "--------------------------------------------------"
5383
fi

signals/.metadata

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: "20f82749394e68bcfbbeee96bad384abaae09c13"
7+
revision: "05db9689081f091050f01aed79f04dce0c750154"
88
channel: "stable"
99

1010
project_type: app
@@ -13,26 +13,26 @@ project_type: app
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: 20f82749394e68bcfbbeee96bad384abaae09c13
17-
base_revision: 20f82749394e68bcfbbeee96bad384abaae09c13
16+
create_revision: 05db9689081f091050f01aed79f04dce0c750154
17+
base_revision: 05db9689081f091050f01aed79f04dce0c750154
1818
- platform: android
19-
create_revision: 20f82749394e68bcfbbeee96bad384abaae09c13
20-
base_revision: 20f82749394e68bcfbbeee96bad384abaae09c13
19+
create_revision: 05db9689081f091050f01aed79f04dce0c750154
20+
base_revision: 05db9689081f091050f01aed79f04dce0c750154
2121
- platform: ios
22-
create_revision: 20f82749394e68bcfbbeee96bad384abaae09c13
23-
base_revision: 20f82749394e68bcfbbeee96bad384abaae09c13
22+
create_revision: 05db9689081f091050f01aed79f04dce0c750154
23+
base_revision: 05db9689081f091050f01aed79f04dce0c750154
2424
- platform: linux
25-
create_revision: 20f82749394e68bcfbbeee96bad384abaae09c13
26-
base_revision: 20f82749394e68bcfbbeee96bad384abaae09c13
25+
create_revision: 05db9689081f091050f01aed79f04dce0c750154
26+
base_revision: 05db9689081f091050f01aed79f04dce0c750154
2727
- platform: macos
28-
create_revision: 20f82749394e68bcfbbeee96bad384abaae09c13
29-
base_revision: 20f82749394e68bcfbbeee96bad384abaae09c13
28+
create_revision: 05db9689081f091050f01aed79f04dce0c750154
29+
base_revision: 05db9689081f091050f01aed79f04dce0c750154
3030
- platform: web
31-
create_revision: 20f82749394e68bcfbbeee96bad384abaae09c13
32-
base_revision: 20f82749394e68bcfbbeee96bad384abaae09c13
31+
create_revision: 05db9689081f091050f01aed79f04dce0c750154
32+
base_revision: 05db9689081f091050f01aed79f04dce0c750154
3333
- platform: windows
34-
create_revision: 20f82749394e68bcfbbeee96bad384abaae09c13
35-
base_revision: 20f82749394e68bcfbbeee96bad384abaae09c13
34+
create_revision: 05db9689081f091050f01aed79f04dce0c750154
35+
base_revision: 05db9689081f091050f01aed79f04dce0c750154
3636

3737
# User provided section
3838

signals/android/app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
}
77

88
android {
9-
namespace = "com.example.signals"
9+
namespace = "com.example.signals_sample"
1010
compileSdk = flutter.compileSdkVersion
1111
ndkVersion = flutter.ndkVersion
1212

@@ -21,7 +21,7 @@ android {
2121

2222
defaultConfig {
2323
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
24-
applicationId = "com.example.signals"
24+
applicationId = "com.example.signals_sample"
2525
// You can update the following values to match your application needs.
2626
// For more information, see: https://flutter.dev/to/review-gradle-config.
2727
minSdk = flutter.minSdkVersion

signals/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
22
<application
3-
android:label="signals"
3+
android:label="signals_sample"
44
android:name="${applicationName}"
55
android:icon="@mipmap/ic_launcher">
66
<activity

signals/android/app/src/main/kotlin/com/example/signals/MainActivity.kt renamed to signals/android/app/src/main/kotlin/com/example/signals_sample/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.signals
1+
package com.example.signals_sample
22

33
import io.flutter.embedding.android.FlutterActivity
44

signals/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@
369369
"$(inherited)",
370370
"@executable_path/Frameworks",
371371
);
372-
PRODUCT_BUNDLE_IDENTIFIER = com.example.signals;
372+
PRODUCT_BUNDLE_IDENTIFIER = com.example.signalsSample;
373373
PRODUCT_NAME = "$(TARGET_NAME)";
374374
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
375375
SWIFT_VERSION = 5.0;
@@ -385,7 +385,7 @@
385385
CURRENT_PROJECT_VERSION = 1;
386386
GENERATE_INFOPLIST_FILE = YES;
387387
MARKETING_VERSION = 1.0;
388-
PRODUCT_BUNDLE_IDENTIFIER = com.example.signals.RunnerTests;
388+
PRODUCT_BUNDLE_IDENTIFIER = com.example.signalsSample.RunnerTests;
389389
PRODUCT_NAME = "$(TARGET_NAME)";
390390
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
391391
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -402,7 +402,7 @@
402402
CURRENT_PROJECT_VERSION = 1;
403403
GENERATE_INFOPLIST_FILE = YES;
404404
MARKETING_VERSION = 1.0;
405-
PRODUCT_BUNDLE_IDENTIFIER = com.example.signals.RunnerTests;
405+
PRODUCT_BUNDLE_IDENTIFIER = com.example.signalsSample.RunnerTests;
406406
PRODUCT_NAME = "$(TARGET_NAME)";
407407
SWIFT_VERSION = 5.0;
408408
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
@@ -417,7 +417,7 @@
417417
CURRENT_PROJECT_VERSION = 1;
418418
GENERATE_INFOPLIST_FILE = YES;
419419
MARKETING_VERSION = 1.0;
420-
PRODUCT_BUNDLE_IDENTIFIER = com.example.signals.RunnerTests;
420+
PRODUCT_BUNDLE_IDENTIFIER = com.example.signalsSample.RunnerTests;
421421
PRODUCT_NAME = "$(TARGET_NAME)";
422422
SWIFT_VERSION = 5.0;
423423
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
@@ -549,7 +549,7 @@
549549
"$(inherited)",
550550
"@executable_path/Frameworks",
551551
);
552-
PRODUCT_BUNDLE_IDENTIFIER = com.example.signals;
552+
PRODUCT_BUNDLE_IDENTIFIER = com.example.signalsSample;
553553
PRODUCT_NAME = "$(TARGET_NAME)";
554554
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
555555
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -572,7 +572,7 @@
572572
"$(inherited)",
573573
"@executable_path/Frameworks",
574574
);
575-
PRODUCT_BUNDLE_IDENTIFIER = com.example.signals;
575+
PRODUCT_BUNDLE_IDENTIFIER = com.example.signalsSample;
576576
PRODUCT_NAME = "$(TARGET_NAME)";
577577
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
578578
SWIFT_VERSION = 5.0;

signals/ios/Runner/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
<key>CFBundleDevelopmentRegion</key>
66
<string>$(DEVELOPMENT_LANGUAGE)</string>
77
<key>CFBundleDisplayName</key>
8-
<string>Signals</string>
8+
<string>Signals Sample</string>
99
<key>CFBundleExecutable</key>
1010
<string>$(EXECUTABLE_NAME)</string>
1111
<key>CFBundleIdentifier</key>
1212
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1313
<key>CFBundleInfoDictionaryVersion</key>
1414
<string>6.0</string>
1515
<key>CFBundleName</key>
16-
<string>signals</string>
16+
<string>signals_sample</string>
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>

signals/linux/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ project(runner LANGUAGES CXX)
44

55
# The name of the executable created for the application. Change this to change
66
# the on-disk name of your application.
7-
set(BINARY_NAME "signals")
7+
set(BINARY_NAME "signals_sample")
88
# The unique GTK application identifier for this application. See:
99
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
10-
set(APPLICATION_ID "com.example.signals")
10+
set(APPLICATION_ID "com.example.signals_sample")
1111

1212
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
1313
# versions of CMake.

signals/linux/runner/my_application.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ static void my_application_activate(GApplication* application) {
4646
if (use_header_bar) {
4747
GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
4848
gtk_widget_show(GTK_WIDGET(header_bar));
49-
gtk_header_bar_set_title(header_bar, "signals");
49+
gtk_header_bar_set_title(header_bar, "signals_sample");
5050
gtk_header_bar_set_show_close_button(header_bar, TRUE);
5151
gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
5252
} else {
53-
gtk_window_set_title(window, "signals");
53+
gtk_window_set_title(window, "signals_sample");
5454
}
5555

5656
gtk_window_set_default_size(window, 1280, 720);

0 commit comments

Comments
 (0)