From 5048f44db7b06449de059e787fa4305ddec06849 Mon Sep 17 00:00:00 2001 From: Luca Van Zelst Date: Mon, 16 Oct 2023 13:49:33 +0200 Subject: [PATCH 1/5] clean-up setup scripts --- .../firebase/android_firebase_uploader.dart | 0 .../firebase/firebase_uploader.dart | 0 .../firebase/ios_firebase_uploader.dart | 0 .../{ => github}/test_coverage_create_helper.dart | 0 tool/{ => github}/test_coverage_filter.dart | 0 .../test_coverage_validate_percentage.dart | 0 tool/remove_template_setup_scripts.sh | 15 --------------- tool/rename_project.sh | 3 --- tool/{ => setup}/android_keystore_generator.sh | 0 .../dart}/android_keystore_generator.dart | 1 + .../{dart_tool => setup/dart}/rename_project.dart | 11 +---------- .../dart}/strip_boilerplate_project.dart | 1 + tool/setup/rename_project.sh | 3 +++ tool/setup/setup.sh | 15 +++++++++++++++ tool/setup/strip_boilerplate_project.sh | 3 +++ tool/strip_boilerplate_project.sh | 3 --- 16 files changed, 24 insertions(+), 31 deletions(-) rename tool/{dart_tool => }/firebase/android_firebase_uploader.dart (100%) rename tool/{dart_tool => }/firebase/firebase_uploader.dart (100%) rename tool/{dart_tool => }/firebase/ios_firebase_uploader.dart (100%) rename tool/{ => github}/test_coverage_create_helper.dart (100%) rename tool/{ => github}/test_coverage_filter.dart (100%) rename tool/{ => github}/test_coverage_validate_percentage.dart (100%) delete mode 100755 tool/remove_template_setup_scripts.sh delete mode 100755 tool/rename_project.sh rename tool/{ => setup}/android_keystore_generator.sh (100%) rename tool/{dart_tool => setup/dart}/android_keystore_generator.dart (99%) rename tool/{dart_tool => setup/dart}/rename_project.dart (97%) rename tool/{dart_tool => setup/dart}/strip_boilerplate_project.dart (99%) create mode 100755 tool/setup/rename_project.sh create mode 100644 tool/setup/setup.sh create mode 100755 tool/setup/strip_boilerplate_project.sh delete mode 100755 tool/strip_boilerplate_project.sh diff --git a/tool/dart_tool/firebase/android_firebase_uploader.dart b/tool/firebase/android_firebase_uploader.dart similarity index 100% rename from tool/dart_tool/firebase/android_firebase_uploader.dart rename to tool/firebase/android_firebase_uploader.dart diff --git a/tool/dart_tool/firebase/firebase_uploader.dart b/tool/firebase/firebase_uploader.dart similarity index 100% rename from tool/dart_tool/firebase/firebase_uploader.dart rename to tool/firebase/firebase_uploader.dart diff --git a/tool/dart_tool/firebase/ios_firebase_uploader.dart b/tool/firebase/ios_firebase_uploader.dart similarity index 100% rename from tool/dart_tool/firebase/ios_firebase_uploader.dart rename to tool/firebase/ios_firebase_uploader.dart diff --git a/tool/test_coverage_create_helper.dart b/tool/github/test_coverage_create_helper.dart similarity index 100% rename from tool/test_coverage_create_helper.dart rename to tool/github/test_coverage_create_helper.dart diff --git a/tool/test_coverage_filter.dart b/tool/github/test_coverage_filter.dart similarity index 100% rename from tool/test_coverage_filter.dart rename to tool/github/test_coverage_filter.dart diff --git a/tool/test_coverage_validate_percentage.dart b/tool/github/test_coverage_validate_percentage.dart similarity index 100% rename from tool/test_coverage_validate_percentage.dart rename to tool/github/test_coverage_validate_percentage.dart diff --git a/tool/remove_template_setup_scripts.sh b/tool/remove_template_setup_scripts.sh deleted file mode 100755 index 18fd921a..00000000 --- a/tool/remove_template_setup_scripts.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -echo "Remove github workflows" -rm -rf .github - -echo "Remove rename project scripts" -rm tool/rename_project.sh -rm tool/dart_tool/rename_project.dart - -echo "Remove strip boilerplate scripts" -rm tool/strip_boilerplate_project.sh -rm tool/dart_tool/strip_boilerplate_project.dart - -echo "Remove self" -rm tool/remove_template_setup_scripts.sh \ No newline at end of file diff --git a/tool/rename_project.sh b/tool/rename_project.sh deleted file mode 100755 index e09dde45..00000000 --- a/tool/rename_project.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -flutter pub run tool/dart_tool/rename_project.dart \ No newline at end of file diff --git a/tool/android_keystore_generator.sh b/tool/setup/android_keystore_generator.sh similarity index 100% rename from tool/android_keystore_generator.sh rename to tool/setup/android_keystore_generator.sh diff --git a/tool/dart_tool/android_keystore_generator.dart b/tool/setup/dart/android_keystore_generator.dart similarity index 99% rename from tool/dart_tool/android_keystore_generator.dart rename to tool/setup/dart/android_keystore_generator.dart index f9aacab0..e35d2b6f 100644 --- a/tool/dart_tool/android_keystore_generator.dart +++ b/tool/setup/dart/android_keystore_generator.dart @@ -39,5 +39,6 @@ class Logger { static void debug(Object value) => print(value); // ignore: avoid_print static void info(Object value) => print(value); // ignore: avoid_print + static void error(Object value) => print(value); // ignore: avoid_print } diff --git a/tool/dart_tool/rename_project.dart b/tool/setup/dart/rename_project.dart similarity index 97% rename from tool/dart_tool/rename_project.dart rename to tool/setup/dart/rename_project.dart index 81fe2ad2..cf1b5dfe 100644 --- a/tool/dart_tool/rename_project.dart +++ b/tool/setup/dart/rename_project.dart @@ -112,7 +112,6 @@ void _renameAndroidPackageName(String androidPackageName) { if (element.path.endsWith('.png')) return false; if (element.path.endsWith('.DS_Store')) return false; if (Directory(element.path).existsSync()) return false; - if (element.path.contains('.DS_Store')) return false; return true; }).forEach((element) { _replaceInFile(element.path, originalAndroidPackageName, androidPackageName); @@ -121,7 +120,6 @@ void _renameAndroidPackageName(String androidPackageName) { if (element.path.endsWith('.png')) return false; if (element.path.endsWith('.DS_Store')) return false; if (Directory(element.path).existsSync()) return false; - if (element.path.contains('.DS_Store')) return false; return true; }).forEach((element) { _renameKotlinFile(element.path, androidPackageName); @@ -131,7 +129,6 @@ void _renameAndroidPackageName(String androidPackageName) { if (element.path.endsWith('.png')) return false; if (element.path.endsWith('.DS_Store')) return false; if (Directory(element.path).existsSync()) return false; - if (element.path.contains('.DS_Store')) return false; return true; }).forEach((element) { _replaceInFile(element.path, originalAndroidPackageName, androidPackageName); @@ -142,7 +139,6 @@ void _renameAndroidPackageName(String androidPackageName) { if (element.path.endsWith('.png')) return false; if (element.path.endsWith('.DS_Store')) return false; if (Directory(element.path).existsSync()) return false; - if (element.path.contains('.DS_Store')) return false; return true; }).forEach((element) { _replaceInFile(element.path, originalAndroidPackageName, androidPackageName); @@ -186,7 +182,6 @@ void _renameiOSBundleIdentifier(String iosBundleIdentifier) { if (element.path.endsWith('.png')) return false; if (element.path.endsWith('.DS_Store')) return false; if (Directory(element.path).existsSync()) return false; - if (element.path.contains('.DS_Store')) return false; return true; }).forEach((element) { _replaceInFile(element.path, originalIOSBundleIdentifier, iosBundleIdentifier); @@ -197,7 +192,6 @@ void _renameiOSBundleIdentifier(String iosBundleIdentifier) { if (element.path.endsWith('.png')) return false; if (element.path.endsWith('.DS_Store')) return false; if (Directory(element.path).existsSync()) return false; - if (element.path.contains('.DS_Store')) return false; return true; }).forEach((element) { _replaceInFile(element.path, originalIOSBundleIdentifier, iosBundleIdentifier); @@ -220,7 +214,6 @@ void _renameAppName(String appName) { if (element.path.endsWith('.png')) return false; if (element.path.contains('.DS_Store')) return false; if (Directory(element.path).existsSync()) return false; - if (element.path.contains('.DS_Store')) return false; return true; }).forEach((element) { _replaceInFile(element.path, originalAppName, appName); @@ -260,7 +253,6 @@ void _renamePackage(String packageName, String description, String classNamePref if (element.path.endsWith('.png')) return false; if (element.path.contains('.DS_Store')) return false; if (Directory(element.path).existsSync()) return false; - if (element.path.contains('.DS_Store')) return false; return true; }).forEach((element) { _replaceInFile(element.path, originalProjectName, packageName); @@ -283,7 +275,6 @@ void _renameTools(String dartPackageName, String description, String classNamePr if (element.path.endsWith('.png')) return false; if (element.path.contains('.DS_Store')) return false; if (Directory(element.path).existsSync()) return false; - if (element.path.contains('.DS_Store')) return false; return true; }).forEach((element) { if (force == false && element.path == './tool/dart_tool/rename_project.dart') return; @@ -355,7 +346,6 @@ void _performFinalCheck() { if (element.path.endsWith('tool/dart_tool/rename_project.dart')) return false; if (element.path.endsWith('./ios/Flutter/App.framework/flutter_assets/NOTICES')) return false; if (Directory(element.path).existsSync()) return false; - if (element.path.contains('.DS_Store')) return false; return true; }).forEach((element) { if (element.path == './tool/dart_tool/rename_project.dart' || element.path == './tool/travis/rename_project.dart') { @@ -472,5 +462,6 @@ class Logger { static void debug(Object value) => print(value); // ignore: avoid_print static void info(Object value) => print(value); // ignore: avoid_print + static void error(Object value) => print(value); // ignore: avoid_print } diff --git a/tool/dart_tool/strip_boilerplate_project.dart b/tool/setup/dart/strip_boilerplate_project.dart similarity index 99% rename from tool/dart_tool/strip_boilerplate_project.dart rename to tool/setup/dart/strip_boilerplate_project.dart index 12efa94a..da8cd2a6 100644 --- a/tool/dart_tool/strip_boilerplate_project.dart +++ b/tool/setup/dart/strip_boilerplate_project.dart @@ -295,5 +295,6 @@ class Logger { static void debug(Object value) => print(value); // ignore: avoid_print static void info(Object value) => print(value); // ignore: avoid_print + static void error(Object value) => print(value); // ignore: avoid_print } diff --git a/tool/setup/rename_project.sh b/tool/setup/rename_project.sh new file mode 100755 index 00000000..1210268a --- /dev/null +++ b/tool/setup/rename_project.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +fvm flutter pub run tool/setup/dart/rename_project.dart \ No newline at end of file diff --git a/tool/setup/setup.sh b/tool/setup/setup.sh new file mode 100644 index 00000000..0e3c27be --- /dev/null +++ b/tool/setup/setup.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +fvm flutter pub run tool/setup/dart/rename_project.dart + +fvm flutter pub run tool/setup/dart/strip_boilerplate_project.dart + +fvm flutter pub run tool/setup/dart/android_keystore_generator.dart + +# Cleanup setup +echo "Remove github workflows" +rm -rf .github +rm -rf tool/github + +echo "Remove setup scripts" +rm -rf tool/setup \ No newline at end of file diff --git a/tool/setup/strip_boilerplate_project.sh b/tool/setup/strip_boilerplate_project.sh new file mode 100755 index 00000000..9701c0ea --- /dev/null +++ b/tool/setup/strip_boilerplate_project.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +fvm flutter pub run tool/setup/dart/strip_boilerplate_project.dart \ No newline at end of file diff --git a/tool/strip_boilerplate_project.sh b/tool/strip_boilerplate_project.sh deleted file mode 100755 index 4a4cb0bc..00000000 --- a/tool/strip_boilerplate_project.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -flutter pub run tool/dart_tool/strip_boilerplate_project.dart \ No newline at end of file From 7c0624a52b154cf22ac381a8648a0a4450603b6a Mon Sep 17 00:00:00 2001 From: Luca Van Zelst Date: Mon, 16 Oct 2023 14:42:41 +0200 Subject: [PATCH 2/5] updated sh scripts --- tool/setup/android_keystore_generator.sh | 4 ++-- tool/setup/setup.sh | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) mode change 100644 => 100755 tool/setup/setup.sh diff --git a/tool/setup/android_keystore_generator.sh b/tool/setup/android_keystore_generator.sh index c84aea5d..22a6c824 100755 --- a/tool/setup/android_keystore_generator.sh +++ b/tool/setup/android_keystore_generator.sh @@ -6,10 +6,10 @@ echo "Creating a debug keystore" debugKeystorePath="android/keystore/debug.keystore" debugPassword=$(uuidgen) keytool -genkey -keystore $debugKeystorePath -keyalg RSA -alias $alias -storepass "$debugPassword" -keypass "$debugPassword" -validity 365000 -dart run tool/dart_tool/android_keystore_generator.dart "debug" "$alias" "$debugPassword" +fvm dart run tool/setup/dart/android_keystore_generator.dart "debug" "$alias" "$debugPassword" echo "Creating a release keystore" releaseKeystorePath="android/keystore/release.keystore" releasePassword=$(uuidgen) keytool -genkey -keystore $releaseKeystorePath -keyalg RSA -alias $alias -storepass "$releasePassword" -keypass "$releasePassword" -validity 365000 -dart run tool/dart_tool/android_keystore_generator.dart "release" "$alias" "$releasePassword" \ No newline at end of file +fvm dart run tool/setup/dart/android_keystore_generator.dart "release" "$alias" "$releasePassword" \ No newline at end of file diff --git a/tool/setup/setup.sh b/tool/setup/setup.sh old mode 100644 new mode 100755 index 0e3c27be..20e4b30d --- a/tool/setup/setup.sh +++ b/tool/setup/setup.sh @@ -1,10 +1,13 @@ #!/bin/bash -fvm flutter pub run tool/setup/dart/rename_project.dart +echo "Setup 1/3: Rename project" +tool/setup/rename_project.sh || exit -1 -fvm flutter pub run tool/setup/dart/strip_boilerplate_project.dart +echo "Setup 2/3: Strip boilerplate project" +tool/setup/strip_boilerplate_project.sh || exit -1 -fvm flutter pub run tool/setup/dart/android_keystore_generator.dart +echo "Setup 3/3: Android keystore generator" +tool/setup/android_keystore_generator.sh || exit -1 # Cleanup setup echo "Remove github workflows" From e3c28b7bb202767ece8263ccc39ae7e75ba76867 Mon Sep 17 00:00:00 2001 From: Luca Van Zelst Date: Tue, 17 Oct 2023 09:44:07 +0200 Subject: [PATCH 3/5] Updated test.yml --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7f0e82d7..3470c52b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,10 +16,10 @@ jobs: channel: 'stable' - run: ./tool/install_fvm.sh - run: fvm flutter packages get - - run: dart run ./tool/test_coverage_create_helper.dart + - run: fvm dart run ./tool/test_coverage_create_helper.dart - run: fvm flutter test --coverage - - run: dart run ./tool/test_coverage_filter.dart - - run: dart run ./tool/test_coverage_validate_percentage.dart + - run: fvm dart run ./tool/test_coverage_filter.dart + - run: fvm dart run ./tool/test_coverage_validate_percentage.dart - name: Coveralls uses: coverallsapp/github-action@master with: From fc23baf606023cb357f1eac2e248823ccedc850a Mon Sep 17 00:00:00 2001 From: Luca Van Zelst Date: Tue, 17 Oct 2023 10:13:48 +0200 Subject: [PATCH 4/5] Updated typo --- tool/setup/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/setup/setup.sh b/tool/setup/setup.sh index 4ae9a2b1..6eccaeff 100755 --- a/tool/setup/setup.sh +++ b/tool/setup/setup.sh @@ -9,5 +9,5 @@ tool/setup/strip_boilerplate_project.sh || exit -1 echo "Setup 3/4: Android keystore generator" tool/setup/android_keystore_generator.sh || exit -1 -echo "Setup 3/4: Removing setup scripts" +echo "Setup 4/4: Removing setup scripts" tool/setup/remove_setup_scripts.sh || exit -1 \ No newline at end of file From b30393a935d2d4d66df46c1b91b64f2ec0c63df4 Mon Sep 17 00:00:00 2001 From: Luca Van Zelst Date: Tue, 17 Oct 2023 10:35:59 +0200 Subject: [PATCH 5/5] Fixed paths --- .github/workflows/rename_project.yml | 2 +- .github/workflows/strip_boilerplate_project.yaml | 2 +- .../workflows/strip_boilerplate_project_remove_tests.yaml | 2 +- .github/workflows/test.yml | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rename_project.yml b/.github/workflows/rename_project.yml index b261808e..92488081 100644 --- a/.github/workflows/rename_project.yml +++ b/.github/workflows/rename_project.yml @@ -16,4 +16,4 @@ jobs: channel: 'stable' - run: ./tool/install_fvm.sh - run: fvm flutter packages get - - run: printf 'Test Project\ndescription\ntest_project\nTestProject\ncom.test.project\nn\ny\n' | fvm flutter pub run ./tool/dart_tool/rename_project.dart \ No newline at end of file + - run: printf 'Test Project\ndescription\ntest_project\nTestProject\ncom.test.project\nn\ny\n' | fvm flutter pub run ./tool/setup/dart/rename_project.dart \ No newline at end of file diff --git a/.github/workflows/strip_boilerplate_project.yaml b/.github/workflows/strip_boilerplate_project.yaml index 21f5baef..680dbc37 100644 --- a/.github/workflows/strip_boilerplate_project.yaml +++ b/.github/workflows/strip_boilerplate_project.yaml @@ -16,7 +16,7 @@ jobs: channel: 'stable' - run: ./tool/install_fvm.sh - run: fvm flutter packages get - - run: printf 'yes\n' | fvm flutter pub run ./tool/dart_tool/strip_boilerplate_project.dart + - run: printf 'yes\n' | fvm flutter pub run ./tool/setup/dart/strip_boilerplate_project.dart - run: fvm flutter analyze - run: fvm flutter test --update-goldens test/screen/home/home_screen_test.dart - run: fvm flutter test diff --git a/.github/workflows/strip_boilerplate_project_remove_tests.yaml b/.github/workflows/strip_boilerplate_project_remove_tests.yaml index 7bb55685..ea6c79b0 100644 --- a/.github/workflows/strip_boilerplate_project_remove_tests.yaml +++ b/.github/workflows/strip_boilerplate_project_remove_tests.yaml @@ -16,5 +16,5 @@ jobs: channel: 'stable' - run: ./tool/install_fvm.sh - run: fvm flutter packages get - - run: printf 'no\n' | fvm flutter pub run ./tool/dart_tool/strip_boilerplate_project.dart + - run: printf 'no\n' | fvm flutter pub run ./tool/setup/dart/strip_boilerplate_project.dart - run: fvm flutter analyze diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3470c52b..28c0a263 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,10 +16,10 @@ jobs: channel: 'stable' - run: ./tool/install_fvm.sh - run: fvm flutter packages get - - run: fvm dart run ./tool/test_coverage_create_helper.dart + - run: fvm dart run ./tool/github/test_coverage_create_helper.dart - run: fvm flutter test --coverage - - run: fvm dart run ./tool/test_coverage_filter.dart - - run: fvm dart run ./tool/test_coverage_validate_percentage.dart + - run: fvm dart run ./tool/github/test_coverage_filter.dart + - run: fvm dart run ./tool/github/test_coverage_validate_percentage.dart - name: Coveralls uses: coverallsapp/github-action@master with: