From ec80f6ba1fcec4bb93e27057d9a1196617ba9dc6 Mon Sep 17 00:00:00 2001 From: MiT Date: Mon, 12 Jun 2023 13:42:49 +0400 Subject: [PATCH] Update dart & deps --- CHANGELOG.md | 6 + example/pubspec.lock | 143 +++++++++------- example/pubspec.yaml | 4 +- lib/src/models/config.dart | 20 +-- lib/src/models/required_change.dart | 6 +- .../utils/change_android_package_name.dart | 6 +- lib/src/utils/get_config.dart | 13 +- pubspec.lock | 153 +++++------------- pubspec.yaml | 51 +----- 9 files changed, 160 insertions(+), 242 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be98029..1bf981f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,3 +22,9 @@ * update dependencies * support UpperCase package name + +## [1.2.0] - 12/06/2023 + +* add support Dart v3 +* remove Flutter from dependencies +* update dependencies \ No newline at end of file diff --git a/example/pubspec.lock b/example/pubspec.lock index 4256990..e653ab3 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,72 +5,82 @@ packages: dependency: transitive description: name: ansicolor - url: "https://pub.flutter-io.cn" + sha256: "607f8fa9786f392043f169898923e6c59b4518242b68b8862eb8a8b7d9c30b4a" + url: "https://pub.dev" source: hosted version: "2.0.1" args: dependency: transitive description: name: args - url: "https://pub.flutter-io.cn" + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.4.2" async: dependency: transitive description: name: async - url: "https://pub.flutter-io.cn" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.8.1" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.flutter-io.cn" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.flutter-io.cn" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.3.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.flutter-io.cn" + sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 + url: "https://pub.dev" source: hosted version: "1.3.1" clock: dependency: transitive description: name: clock - url: "https://pub.flutter-io.cn" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.flutter-io.cn" + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.17.1" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.flutter-io.cn" + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + url: "https://pub.dev" source: hosted - version: "0.1.3" + version: "1.0.5" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.flutter-io.cn" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.1" flutter: dependency: "direct main" description: flutter @@ -82,47 +92,68 @@ packages: path: ".." relative: true source: path - version: "1.1.0" + version: "1.2.0" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" matcher: dependency: transitive description: name: matcher - url: "https://pub.flutter-io.cn" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" + source: hosted + version: "0.12.15" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "0.12.10" + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.flutter-io.cn" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.9.1" path: dependency: transitive description: name: path - url: "https://pub.flutter-io.cn" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.8.3" process_run: dependency: transitive description: name: process_run - url: "https://pub.flutter-io.cn" + sha256: "0071cece7ca0fdf4aaf2cf84ee3082f3043f18afc7fcfd51f53f9424a8072c04" + url: "https://pub.dev" source: hosted - version: "0.12.2+2" + version: "0.13.0" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.flutter-io.cn" + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.4" sky_engine: dependency: transitive description: flutter @@ -132,71 +163,73 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.flutter-io.cn" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.flutter-io.cn" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.flutter-io.cn" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.flutter-io.cn" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" synchronized: dependency: transitive description: name: synchronized - url: "https://pub.flutter-io.cn" + sha256: "5fcbd27688af6082f5abd611af56ee575342c30e87541d0245f7ff99faa02c60" + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.1.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.flutter-io.cn" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.flutter-io.cn" + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" source: hosted - version: "0.4.2" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.3.0" + version: "0.5.1" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.flutter-io.cn" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.4" yaml: dependency: transitive description: name: yaml - url: "https://pub.flutter-io.cn" + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.2" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=3.0.0 <4.0.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index fb258ef..28143ad 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -14,7 +14,7 @@ description: A new Flutter application. version: 1.0.0+1 environment: - sdk: ">=2.1.0 <3.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: flutter: @@ -22,7 +22,7 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^0.1.2 + cupertino_icons: ^1.0.5 dev_dependencies: flutter_test: diff --git a/lib/src/models/config.dart b/lib/src/models/config.dart index 0483ccf..c62568f 100644 --- a/lib/src/models/config.dart +++ b/lib/src/models/config.dart @@ -22,15 +22,15 @@ class Config { final String newAndroidPackageName; Config({ - this.oldApplicationId, - this.newApplicationId, - this.oldBundleId, - this.newBundleId, - this.newAppName, - this.oldAppName, - this.oldDartPackageName, - this.newDartPackageName, - this.oldAndroidPackageName, - this.newAndroidPackageName, + required this.oldApplicationId, + required this.newApplicationId, + required this.oldBundleId, + required this.newBundleId, + required this.newAppName, + required this.oldAppName, + required this.oldDartPackageName, + required this.newDartPackageName, + required this.oldAndroidPackageName, + required this.newAndroidPackageName, }); } diff --git a/lib/src/models/required_change.dart b/lib/src/models/required_change.dart index b0c9ea7..ed7bbe8 100644 --- a/lib/src/models/required_change.dart +++ b/lib/src/models/required_change.dart @@ -12,9 +12,9 @@ class RequiredChange { final bool needChanges; RequiredChange({ - this.regexp, - this.replacement, - this.paths, + required this.regexp, + required this.replacement, + required this.paths, this.isDirectory = false, this.needChanges = true, }); diff --git a/lib/src/utils/change_android_package_name.dart b/lib/src/utils/change_android_package_name.dart index ffaae55..a5c6b1b 100644 --- a/lib/src/utils/change_android_package_name.dart +++ b/lib/src/utils/change_android_package_name.dart @@ -30,13 +30,13 @@ changeAndroidPackageName(Config config) async { final File file = await fileSystemEntity.copy("${newAndroidDirectory.path}/$fileName"); file.createSync(recursive: true); } catch (error) { - Logger.error(error); + Logger.error(error.toString()); } } }); /// Deleting all inside old Android package - final Directory directoryToDelete = _getFirstDifferentDirectory( + final Directory? directoryToDelete = _getFirstDifferentDirectory( workingDirectory.path, oldPackageNameParts, newPackageNameParts, @@ -59,7 +59,7 @@ Future _getDirectory(List oldPackageNameParts) async { /// Get the first directory that is different /// between old and new android package name -Directory _getFirstDifferentDirectory( +Directory? _getFirstDifferentDirectory( String workingDirectoryPath, List oldPackageParts, List newPackageParts, diff --git a/lib/src/utils/get_config.dart b/lib/src/utils/get_config.dart index 8e97392..d312d58 100644 --- a/lib/src/utils/get_config.dart +++ b/lib/src/utils/get_config.dart @@ -42,19 +42,19 @@ Future getConfig() async { dartPackageName = settings[YamlArguments.dartPackageName]; } - final String oldBundleId = await _loadBundleId() ?? ""; + final String oldBundleId = await _loadBundleId(); String newBundleId = oldBundleId; if (settings.containsKey(YamlArguments.bundleId)) { newBundleId = settings[YamlArguments.bundleId]; } - final String oldApplicationId = await _loadAndroidApplicationId() ?? ""; + final String oldApplicationId = await _loadAndroidApplicationId(); String newApplicationId = oldApplicationId; if (settings.containsKey(YamlArguments.applicationId)) { newApplicationId = settings[YamlArguments.applicationId]; } - final String oldAndroidPackageName = await _loadAndroidPackageName() ?? ""; + final String oldAndroidPackageName = await _loadAndroidPackageName(); String newAndroidPackageName = oldAndroidPackageName; if (settings.containsKey(YamlArguments.androidPackageName)) { newAndroidPackageName = settings[YamlArguments.androidPackageName]; @@ -139,11 +139,12 @@ Future _loadBundleId() async { } } -Future searchInFile({String filePath, String pattern}) async { +Future searchInFile( + {required String filePath, required String pattern}) async { final File file = File(filePath); final String fileContent = file.readAsStringSync(); final RegExp regExp = RegExp(pattern); - final RegExpMatch match = regExp.firstMatch(fileContent); - return match.group(1); + final RegExpMatch? match = regExp.firstMatch(fileContent); + return match?.group(1) ?? ""; } diff --git a/pubspec.lock b/pubspec.lock index ac570e0..54693e9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,184 +5,105 @@ packages: dependency: "direct main" description: name: ansicolor - url: "https://pub.flutter-io.cn" + sha256: "607f8fa9786f392043f169898923e6c59b4518242b68b8862eb8a8b7d9c30b4a" + url: "https://pub.dev" source: hosted version: "2.0.1" args: dependency: transitive description: name: args - url: "https://pub.flutter-io.cn" + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" source: hosted - version: "2.3.0" - async: - dependency: transitive - description: - name: async - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.8.1" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.1.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.1.0" + version: "2.4.2" charcode: dependency: transitive description: name: charcode - url: "https://pub.flutter-io.cn" + sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 + url: "https://pub.dev" source: hosted version: "1.3.1" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.1.0" collection: dependency: transitive description: name: collection - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.15.0" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.2.0" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.flutter-io.cn" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + url: "https://pub.dev" source: hosted - version: "0.12.10" + version: "1.17.2" meta: dependency: transitive description: name: meta - url: "https://pub.flutter-io.cn" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.9.1" path: dependency: transitive description: name: path - url: "https://pub.flutter-io.cn" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.8.3" process_run: dependency: "direct main" description: name: process_run - url: "https://pub.flutter-io.cn" + sha256: "0071cece7ca0fdf4aaf2cf84ee3082f3043f18afc7fcfd51f53f9424a8072c04" + url: "https://pub.dev" source: hosted - version: "0.12.2+2" + version: "0.13.0" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.flutter-io.cn" + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" source: hosted - version: "2.1.0" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" + version: "2.1.4" source_span: dependency: transitive description: name: source_span - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.8.1" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.flutter-io.cn" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted version: "1.10.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.flutter-io.cn" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" synchronized: dependency: transitive description: name: synchronized - url: "https://pub.flutter-io.cn" + sha256: "5fcbd27688af6082f5abd611af56ee575342c30e87541d0245f7ff99faa02c60" + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.1.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.2.0" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.4.2" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.flutter-io.cn" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.3.0" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.1.0" + version: "1.2.1" yaml: dependency: "direct main" description: name: yaml - url: "https://pub.flutter-io.cn" + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.2" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=3.0.0 <4.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index fc727fb..302bb80 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,55 +1,12 @@ name: flutter_rename_app_plus description: A package that enable to rename an entire app and ids in one command. -version: 1.1.0 +version: 1.2.0 homepage: https://github.com/flutter-fast-kit/flutter_rename_app_plus environment: - sdk: ">=2.1.0 <3.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: - flutter: - sdk: flutter - yaml: ^3.1.0 - process_run: ^0.12.2 + yaml: ^3.1.2 + process_run: ^0.13.0 ansicolor: ^2.0.1 - -dev_dependencies: - flutter_test: - sdk: flutter - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter. -flutter: - - # To add assets to your package, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # - # For details regarding assets in packages, see - # https://flutter.dev/assets-and-images/#from-packages - # - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware. - - # To add custom fonts to your package, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts in packages, see - # https://flutter.dev/custom-fonts/#from-packages