Skip to content

Commit

Permalink
Merge pull request #332 from icapps/#331-one-setup-script
Browse files Browse the repository at this point in the history
#331 one setup script
  • Loading branch information
ikbendewilliam authored Oct 17, 2023
2 parents 38e30f8 + b30393a commit d3a85bb
Show file tree
Hide file tree
Showing 21 changed files with 38 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rename_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
- run: printf 'Test Project\ndescription\ntest_project\nTestProject\ncom.test.project\nn\ny\n' | fvm flutter pub run ./tool/setup/dart/rename_project.dart
2 changes: 1 addition & 1 deletion .github/workflows/strip_boilerplate_project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/github/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/github/test_coverage_filter.dart
- run: fvm dart run ./tool/github/test_coverage_validate_percentage.dart
- name: Coveralls
uses: coverallsapp/github-action@master
with:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 0 additions & 15 deletions tool/remove_template_setup_scripts.sh

This file was deleted.

3 changes: 0 additions & 3 deletions tool/rename_project.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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"
fvm dart run tool/setup/dart/android_keystore_generator.dart "release" "$alias" "$releasePassword"
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
8 changes: 8 additions & 0 deletions tool/setup/remove_setup_scripts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

echo "Removing github workflows"
rm -rf .github
rm -rf tool/github

echo "Removing setup scripts"
rm -rf tool/setup
3 changes: 3 additions & 0 deletions tool/setup/rename_project.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

fvm flutter pub run tool/setup/dart/rename_project.dart
13 changes: 13 additions & 0 deletions tool/setup/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

echo "Setup 1/4: Rename project"
tool/setup/rename_project.sh || exit -1

echo "Setup 2/4: Strip boilerplate project"
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 4/4: Removing setup scripts"
tool/setup/remove_setup_scripts.sh || exit -1
3 changes: 3 additions & 0 deletions tool/setup/strip_boilerplate_project.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

fvm flutter pub run tool/setup/dart/strip_boilerplate_project.dart
3 changes: 0 additions & 3 deletions tool/strip_boilerplate_project.sh

This file was deleted.

0 comments on commit d3a85bb

Please sign in to comment.