diff --git a/analysis_options.yaml b/analysis_options.yaml index ad2b29d6..9cc472ea 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,59 +1,26 @@ +include: package:lints/recommended.yaml + linter: rules: - ## Error Rules - - always_use_package_imports - # - avoid_dynamic_calls - - avoid_empty_else - # - avoid_print - - avoid_relative_lib_imports - # - avoid_returning_null_for_future - # - avoid_slow_async_io - # - avoid_type_to_string - - avoid_types_as_parameter_names - # - avoid_web_libraries_in_flutter - # - cancel_subscriptions - # - close_sinks - # - collection_methods_unrelated_type - # - comment_references - - control_flow_in_finally - # - diagnostic_describe_all_properties - # - discarded_futures - - empty_statements - - hash_and_equals - # - invariant_booleans - - iterable_contains_unrelated_type - - list_remove_unrelated_type - # - literal_only_boolean_expressions - # - no_adjacent_strings_in_list - - no_duplicate_case_values - # - no_logic_in_create_state - # - prefer_relative_imports - - prefer_void_to_null - # - test_types_in_equals - # - throw_in_finally - # - unnecessary_statements - - unrelated_type_equality_checks - # - unsafe_html - # - use_build_context_synchronously - # - use_key_in_widget_constructors - - valid_regexps - ## Style rules # - always_declare_return_types # - always_put_control_body_on_new_line # - always_put_required_named_parameters_first # - always_specify_types + - always_use_package_imports - annotate_overrides + # - annotate_redeclares # - avoid_annotating_with_dynamic - # - avoid_as # - avoid_bool_literals_in_conditional_expressions # - avoid_catches_without_on_clauses # - avoid_catching_errors # - avoid_classes_with_only_static_members # - avoid_double_and_int_checks + # - avoid_dynamic_calls + - avoid_empty_else # - avoid_equals_and_hash_code_on_mutable_classes # - avoid_escaping_inner_quotes # - avoid_field_initializers_in_const_classes - # - avoid_final_parameters + - avoid_final_parameters - avoid_function_literals_in_foreach_calls # - avoid_implementing_value_types - avoid_init_to_null @@ -61,42 +28,59 @@ linter: # - avoid_multiple_declarations_per_line - avoid_null_checks_in_equality_operators # - avoid_positional_boolean_parameters + # - avoid_print # - avoid_private_typedef_functions # - avoid_redundant_argument_values + - avoid_relative_lib_imports - avoid_renaming_method_parameters - avoid_return_types_on_setters - # - avoid_returning_null - avoid_returning_null_for_void # - avoid_returning_this # - avoid_setters_without_getters - avoid_shadowing_type_parameters - avoid_single_cascade_in_expression_statements + # - avoid_slow_async_io + # - avoid_type_to_string + - avoid_types_as_parameter_names # - avoid_types_on_closure_parameters - # - avoid_unnecessary_containers + - avoid_unnecessary_containers # - avoid_unused_constructor_parameters - # - avoid_void_async + - avoid_void_async + - avoid_web_libraries_in_flutter - await_only_futures - camel_case_extensions - camel_case_types + # - cancel_subscriptions # - cascade_invocations # - cast_nullable_to_non_nullable - # - combinators_ordering + # - close_sinks + # - collection_methods_unrelated_type + - combinators_ordering + # - comment_references # - conditional_uri_does_not_exist # - constant_identifier_names + - control_flow_in_finally - curly_braces_in_flow_control_structures # - dangling_library_doc_comments + - depend_on_referenced_packages # - deprecated_consistency + # - deprecated_member_use_from_same_package + # - diagnostic_describe_all_properties - directives_ordering + # - discarded_futures # - do_not_use_environment - empty_catches - empty_constructor_bodies - # - enable_null_safety + - empty_statements - eol_at_end_of_file - exhaustive_cases - file_names - flutter_style_todos + - hash_and_equals - implementation_imports # - implicit_call_tearoffs + # - implicit_reopen + # - invalid_case_patterns # - join_return_with_assignment # - leading_newlines_in_multiline_strings # - library_annotations @@ -104,11 +88,20 @@ linter: - library_prefixes - library_private_types_in_public_api # - lines_longer_than_80_chars + # - literal_only_boolean_expressions + # - matching_super_parameters + # - missing_code_block_language_in_doc_comment # - missing_whitespace_between_adjacent_strings + # - no_adjacent_strings_in_list # - no_default_cases + - no_duplicate_case_values - no_leading_underscores_for_library_prefixes - no_leading_underscores_for_local_identifiers + # - no_literal_bool_comparisons + - no_logic_in_create_state # - no_runtimeType_toString + # - no_self_assignments + # - no_wildcard_variable_uses - non_constant_identifier_names # - noop_primitive_operations - null_check_on_nullable_type_parameter @@ -118,18 +111,18 @@ linter: # - only_throw_errors - overridden_fields # - package_api_docs + - package_names - package_prefixed_library_names # - parameter_assignments - prefer_adjacent_string_concatenation # - prefer_asserts_in_initializer_lists # - prefer_asserts_with_message - # - prefer_bool_in_asserts - prefer_collection_literals - prefer_conditional_assignment - # - prefer_const_constructors - # - prefer_const_constructors_in_immutables - # - prefer_const_declarations - # - prefer_const_literals_to_create_immutables + - prefer_const_constructors + - prefer_const_constructors_in_immutables + - prefer_const_declarations + - prefer_const_literals_to_create_immutables # - prefer_constructors_over_static_methods - prefer_contains # - prefer_double_quotes @@ -155,24 +148,31 @@ linter: # - prefer_mixin - prefer_null_aware_method_calls - prefer_null_aware_operators + # - prefer_relative_imports - prefer_single_quotes - prefer_spread_collections - prefer_typing_uninitialized_variables + - prefer_void_to_null - provide_deprecation_message # - public_member_api_docs - recursive_getters - # - require_trailing_commas - # - sized_box_for_whitespace + - require_trailing_commas + # - secure_pubspec_urls + - sized_box_for_whitespace # - sized_box_shrink_expand - slash_for_doc_comments - # - sort_child_properties_last + - sort_child_properties_last - sort_constructors_first + - sort_pub_dependencies - sort_unnamed_constructors_first - # - super_goes_last + # - test_types_in_equals + # - throw_in_finally # - tighten_type_of_initializing_formals # - type_annotate_public_apis - type_init_formals + # - type_literal_in_constant_pattern # - unawaited_futures + # - unintended_html_in_doc_comment # - unnecessary_await_in_return - unnecessary_brace_in_string_interps # - unnecessary_breaks @@ -183,6 +183,7 @@ linter: # - unnecessary_lambdas - unnecessary_late # - unnecessary_library_directive + # - unnecessary_library_name - unnecessary_new - unnecessary_null_aware_assignments # - unnecessary_null_aware_operator_on_extension_on_nullable @@ -192,18 +193,23 @@ linter: - unnecessary_overrides # - unnecessary_parenthesis # - unnecessary_raw_strings + # - unnecessary_statements - unnecessary_string_escapes - unnecessary_string_interpolations - unnecessary_this # - unnecessary_to_list_in_spreads # - unreachable_from_main - # - use_colored_box - # - use_decorated_box + - unrelated_type_equality_checks + # - unsafe_html + - use_build_context_synchronously + - use_colored_box + - use_decorated_box # - use_enums - # - use_full_hex_values_for_flutter_colors + - use_full_hex_values_for_flutter_colors - use_function_type_syntax_for_parameters # - use_if_null_to_convert_nulls_to_bools # - use_is_even_rather_than_modulo + - use_key_in_widget_constructors # - use_late_for_private_fields_and_variables # - use_named_constants # - use_raw_strings @@ -214,9 +220,5 @@ linter: # - use_super_parameters # - use_test_throws_matchers # - use_to_and_as_if_applicable - - void_checks - ## Pub rules - - depend_on_referenced_packages - - package_names - # - secure_pubspec_urls - - sort_pub_dependencies + - valid_regexps + # - void_checks diff --git a/examples/hello_world/pubspec.lock b/examples/hello_world/pubspec.lock index 558efb43..32c7eeda 100644 --- a/examples/hello_world/pubspec.lock +++ b/examples/hello_world/pubspec.lock @@ -75,30 +75,6 @@ packages: description: flutter source: sdk version: "0.0.0" - leak_tracker: - dependency: transitive - description: - name: leak_tracker - sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" - url: "https://pub.dev" - source: hosted - version: "10.0.0" - leak_tracker_flutter_testing: - dependency: transitive - description: - name: leak_tracker_flutter_testing - sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 - url: "https://pub.dev" - source: hosted - version: "2.0.1" - leak_tracker_testing: - dependency: transitive - description: - name: leak_tracker_testing - sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 - url: "https://pub.dev" - source: hosted - version: "2.0.1" lints: dependency: transitive description: @@ -111,34 +87,34 @@ packages: dependency: transitive description: name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.16+1" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.5.0" meta: dependency: transitive description: name: meta - sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.10.0" path: dependency: transitive description: name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.8.3" sky_engine: dependency: transitive description: flutter @@ -200,13 +176,13 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" - vm_service: + web: dependency: transitive description: - name: vm_service - sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + name: web + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "13.0.0" + version: "0.3.0" sdks: - dart: ">=3.2.0-0 <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" diff --git a/packages/app_package_maker/.gitignore b/packages/app_package_maker/.gitignore deleted file mode 100644 index 227ea1b7..00000000 --- a/packages/app_package_maker/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.dart_tool/ -.packages -build/ -pubspec.lock # Except for application packages \ No newline at end of file diff --git a/packages/app_package_maker/CHANGELOG.md b/packages/app_package_maker/CHANGELOG.md deleted file mode 100644 index adbc4143..00000000 --- a/packages/app_package_maker/CHANGELOG.md +++ /dev/null @@ -1,43 +0,0 @@ -## 0.3.6 - -* bump `shell_executor` to 0.1.5 - -## 0.3.5 - -* `MakeConfig` adds `appBinaryName` field. -* Add `MakeLinuxPackageConfig` class. - -## 0.3.4 - -* bump `shell_executor` to 0.1.4 - -## 0.3.2 - -* Update dart sdk version to ">=2.16.0 <4.0.0" - -## 0.3.1 - -* `MakeConfig` adds `outputArtifacts` field. -* `MakeResult` adds `artifacts` field. -* Bump `shell_executor` to 0.1.2. - -## 0.3.0 - -* **FEAT**: apk & app maker support profile mode. - -## 0.2.5 - -* Remove `onProcessStdOut` and `onProcessStdErr` params - -## 0.2.3 - -* Downgrade pubspec_parse to 1.1.0 - -## 0.2.1 - -* Support custom `artifact_name` & `channel`. -* `artifactName` adds `build_name` & `build_number` variables #66 - -## 0.1.0 - -* First release. diff --git a/packages/app_package_maker/LICENSE b/packages/app_package_maker/LICENSE deleted file mode 100644 index dd339b1f..00000000 --- a/packages/app_package_maker/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021-present LiJianying - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/packages/app_package_maker/README.md b/packages/app_package_maker/README.md deleted file mode 100644 index 258604f1..00000000 --- a/packages/app_package_maker/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# app_package_maker - -[![pub version][pub-image]][pub-url] - -[pub-image]: https://img.shields.io/pub/v/app_package_maker.svg -[pub-url]: https://pub.dev/packages/app_package_maker - ---- - -Part of [flutter_distributor](https://github.com/leanflutter/flutter_distributor), See also https://distributor.leanflutter.dev diff --git a/packages/app_package_maker/lib/app_package_maker.dart b/packages/app_package_maker/lib/app_package_maker.dart deleted file mode 100644 index cbba6fe9..00000000 --- a/packages/app_package_maker/lib/app_package_maker.dart +++ /dev/null @@ -1,6 +0,0 @@ -library app_package_maker; - -export 'src/app_package_maker.dart'; -export 'src/make_config.dart'; -export 'src/make_error.dart'; -export 'src/make_result.dart'; diff --git a/packages/app_package_maker/pubspec.lock b/packages/app_package_maker/pubspec.lock deleted file mode 100644 index 9467f264..00000000 --- a/packages/app_package_maker/pubspec.lock +++ /dev/null @@ -1,180 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - args: - dependency: transitive - description: - name: args - sha256: c372bb384f273f0c2a8aaaa226dad84dc27c8519a691b888725dec59518ad53a - url: "https://pub.dev" - source: hosted - version: "2.4.1" - async: - dependency: transitive - description: - name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" - url: "https://pub.dev" - source: hosted - version: "2.11.0" - build_config: - dependency: transitive - description: - name: build_config - sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 - url: "https://pub.dev" - source: hosted - version: "1.1.1" - checked_yaml: - dependency: transitive - description: - name: checked_yaml - sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff - url: "https://pub.dev" - source: hosted - version: "2.0.3" - collection: - dependency: transitive - description: - name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 - url: "https://pub.dev" - source: hosted - version: "1.17.2" - dependency_validator: - dependency: "direct dev" - description: - name: dependency_validator - sha256: "08349175533ed0bd06eb9b6043cde66c45b2bfc7ebc222a7542cdb1324f1bf03" - url: "https://pub.dev" - source: hosted - version: "3.2.2" - file: - dependency: transitive - description: - name: file - sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" - url: "https://pub.dev" - source: hosted - version: "7.0.0" - glob: - dependency: transitive - description: - name: glob - sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" - url: "https://pub.dev" - source: hosted - version: "2.1.2" - io: - dependency: transitive - description: - name: io - sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" - url: "https://pub.dev" - source: hosted - version: "1.0.4" - json_annotation: - dependency: transitive - description: - name: json_annotation - sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 - url: "https://pub.dev" - source: hosted - version: "4.8.1" - logging: - dependency: transitive - description: - name: logging - sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - meta: - dependency: transitive - description: - name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" - url: "https://pub.dev" - source: hosted - version: "1.9.1" - mustache_template: - dependency: "direct main" - description: - name: mustache_template - sha256: a46e26f91445bfb0b60519be280555b06792460b27b19e2b19ad5b9740df5d1c - url: "https://pub.dev" - source: hosted - version: "2.0.0" - package_config: - dependency: transitive - description: - name: package_config - sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - path: - dependency: transitive - description: - name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" - url: "https://pub.dev" - source: hosted - version: "1.8.3" - pub_semver: - dependency: "direct main" - description: - name: pub_semver - sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - pubspec_parse: - dependency: "direct main" - description: - name: pubspec_parse - sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 - url: "https://pub.dev" - source: hosted - version: "1.2.3" - shell_executor: - dependency: "direct main" - description: - path: "../shell_executor" - relative: true - source: path - version: "0.1.6" - source_span: - dependency: transitive - description: - name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" - url: "https://pub.dev" - source: hosted - version: "1.10.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" - source: hosted - version: "1.2.1" - yaml: - dependency: "direct main" - description: - name: yaml - sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" - url: "https://pub.dev" - source: hosted - version: "3.1.2" -sdks: - dart: ">=3.0.0 <4.0.0" diff --git a/packages/app_package_maker/pubspec.yaml b/packages/app_package_maker/pubspec.yaml deleted file mode 100644 index 22724415..00000000 --- a/packages/app_package_maker/pubspec.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: app_package_maker -description: App package maker -version: 0.3.6 -homepage: https://distributor.leanflutter.dev -repository: https://github.com/leanflutter/flutter_distributor/tree/main/packages/app_package_maker - -environment: - sdk: ">=2.16.0 <4.0.0" - -dependencies: - mustache_template: ^2.0.0 - pub_semver: ^2.1.0 - pubspec_parse: ^1.1.0 - shell_executor: ^0.1.5 - yaml: ^3.1.0 - -dev_dependencies: - dependency_validator: ^3.0.0 diff --git a/packages/flutter_app_builder/test/src/builders/windows/build_windows_result_test.dart b/packages/flutter_app_builder/test/src/builders/windows/build_windows_result_test.dart index 6a1b7fe9..4a015c59 100644 --- a/packages/flutter_app_builder/test/src/builders/windows/build_windows_result_test.dart +++ b/packages/flutter_app_builder/test/src/builders/windows/build_windows_result_test.dart @@ -11,7 +11,7 @@ void main() { arguments: {'profile': true}, ), ); - r.flutterVersion = FlutterVersion(flutterVersion: '3.16.0'); + r.flutterVersion = const FlutterVersion(flutterVersion: '3.16.0'); expect(r.outputDirectory.path, 'build/windows/x64/runner/Profile'); }); test('profile mode (less 3.15.0)', () { @@ -20,21 +20,21 @@ void main() { arguments: {'profile': true}, ), ); - r.flutterVersion = FlutterVersion(flutterVersion: '3.10.0'); + r.flutterVersion = const FlutterVersion(flutterVersion: '3.10.0'); expect(r.outputDirectory.path, 'build/windows/runner/Profile'); }); test('release mode', () { final r = BuildWindowsResult( BuildConfig(), ); - r.flutterVersion = FlutterVersion(flutterVersion: '3.16.0'); + r.flutterVersion = const FlutterVersion(flutterVersion: '3.16.0'); expect(r.outputDirectory.path, 'build/windows/x64/runner/Release'); }); test('release mode (less 3.15.0)', () { final r = BuildWindowsResult( BuildConfig(), ); - r.flutterVersion = FlutterVersion(flutterVersion: '3.10.0'); + r.flutterVersion = const FlutterVersion(flutterVersion: '3.10.0'); expect(r.outputDirectory.path, 'build/windows/runner/Release'); }); }); diff --git a/packages/flutter_app_builder/test/src/commands/flutter_test.dart b/packages/flutter_app_builder/test/src/commands/flutter_test.dart index b6310bd0..1cd70630 100644 --- a/packages/flutter_app_builder/test/src/commands/flutter_test.dart +++ b/packages/flutter_app_builder/test/src/commands/flutter_test.dart @@ -4,7 +4,7 @@ import 'package:test/test.dart'; void main() { group('FlutterVersion', () { test('isGreaterOrEqual#1', () { - final v3100 = FlutterVersion( + const v3100 = FlutterVersion( flutterVersion: '3.10.0', ); expect(v3100.isGreaterOrEqual('3.3.10'), true); @@ -12,7 +12,7 @@ void main() { expect(v3100.isGreaterOrEqual('3.10.1'), false); }); test('isGreaterOrEqual#2', () { - final v3150 = FlutterVersion( + const v3150 = FlutterVersion( flutterVersion: '3.15.0-15.2.pre', ); expect(v3150.isGreaterOrEqual('3.3.10'), true); diff --git a/packages/flutter_app_packager/lib/flutter_app_packager.dart b/packages/flutter_app_packager/lib/flutter_app_packager.dart index 1b18f506..21146f9a 100644 --- a/packages/flutter_app_packager/lib/flutter_app_packager.dart +++ b/packages/flutter_app_packager/lib/flutter_app_packager.dart @@ -1,3 +1,7 @@ library flutter_app_packager; +export 'src/api/app_package_maker.dart'; +export 'src/api/make_config.dart'; +export 'src/api/make_error.dart'; +export 'src/api/make_result.dart'; export 'src/flutter_app_packager.dart'; diff --git a/packages/app_package_maker/lib/src/app_package_maker.dart b/packages/flutter_app_packager/lib/src/api/app_package_maker.dart similarity index 82% rename from packages/app_package_maker/lib/src/app_package_maker.dart rename to packages/flutter_app_packager/lib/src/api/app_package_maker.dart index 93c69d54..5c7f42e6 100644 --- a/packages/app_package_maker/lib/src/app_package_maker.dart +++ b/packages/flutter_app_packager/lib/src/api/app_package_maker.dart @@ -1,11 +1,15 @@ import 'dart:convert'; import 'dart:io'; -import 'package:app_package_maker/src/make_config.dart'; -import 'package:app_package_maker/src/make_result.dart'; +import 'package:flutter_app_packager/src/api/make_config.dart'; +import 'package:flutter_app_packager/src/api/make_result.dart'; import 'package:shell_executor/shell_executor.dart'; import 'package:yaml/yaml.dart'; +export 'make_config.dart'; +export 'make_error.dart'; +export 'make_result.dart'; + Map loadMakeConfigYaml(String path) { final yamlDoc = loadYaml(File(path).readAsStringSync()); return json.decode(json.encode(yamlDoc)); diff --git a/packages/app_package_maker/lib/src/make_config.dart b/packages/flutter_app_packager/lib/src/api/make_config.dart similarity index 98% rename from packages/app_package_maker/lib/src/make_config.dart rename to packages/flutter_app_packager/lib/src/api/make_config.dart index f1fd3107..bfd7f3c7 100644 --- a/packages/app_package_maker/lib/src/make_config.dart +++ b/packages/flutter_app_packager/lib/src/api/make_config.dart @@ -1,6 +1,6 @@ import 'dart:io'; -import 'package:app_package_maker/app_package_maker.dart'; +import 'package:flutter_app_packager/src/api/make_error.dart'; import 'package:mustache_template/mustache.dart'; import 'package:pub_semver/pub_semver.dart'; import 'package:pubspec_parse/pubspec_parse.dart'; diff --git a/packages/app_package_maker/lib/src/make_error.dart b/packages/flutter_app_packager/lib/src/api/make_error.dart similarity index 100% rename from packages/app_package_maker/lib/src/make_error.dart rename to packages/flutter_app_packager/lib/src/api/make_error.dart diff --git a/packages/app_package_maker/lib/src/make_result.dart b/packages/flutter_app_packager/lib/src/api/make_result.dart similarity index 79% rename from packages/app_package_maker/lib/src/make_result.dart rename to packages/flutter_app_packager/lib/src/api/make_result.dart index 90ec4a36..bc6d4956 100644 --- a/packages/app_package_maker/lib/src/make_result.dart +++ b/packages/flutter_app_packager/lib/src/api/make_result.dart @@ -1,7 +1,7 @@ import 'dart:io'; -import 'package:app_package_maker/src/make_config.dart'; -import 'package:app_package_maker/src/make_error.dart'; +import 'package:flutter_app_packager/src/api/make_config.dart'; +import 'package:flutter_app_packager/src/api/make_error.dart'; class MakeResult { MakeResult( @@ -17,10 +17,12 @@ class MakeResult { return { 'config': config.toJson(), 'artifacts': artifacts - .map((e) => { - 'type': e is File ? 'file' : 'directory', - 'path': e.path, - }) + .map( + (e) => { + 'type': e is File ? 'file' : 'directory', + 'path': e.path, + }, + ) .toList(), 'duration': duration, }..removeWhere((key, value) => value == null); diff --git a/packages/flutter_app_packager/lib/src/flutter_app_packager.dart b/packages/flutter_app_packager/lib/src/flutter_app_packager.dart index c0756462..123b3c9d 100644 --- a/packages/flutter_app_packager/lib/src/flutter_app_packager.dart +++ b/packages/flutter_app_packager/lib/src/flutter_app_packager.dart @@ -1,5 +1,6 @@ import 'dart:io'; +import 'package:flutter_app_packager/src/api/app_package_maker.dart'; import 'package:flutter_app_packager/src/makers/makers.dart'; class FlutterAppPackager { diff --git a/packages/flutter_app_packager/lib/src/makers/aab/app_package_maker_aab.dart b/packages/flutter_app_packager/lib/src/makers/aab/app_package_maker_aab.dart index 45beb8d0..81305640 100644 --- a/packages/flutter_app_packager/lib/src/makers/aab/app_package_maker_aab.dart +++ b/packages/flutter_app_packager/lib/src/makers/aab/app_package_maker_aab.dart @@ -1,4 +1,4 @@ -import 'package:app_package_maker/app_package_maker.dart'; +import 'package:flutter_app_packager/src/api/app_package_maker.dart'; class AppPackageMakerAab extends AppPackageMaker { @override diff --git a/packages/flutter_app_packager/lib/src/makers/apk/app_package_maker_apk.dart b/packages/flutter_app_packager/lib/src/makers/apk/app_package_maker_apk.dart index ee3f06c0..1849ac96 100644 --- a/packages/flutter_app_packager/lib/src/makers/apk/app_package_maker_apk.dart +++ b/packages/flutter_app_packager/lib/src/makers/apk/app_package_maker_apk.dart @@ -1,4 +1,4 @@ -import 'package:app_package_maker/app_package_maker.dart'; +import 'package:flutter_app_packager/src/api/app_package_maker.dart'; class AppPackageMakerApk extends AppPackageMaker { @override diff --git a/packages/flutter_app_packager/lib/src/makers/appimage/app_package_maker_appimage.dart b/packages/flutter_app_packager/lib/src/makers/appimage/app_package_maker_appimage.dart index 2f5b7d0e..4b4f7a76 100644 --- a/packages/flutter_app_packager/lib/src/makers/appimage/app_package_maker_appimage.dart +++ b/packages/flutter_app_packager/lib/src/makers/appimage/app_package_maker_appimage.dart @@ -1,6 +1,6 @@ import 'dart:io'; -import 'package:app_package_maker/app_package_maker.dart'; +import 'package:flutter_app_packager/src/api/app_package_maker.dart'; import 'package:flutter_app_packager/src/makers/appimage/make_appimage_config.dart'; import 'package:path/path.dart' as path; import 'package:shell_executor/shell_executor.dart'; @@ -33,7 +33,8 @@ class AppPackageMakerAppImage extends AppPackageMaker { final soDeps = lines .split('\n') .where( - (line) => line.contains('=>') && line.trim().startsWith('lib')) + (line) => line.contains('=>') && line.trim().startsWith('lib'), + ) /// converts this: /// libkeybinder-3.0.so.0 => /lib64/libkeybinder-3.0.so.0 (0x00007f6513811000) @@ -69,28 +70,30 @@ class AppPackageMakerAppImage extends AppPackageMaker { path.join( makeConfig.packagingDirectory.path, '${makeConfig.appName}.AppDir', - ) + ), ]).then((value) { if (value.exitCode != 0) { throw MakeError(value.stderr as String); } }); - final desktopFile = File(path.join( - makeConfig.packagingDirectory.path, - '${makeConfig.appName}.AppDir', - '${makeConfig.appName}.desktop', - )) - ..createSync(recursive: true); + final desktopFile = File( + path.join( + makeConfig.packagingDirectory.path, + '${makeConfig.appName}.AppDir', + '${makeConfig.appName}.desktop', + ), + )..createSync(recursive: true); await desktopFile.writeAsString(makeConfig.desktopFileContent); - final appRunFile = File(path.join( - makeConfig.packagingDirectory.path, - '${makeConfig.appName}.AppDir', - 'AppRun', - )) - ..createSync(recursive: true); + final appRunFile = File( + path.join( + makeConfig.packagingDirectory.path, + '${makeConfig.appName}.AppDir', + 'AppRun', + ), + )..createSync(recursive: true); await appRunFile.writeAsString(makeConfig.appRunContent); @@ -105,11 +108,13 @@ class AppPackageMakerAppImage extends AppPackageMaker { throw MakeError("icon ${makeConfig.icon} path doesn't exist"); } - await iconFile.copy(path.join( - makeConfig.packagingDirectory.path, - '${makeConfig.appName}.AppDir', - '${makeConfig.appName}${path.extension(makeConfig.icon)}', - )); + await iconFile.copy( + path.join( + makeConfig.packagingDirectory.path, + '${makeConfig.appName}.AppDir', + '${makeConfig.appName}${path.extension(makeConfig.icon)}', + ), + ); final icon256x256 = path.join( makeConfig.packagingDirectory.path, @@ -130,15 +135,19 @@ class AppPackageMakerAppImage extends AppPackageMaker { } }); - await iconFile.copy(path.join( - icon128x128, - '${makeConfig.appName}${path.extension(makeConfig.icon)}', - )); + await iconFile.copy( + path.join( + icon128x128, + '${makeConfig.appName}${path.extension(makeConfig.icon)}', + ), + ); - await iconFile.copy(path.join( - icon256x256, - '${makeConfig.appName}${path.extension(makeConfig.icon)}', - )); + await iconFile.copy( + path.join( + icon256x256, + '${makeConfig.appName}${path.extension(makeConfig.icon)}', + ), + ); final defaultSharedObjects = [ 'libapp.so', @@ -146,10 +155,12 @@ class AppPackageMakerAppImage extends AppPackageMaker { 'libgtk-3.so.0', ]; - final appSOLibs = Directory(path.join( - makeConfig.packagingDirectory.path, - '${makeConfig.appName}.AppDir/lib', - )) + final appSOLibs = Directory( + path.join( + makeConfig.packagingDirectory.path, + '${makeConfig.appName}.AppDir/lib', + ), + ) .listSync() .where((e) => !defaultSharedObjects.contains(path.basename(e.path))); @@ -174,11 +185,13 @@ class AppPackageMakerAppImage extends AppPackageMaker { await Future.wait( appSOLibs.map((so) async { - final referencedSharedLibs = await _getSharedDependencies(so.path) - .then((d) => d.difference(libFlutterGtkDeps) - ..removeWhere( - (lib) => lib.contains('libflutter_linux_gtk.so'), - )); + final referencedSharedLibs = + await _getSharedDependencies(so.path).then( + (d) => d.difference(libFlutterGtkDeps) + ..removeWhere( + (lib) => lib.contains('libflutter_linux_gtk.so'), + ), + ); if (referencedSharedLibs.isEmpty) return; @@ -189,7 +202,7 @@ class AppPackageMakerAppImage extends AppPackageMaker { path.join( makeConfig.packagingDirectory.path, '${makeConfig.appName}.AppDir/usr/lib', - ) + ), ], ).then((value) { if (value.exitCode != 0) { diff --git a/packages/flutter_app_packager/lib/src/makers/appimage/make_appimage_config.dart b/packages/flutter_app_packager/lib/src/makers/appimage/make_appimage_config.dart index cfed1959..2170a4eb 100644 --- a/packages/flutter_app_packager/lib/src/makers/appimage/make_appimage_config.dart +++ b/packages/flutter_app_packager/lib/src/makers/appimage/make_appimage_config.dart @@ -2,7 +2,7 @@ import 'dart:io'; -import 'package:app_package_maker/app_package_maker.dart'; +import 'package:flutter_app_packager/src/api/app_package_maker.dart'; class AppImageAction { AppImageAction({ @@ -51,8 +51,11 @@ class MakeAppImageConfig extends MakeConfig { startupNotify: map['startup_notify'] as bool? ?? false, genericName: map['generic_name'] as String? ?? 'A Flutter Application', actions: (map['actions'] as List? ?? []) - .map((e) => AppImageAction.fromJson( - (Map.castFrom(e)))) + .map( + (e) => AppImageAction.fromJson( + (Map.castFrom(e)), + ), + ) .toList(), ); } diff --git a/packages/flutter_app_packager/lib/src/makers/deb/app_package_maker_deb.dart b/packages/flutter_app_packager/lib/src/makers/deb/app_package_maker_deb.dart index f7ce7110..8989e671 100644 --- a/packages/flutter_app_packager/lib/src/makers/deb/app_package_maker_deb.dart +++ b/packages/flutter_app_packager/lib/src/makers/deb/app_package_maker_deb.dart @@ -1,6 +1,6 @@ import 'dart:io'; -import 'package:app_package_maker/app_package_maker.dart'; +import 'package:flutter_app_packager/src/api/app_package_maker.dart'; import 'package:flutter_app_packager/src/makers/deb/make_deb_config.dart'; import 'package:path/path.dart' as path; import 'package:shell_executor/shell_executor.dart'; @@ -119,7 +119,7 @@ class AppPackageMakerDeb extends AppPackageMaker { '--build', '--root-owner-group', packagingDirectory.path, - makeConfig.outputFile.path + makeConfig.outputFile.path, ]); if (processResult.exitCode != 0) { diff --git a/packages/flutter_app_packager/lib/src/makers/deb/make_deb_config.dart b/packages/flutter_app_packager/lib/src/makers/deb/make_deb_config.dart index d784037f..51bc64fd 100644 --- a/packages/flutter_app_packager/lib/src/makers/deb/make_deb_config.dart +++ b/packages/flutter_app_packager/lib/src/makers/deb/make_deb_config.dart @@ -1,6 +1,6 @@ import 'dart:io'; -import 'package:app_package_maker/app_package_maker.dart'; +import 'package:flutter_app_packager/src/api/app_package_maker.dart'; // format of make_config for deb /* @@ -154,71 +154,72 @@ class MakeDebConfig extends MakeLinuxPackageConfig { factory MakeDebConfig.fromJson(Map map) { return MakeDebConfig( - displayName: map['display_name'], - packageName: map['package_name'], - maintainer: - "${map['maintainer']['name']} <${map['maintainer']['email']}>", - coAuthors: (map['co_authors'] as List?) - ?.map((e) => "${e['name']} <${e['email']}>") - .toList(), - priority: map['priority'], - section: map['section'], - dependencies: map['dependencies'] != null - ? List.castFrom(map['dependencies']) - : null, - buildDependenciesIndep: map['build_dependencies_indep'] != null - ? List.castFrom(map['build_dependencies_indep']) - : null, - buildDependencies: map['build_dependencies'] != null - ? List.castFrom(map['build_dependencies']) - : null, - recommendedDependencies: map['recommended_dependencies'] != null - ? List.castFrom(map['recommended_dependencies']) - : null, - suggestedDependencies: map['suggested_dependencies'] != null - ? List.castFrom(map['suggested_dependencies']) - : null, - enhances: map['enhances'] != null - ? List.castFrom(map['enhances']) - : null, - preDependencies: map['pre_dependencies'] != null - ? List.castFrom(map['pre_dependencies']) - : null, - breaks: map['breaks'] != null - ? List.castFrom(map['breaks']) - : null, - conflicts: map['conflicts'] != null - ? List.castFrom(map['conflicts']) - : null, - provides: map['provides'] != null - ? List.castFrom(map['provides']) - : null, - replaces: map['replaces'] != null - ? List.castFrom(map['replaces']) - : null, - postinstallScripts: map['postinstall_scripts'] != null - ? List.castFrom(map['postinstall_scripts']) - : null, - postuninstallScripts: map['postuninstall_scripts'] != null - ? List.castFrom(map['postuninstall_scripts']) - : null, - keywords: map['keywords'] != null - ? List.castFrom(map['keywords']) - : null, - supportedMimeType: map['supported_mime_type'] != null - ? List.castFrom(map['supported_mime_type']) - : null, - actions: map['actions'] != null - ? List.castFrom(map['actions']) - : null, - categories: map['categories'] != null - ? List.castFrom(map['categories']) - : null, - essential: map['essential'], - genericName: map['generic_name'], - startupNotify: map['startup_notify'], - installedSize: map['installed_size'], - icon: map['icon']); + displayName: map['display_name'], + packageName: map['package_name'], + maintainer: + "${map['maintainer']['name']} <${map['maintainer']['email']}>", + coAuthors: (map['co_authors'] as List?) + ?.map((e) => "${e['name']} <${e['email']}>") + .toList(), + priority: map['priority'], + section: map['section'], + dependencies: map['dependencies'] != null + ? List.castFrom(map['dependencies']) + : null, + buildDependenciesIndep: map['build_dependencies_indep'] != null + ? List.castFrom(map['build_dependencies_indep']) + : null, + buildDependencies: map['build_dependencies'] != null + ? List.castFrom(map['build_dependencies']) + : null, + recommendedDependencies: map['recommended_dependencies'] != null + ? List.castFrom(map['recommended_dependencies']) + : null, + suggestedDependencies: map['suggested_dependencies'] != null + ? List.castFrom(map['suggested_dependencies']) + : null, + enhances: map['enhances'] != null + ? List.castFrom(map['enhances']) + : null, + preDependencies: map['pre_dependencies'] != null + ? List.castFrom(map['pre_dependencies']) + : null, + breaks: map['breaks'] != null + ? List.castFrom(map['breaks']) + : null, + conflicts: map['conflicts'] != null + ? List.castFrom(map['conflicts']) + : null, + provides: map['provides'] != null + ? List.castFrom(map['provides']) + : null, + replaces: map['replaces'] != null + ? List.castFrom(map['replaces']) + : null, + postinstallScripts: map['postinstall_scripts'] != null + ? List.castFrom(map['postinstall_scripts']) + : null, + postuninstallScripts: map['postuninstall_scripts'] != null + ? List.castFrom(map['postuninstall_scripts']) + : null, + keywords: map['keywords'] != null + ? List.castFrom(map['keywords']) + : null, + supportedMimeType: map['supported_mime_type'] != null + ? List.castFrom(map['supported_mime_type']) + : null, + actions: map['actions'] != null + ? List.castFrom(map['actions']) + : null, + categories: map['categories'] != null + ? List.castFrom(map['categories']) + : null, + essential: map['essential'], + genericName: map['generic_name'], + startupNotify: map['startup_notify'], + installedSize: map['installed_size'], + icon: map['icon'], + ); } String displayName; @@ -308,7 +309,7 @@ class MakeDebConfig extends MakeLinuxPackageConfig { 'Keywords': keywords != null && keywords!.isNotEmpty ? '${keywords!.join(';')};' : null, - 'StartupNotify': startupNotify + 'StartupNotify': startupNotify, }..removeWhere((key, value) => value == null), }; } @@ -342,7 +343,7 @@ class MakeDebConfig extends MakeLinuxPackageConfig { ...postuninstallScripts, 'exit 0', ].join('\n') - : null + : null, }..removeWhere((key, value) => value == null); return Map.castFrom(map); } diff --git a/packages/flutter_app_packager/lib/src/makers/direct/app_package_maker_direct.dart b/packages/flutter_app_packager/lib/src/makers/direct/app_package_maker_direct.dart index 0197ed73..b26871c2 100644 --- a/packages/flutter_app_packager/lib/src/makers/direct/app_package_maker_direct.dart +++ b/packages/flutter_app_packager/lib/src/makers/direct/app_package_maker_direct.dart @@ -1,4 +1,4 @@ -import 'package:app_package_maker/app_package_maker.dart'; +import 'package:flutter_app_packager/src/api/app_package_maker.dart'; import 'package:io/io.dart'; class AppPackageMakerDirect extends AppPackageMaker { diff --git a/packages/flutter_app_packager/lib/src/makers/dmg/app_package_maker_dmg.dart b/packages/flutter_app_packager/lib/src/makers/dmg/app_package_maker_dmg.dart index 3fcd9e7c..7b91512b 100644 --- a/packages/flutter_app_packager/lib/src/makers/dmg/app_package_maker_dmg.dart +++ b/packages/flutter_app_packager/lib/src/makers/dmg/app_package_maker_dmg.dart @@ -1,7 +1,7 @@ import 'dart:convert'; import 'dart:io'; -import 'package:app_package_maker/app_package_maker.dart'; +import 'package:flutter_app_packager/src/api/app_package_maker.dart'; import 'package:flutter_app_packager/src/makers/dmg/commands/appdmg.dart'; import 'package:flutter_app_packager/src/makers/dmg/make_dmg_config.dart'; import 'package:shell_executor/shell_executor.dart'; diff --git a/packages/flutter_app_packager/lib/src/makers/dmg/make_dmg_config.dart b/packages/flutter_app_packager/lib/src/makers/dmg/make_dmg_config.dart index 02d529fa..9d181a76 100644 --- a/packages/flutter_app_packager/lib/src/makers/dmg/make_dmg_config.dart +++ b/packages/flutter_app_packager/lib/src/makers/dmg/make_dmg_config.dart @@ -1,6 +1,6 @@ import 'dart:io'; -import 'package:app_package_maker/app_package_maker.dart'; +import 'package:flutter_app_packager/src/api/app_package_maker.dart'; class DmgWindowPosition { DmgWindowPosition({ diff --git a/packages/flutter_app_packager/lib/src/makers/exe/app_package_maker_exe.dart b/packages/flutter_app_packager/lib/src/makers/exe/app_package_maker_exe.dart index 3a90f50a..db174f32 100644 --- a/packages/flutter_app_packager/lib/src/makers/exe/app_package_maker_exe.dart +++ b/packages/flutter_app_packager/lib/src/makers/exe/app_package_maker_exe.dart @@ -1,6 +1,6 @@ import 'dart:io'; -import 'package:app_package_maker/app_package_maker.dart'; +import 'package:flutter_app_packager/src/api/app_package_maker.dart'; import 'package:flutter_app_packager/src/makers/exe/inno_setup/inno_setup_compiler.dart'; import 'package:flutter_app_packager/src/makers/exe/inno_setup/inno_setup_script.dart'; import 'package:flutter_app_packager/src/makers/exe/make_exe_config.dart'; diff --git a/packages/flutter_app_packager/lib/src/makers/exe/inno_setup/inno_setup_script.dart b/packages/flutter_app_packager/lib/src/makers/exe/inno_setup/inno_setup_script.dart index 4431060e..935634ba 100644 --- a/packages/flutter_app_packager/lib/src/makers/exe/inno_setup/inno_setup_script.dart +++ b/packages/flutter_app_packager/lib/src/makers/exe/inno_setup/inno_setup_script.dart @@ -101,7 +101,7 @@ class InnoSetupScript { 'OUTPUT_BASE_FILENAME': makeConfig.outputBaseFileName, 'LOCALES': makeConfig.locales, 'SETUP_ICON_FILE': makeConfig.setupIconFile ?? '', - 'PRIVILEGES_REQUIRED': makeConfig.privilegesRequired ?? 'none' + 'PRIVILEGES_REQUIRED': makeConfig.privilegesRequired ?? 'none', }..removeWhere((key, value) => value == null); Context context = Context.create(); @@ -109,10 +109,12 @@ class InnoSetupScript { String scriptTemplate = _template; if (makeConfig.scriptTemplate != null) { - File scriptTemplateFile = File(path.join( - 'windows/packaging/exe/', - makeConfig.scriptTemplate!, - )); + File scriptTemplateFile = File( + path.join( + 'windows/packaging/exe/', + makeConfig.scriptTemplate!, + ), + ); scriptTemplate = scriptTemplateFile.readAsStringSync(); } diff --git a/packages/flutter_app_packager/lib/src/makers/exe/make_exe_config.dart b/packages/flutter_app_packager/lib/src/makers/exe/make_exe_config.dart index 8439e70b..fc9061f3 100644 --- a/packages/flutter_app_packager/lib/src/makers/exe/make_exe_config.dart +++ b/packages/flutter_app_packager/lib/src/makers/exe/make_exe_config.dart @@ -1,6 +1,6 @@ import 'dart:io'; -import 'package:app_package_maker/app_package_maker.dart'; +import 'package:flutter_app_packager/src/api/app_package_maker.dart'; import 'package:path/path.dart' as p; class MakeExeConfig extends MakeConfig { diff --git a/packages/flutter_app_packager/lib/src/makers/ipa/app_package_maker_ipa.dart b/packages/flutter_app_packager/lib/src/makers/ipa/app_package_maker_ipa.dart index b5ee54bf..f6ba1025 100644 --- a/packages/flutter_app_packager/lib/src/makers/ipa/app_package_maker_ipa.dart +++ b/packages/flutter_app_packager/lib/src/makers/ipa/app_package_maker_ipa.dart @@ -1,6 +1,6 @@ import 'dart:io'; -import 'package:app_package_maker/app_package_maker.dart'; +import 'package:flutter_app_packager/src/api/app_package_maker.dart'; class AppPackageMakerIpa extends AppPackageMaker { @override diff --git a/packages/flutter_app_packager/lib/src/makers/makers.dart b/packages/flutter_app_packager/lib/src/makers/makers.dart index 51b29036..7a25a313 100644 --- a/packages/flutter_app_packager/lib/src/makers/makers.dart +++ b/packages/flutter_app_packager/lib/src/makers/makers.dart @@ -1,5 +1,3 @@ -export 'package:app_package_maker/app_package_maker.dart'; - export 'aab/app_package_maker_aab.dart'; export 'apk/app_package_maker_apk.dart'; export 'appimage/app_package_maker_appimage.dart'; diff --git a/packages/flutter_app_packager/lib/src/makers/msix/app_package_maker_msix.dart b/packages/flutter_app_packager/lib/src/makers/msix/app_package_maker_msix.dart index f97e00db..df4f107d 100644 --- a/packages/flutter_app_packager/lib/src/makers/msix/app_package_maker_msix.dart +++ b/packages/flutter_app_packager/lib/src/makers/msix/app_package_maker_msix.dart @@ -1,6 +1,6 @@ import 'dart:io'; -import 'package:app_package_maker/app_package_maker.dart'; +import 'package:flutter_app_packager/src/api/app_package_maker.dart'; import 'package:flutter_app_packager/src/makers/msix/make_msix_config.dart'; import 'package:msix/msix.dart'; import 'package:path/path.dart' as p; diff --git a/packages/flutter_app_packager/lib/src/makers/msix/make_msix_config.dart b/packages/flutter_app_packager/lib/src/makers/msix/make_msix_config.dart index e9a6203d..0365f636 100644 --- a/packages/flutter_app_packager/lib/src/makers/msix/make_msix_config.dart +++ b/packages/flutter_app_packager/lib/src/makers/msix/make_msix_config.dart @@ -2,7 +2,7 @@ import 'dart:io'; -import 'package:app_package_maker/app_package_maker.dart'; +import 'package:flutter_app_packager/src/api/app_package_maker.dart'; class MakeMsixConfig extends MakeConfig { MakeMsixConfig({ diff --git a/packages/flutter_app_packager/lib/src/makers/pkg/app_package_maker_pkg.dart b/packages/flutter_app_packager/lib/src/makers/pkg/app_package_maker_pkg.dart index 607a78ee..84e821aa 100644 --- a/packages/flutter_app_packager/lib/src/makers/pkg/app_package_maker_pkg.dart +++ b/packages/flutter_app_packager/lib/src/makers/pkg/app_package_maker_pkg.dart @@ -1,6 +1,6 @@ import 'dart:io'; -import 'package:app_package_maker/app_package_maker.dart'; +import 'package:flutter_app_packager/src/api/app_package_maker.dart'; import 'package:flutter_app_packager/src/makers/pkg/make_pkg_config.dart'; import 'package:shell_executor/shell_executor.dart'; @@ -25,10 +25,12 @@ class AppPackageMakerPkg extends AppPackageMaker { File appFile = config.buildOutputFiles.first; File outputFile = config.outputFile; - File unsignedPkgFile = File(outputFile.path.replaceFirst( - '.$packageFormat', - '-unsigned.$packageFormat', - )); + File unsignedPkgFile = File( + outputFile.path.replaceFirst( + '.$packageFormat', + '-unsigned.$packageFormat', + ), + ); await $('xcrun', [ 'productbuild', diff --git a/packages/flutter_app_packager/lib/src/makers/pkg/make_pkg_config.dart b/packages/flutter_app_packager/lib/src/makers/pkg/make_pkg_config.dart index 649a2c37..d6b9e37a 100644 --- a/packages/flutter_app_packager/lib/src/makers/pkg/make_pkg_config.dart +++ b/packages/flutter_app_packager/lib/src/makers/pkg/make_pkg_config.dart @@ -1,6 +1,6 @@ import 'dart:io'; -import 'package:app_package_maker/app_package_maker.dart'; +import 'package:flutter_app_packager/src/api/app_package_maker.dart'; class MakePkgConfig extends MakeConfig { MakePkgConfig({ diff --git a/packages/flutter_app_packager/lib/src/makers/rpm/app_package_maker_rpm.dart b/packages/flutter_app_packager/lib/src/makers/rpm/app_package_maker_rpm.dart index c168b78b..a25bb7e9 100644 --- a/packages/flutter_app_packager/lib/src/makers/rpm/app_package_maker_rpm.dart +++ b/packages/flutter_app_packager/lib/src/makers/rpm/app_package_maker_rpm.dart @@ -1,6 +1,6 @@ import 'dart:io'; -import 'package:app_package_maker/app_package_maker.dart'; +import 'package:flutter_app_packager/src/api/app_package_maker.dart'; import 'package:flutter_app_packager/src/makers/rpm/make_rpm_config.dart'; import 'package:flutter_app_packager/src/makers/rpm/rpmbuild.dart'; import 'package:path/path.dart' as path; diff --git a/packages/flutter_app_packager/lib/src/makers/rpm/make_rpm_config.dart b/packages/flutter_app_packager/lib/src/makers/rpm/make_rpm_config.dart index 14d652d3..22d7215e 100644 --- a/packages/flutter_app_packager/lib/src/makers/rpm/make_rpm_config.dart +++ b/packages/flutter_app_packager/lib/src/makers/rpm/make_rpm_config.dart @@ -1,6 +1,6 @@ import 'dart:io'; -import 'package:app_package_maker/app_package_maker.dart'; +import 'package:flutter_app_packager/src/api/app_package_maker.dart'; class MakeRPMConfig extends MakeConfig { MakeRPMConfig({ @@ -144,7 +144,7 @@ class MakeRPMConfig extends MakeConfig { 'inline-body': { '%defattr': '(-,root,root)', '%attr': '(4755, root, root) %{_datadir}/pixmaps/%{name}.png', - } + }, }, 'DESKTOP': { 'Type': 'Application', @@ -165,7 +165,7 @@ class MakeRPMConfig extends MakeConfig { 'Keywords': keywords != null && keywords!.isNotEmpty ? '${keywords!.join(';')};' : null, - 'StartupNotify': startupNotify + 'StartupNotify': startupNotify, }..removeWhere((key, value) => value == null), }; } diff --git a/packages/flutter_app_packager/lib/src/makers/zip/app_package_maker_zip.dart b/packages/flutter_app_packager/lib/src/makers/zip/app_package_maker_zip.dart index 059843cd..01446823 100644 --- a/packages/flutter_app_packager/lib/src/makers/zip/app_package_maker_zip.dart +++ b/packages/flutter_app_packager/lib/src/makers/zip/app_package_maker_zip.dart @@ -1,7 +1,7 @@ import 'dart:io'; -import 'package:app_package_maker/app_package_maker.dart'; import 'package:archive/archive_io.dart'; +import 'package:flutter_app_packager/src/api/app_package_maker.dart'; import 'package:shell_executor/shell_executor.dart'; class AppPackageMakerZip extends AppPackageMaker { diff --git a/packages/flutter_app_packager/pubspec.lock b/packages/flutter_app_packager/pubspec.lock index 30931da9..1b59147c 100644 --- a/packages/flutter_app_packager/pubspec.lock +++ b/packages/flutter_app_packager/pubspec.lock @@ -1,13 +1,6 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - app_package_maker: - dependency: "direct main" - description: - path: "../app_package_maker" - relative: true - source: path - version: "0.3.6" archive: dependency: "direct main" description: @@ -185,7 +178,7 @@ packages: source: hosted version: "3.16.6" mustache_template: - dependency: transitive + dependency: "direct main" description: name: mustache_template sha256: a46e26f91445bfb0b60519be280555b06792460b27b19e2b19ad5b9740df5d1c @@ -225,7 +218,7 @@ packages: source: hosted version: "3.7.3" pub_semver: - dependency: transitive + dependency: "direct main" description: name: pub_semver sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" @@ -233,7 +226,7 @@ packages: source: hosted version: "2.1.4" pubspec_parse: - dependency: transitive + dependency: "direct main" description: name: pubspec_parse sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 @@ -296,7 +289,7 @@ packages: source: hosted version: "6.3.0" yaml: - dependency: transitive + dependency: "direct main" description: name: yaml sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" diff --git a/packages/flutter_app_packager/pubspec.yaml b/packages/flutter_app_packager/pubspec.yaml index b681fe67..430aa299 100644 --- a/packages/flutter_app_packager/pubspec.yaml +++ b/packages/flutter_app_packager/pubspec.yaml @@ -7,13 +7,16 @@ environment: sdk: ">=2.16.0 <4.0.0" dependencies: - app_package_maker: ^0.3.6 archive: ^3.4.10 io: ^1.0.3 liquid_engine: ^0.2.2 msix: ^3.16.6 + mustache_template: ^2.0.0 path: ^1.8.1 + pub_semver: ^2.1.0 + pubspec_parse: ^1.1.0 shell_executor: ^0.1.5 + yaml: ^3.1.0 dev_dependencies: dependency_validator: ^3.0.0 diff --git a/packages/flutter_app_publisher/lib/src/publishers/appcenter/app_package_publisher_appcenter.dart b/packages/flutter_app_publisher/lib/src/publishers/appcenter/app_package_publisher_appcenter.dart index 73a7bc4d..3d0e6dcf 100644 --- a/packages/flutter_app_publisher/lib/src/publishers/appcenter/app_package_publisher_appcenter.dart +++ b/packages/flutter_app_publisher/lib/src/publishers/appcenter/app_package_publisher_appcenter.dart @@ -139,7 +139,8 @@ class AppPackagePublisherAppCenter extends AppPackagePublisher { required String contentType, }) async { final response = await _dio.post( - '$_kUploadDomain/set_metadata/$packageAssetId?file_name=$fileName&file_size=$fileSize&token=$urlEncodedToken&content_type=$contentType'); + '$_kUploadDomain/set_metadata/$packageAssetId?file_name=$fileName&file_size=$fileSize&token=$urlEncodedToken&content_type=$contentType', + ); return Map.from(response.data); } @@ -170,10 +171,12 @@ class AppPackagePublisherAppCenter extends AppPackagePublisher { await _dio.post( '$_kUploadDomain/upload_chunk/$packageAssetId?token=$urlEncodedToken&block_number=${i + 1}', data: Stream.fromIterable(fileData.map((e) => [e])), - options: Options(headers: { - Headers.contentLengthHeader: contentLength, - Headers.contentTypeHeader: contentType, - }), + options: Options( + headers: { + Headers.contentLengthHeader: contentLength, + Headers.contentTypeHeader: contentType, + }, + ), onSendProgress: (sent, total) { if (onPublishProgress != null) { onPublishProgress((i * chunkSize) + sent, file.lengthSync()); @@ -230,7 +233,7 @@ class AppPackagePublisherAppCenter extends AppPackagePublisher { // skip } counter = counter + 1; - await Future.delayed(Duration(seconds: 3)); + await Future.delayed(const Duration(seconds: 3)); } if (releaseDistinctId == null) { @@ -249,7 +252,7 @@ class AppPackagePublisherAppCenter extends AppPackagePublisher { '/apps/$ownerName/$appName/releases/$releaseDistinctId', data: { 'destinations': [ - {'name': distributionGroup} + {'name': distributionGroup}, ], }, ); diff --git a/packages/flutter_app_publisher/lib/src/publishers/appcenter/publish_appcenter_config.dart b/packages/flutter_app_publisher/lib/src/publishers/appcenter/publish_appcenter_config.dart index cc0de8fe..a7a59ef6 100644 --- a/packages/flutter_app_publisher/lib/src/publishers/appcenter/publish_appcenter_config.dart +++ b/packages/flutter_app_publisher/lib/src/publishers/appcenter/publish_appcenter_config.dart @@ -20,7 +20,8 @@ class PublishAppCenterConfig extends PublishConfig { (environment ?? Platform.environment)[kEnvAppCenterApiToken]; if ((apiToken ?? '').isEmpty) { throw PublishError( - 'Missing `$kEnvAppCenterApiToken` environment variable.'); + 'Missing `$kEnvAppCenterApiToken` environment variable.', + ); } String? ownerName = publishArguments?['owner-name']; if ((ownerName ?? '').isEmpty) { diff --git a/packages/flutter_app_publisher/lib/src/publishers/appstore/app_package_publisher_appstore.dart b/packages/flutter_app_publisher/lib/src/publishers/appstore/app_package_publisher_appstore.dart index 621b33c5..408ae537 100644 --- a/packages/flutter_app_publisher/lib/src/publishers/appstore/app_package_publisher_appstore.dart +++ b/packages/flutter_app_publisher/lib/src/publishers/appstore/app_package_publisher_appstore.dart @@ -36,7 +36,7 @@ class AppPackagePublisherAppStore extends AppPackagePublisher { '--type', type, // cmd list - ...publishConfig.toAppStoreCliDistributeArgs() + ...publishConfig.toAppStoreCliDistributeArgs(), ], ); diff --git a/packages/flutter_app_publisher/lib/src/publishers/appstore/publish_appstore_config.dart b/packages/flutter_app_publisher/lib/src/publishers/appstore/publish_appstore_config.dart index 1f54096c..32600ae6 100644 --- a/packages/flutter_app_publisher/lib/src/publishers/appstore/publish_appstore_config.dart +++ b/packages/flutter_app_publisher/lib/src/publishers/appstore/publish_appstore_config.dart @@ -15,8 +15,10 @@ class PublishAppStoreConfig extends PublishConfig { this.apiIssuer, }); - factory PublishAppStoreConfig.parse(Map? environment, - Map? publishArguments) { + factory PublishAppStoreConfig.parse( + Map? environment, + Map? publishArguments, + ) { // Get authorization info String? username = (environment ?? Platform.environment)[kEnvAppStoreUsername]; @@ -28,19 +30,22 @@ class PublishAppStoreConfig extends PublishConfig { // Check username & password & apiKey & apiIssuer if ('$username$password$apiKey$apiIssuer'.replaceAll('null', '').isEmpty) { throw PublishError( - 'Missing `$kEnvAppStoreUsername` & `$kEnvAppStorePassword` | `$kEnvAppStoreApiKey` & `$kEnvAppStoreApiIssuer` environment variable. See:https://help.apple.com/asc/appsaltool/#/apdATD1E53-D1E1A1303-D1E53A1126'); + 'Missing `$kEnvAppStoreUsername` & `$kEnvAppStorePassword` | `$kEnvAppStoreApiKey` & `$kEnvAppStoreApiIssuer` environment variable. See:https://help.apple.com/asc/appsaltool/#/apdATD1E53-D1E1A1303-D1E53A1126', + ); } // Check username & password if (((username ?? '').isNotEmpty && (password ?? '').isEmpty) || ((username ?? '').isEmpty && (password ?? '').isNotEmpty)) { throw PublishError( - 'Missing `$kEnvAppStoreUsername` & `$kEnvAppStorePassword` environment variable. See:https://help.apple.com/asc/appsaltool/#/apdATD1E53-D1E1A1303-D1E53A1126'); + 'Missing `$kEnvAppStoreUsername` & `$kEnvAppStorePassword` environment variable. See:https://help.apple.com/asc/appsaltool/#/apdATD1E53-D1E1A1303-D1E53A1126', + ); } else { // Check apiKey & apiIssuer if (((apiKey ?? '').isNotEmpty && (apiIssuer ?? '').isEmpty) || ((apiKey ?? '').isEmpty && (apiIssuer ?? '').isNotEmpty)) { throw PublishError( - 'Missing `$kEnvAppStoreApiKey` & `$kEnvAppStoreApiIssuer` environment variable. See:https://help.apple.com/asc/appsaltool/#/apdATD1E53-D1E1A1303-D1E53A1126'); + 'Missing `$kEnvAppStoreApiKey` & `$kEnvAppStoreApiIssuer` environment variable. See:https://help.apple.com/asc/appsaltool/#/apdATD1E53-D1E1A1303-D1E53A1126', + ); } } diff --git a/packages/flutter_app_publisher/lib/src/publishers/firebase/app_package_publisher_firebase.dart b/packages/flutter_app_publisher/lib/src/publishers/firebase/app_package_publisher_firebase.dart index 583ccf12..dc0bbba4 100644 --- a/packages/flutter_app_publisher/lib/src/publishers/firebase/app_package_publisher_firebase.dart +++ b/packages/flutter_app_publisher/lib/src/publishers/firebase/app_package_publisher_firebase.dart @@ -32,7 +32,7 @@ class AppPackagePublisherFirebase extends AppPackagePublisher { 'appdistribution:distribute', file.path, // cmd list - ...publishConfig.toFirebaseCliDistributeArgs() + ...publishConfig.toFirebaseCliDistributeArgs(), ], ); if (processResult.exitCode == 0) { diff --git a/packages/flutter_app_publisher/lib/src/publishers/firebase/publish_firebase_config.dart b/packages/flutter_app_publisher/lib/src/publishers/firebase/publish_firebase_config.dart index ed92bde8..44977470 100644 --- a/packages/flutter_app_publisher/lib/src/publishers/firebase/publish_firebase_config.dart +++ b/packages/flutter_app_publisher/lib/src/publishers/firebase/publish_firebase_config.dart @@ -16,19 +16,23 @@ class PublishFirebaseConfig extends PublishConfig { this.groupsFile, }); - factory PublishFirebaseConfig.parse(Map? environment, - Map? publishArguments) { + factory PublishFirebaseConfig.parse( + Map? environment, + Map? publishArguments, + ) { // Get token String? token = (environment ?? Platform.environment)[kEnvFirebaseToken]; if ((token ?? '').isEmpty) { throw PublishError( - 'Missing `$kEnvFirebaseToken` environment variable. See:https://firebase.google.com/docs/cli?authuser=0#cli-ci-systems'); + 'Missing `$kEnvFirebaseToken` environment variable. See:https://firebase.google.com/docs/cli?authuser=0#cli-ci-systems', + ); } // Get app String? app = publishArguments?['app']; if ((app ?? '').isEmpty) { throw PublishError( - 'Missing app args. See:https://console.firebase.google.com/project/_/settings/general/?authuser=0'); + 'Missing app args. See:https://console.firebase.google.com/project/_/settings/general/?authuser=0', + ); } return PublishFirebaseConfig( app: app!, diff --git a/packages/flutter_app_publisher/lib/src/publishers/firebase_hosting/app_package_publisher_firebase_hosting.dart b/packages/flutter_app_publisher/lib/src/publishers/firebase_hosting/app_package_publisher_firebase_hosting.dart index f13c2dd2..c67f6474 100644 --- a/packages/flutter_app_publisher/lib/src/publishers/firebase_hosting/app_package_publisher_firebase_hosting.dart +++ b/packages/flutter_app_publisher/lib/src/publishers/firebase_hosting/app_package_publisher_firebase_hosting.dart @@ -30,17 +30,21 @@ class AppPackagePublisherFirebaseHosting extends AppPackagePublisher { try { File firebaseRcFile = File('${directory.path}/.firebaserc'); firebaseRcFile.createSync(recursive: true); - firebaseRcFile.writeAsStringSync(json.encode({ - 'projects': {'default': publishConfig.projectId} - })); + firebaseRcFile.writeAsStringSync( + json.encode({ + 'projects': {'default': publishConfig.projectId}, + }), + ); File firebaseJsonFile = File('${directory.path}/firebase.json'); firebaseJsonFile.createSync(recursive: true); - firebaseJsonFile.writeAsStringSync(json.encode({ - 'hosting': { - 'public': '.', - 'ignore': ['firebase.json'] - } - })); + firebaseJsonFile.writeAsStringSync( + json.encode({ + 'hosting': { + 'public': '.', + 'ignore': ['firebase.json'], + }, + }), + ); ProcessResult r = await $( 'firebase', ['deploy'], diff --git a/packages/flutter_app_publisher/lib/src/publishers/github/app_package_publisher_github.dart b/packages/flutter_app_publisher/lib/src/publishers/github/app_package_publisher_github.dart index f3ce7d8a..d6312ce0 100644 --- a/packages/flutter_app_publisher/lib/src/publishers/github/app_package_publisher_github.dart +++ b/packages/flutter_app_publisher/lib/src/publishers/github/app_package_publisher_github.dart @@ -34,9 +34,11 @@ class AppPackagePublisherGithub extends AppPackagePublisher { publishArguments, ); // Set auth - _dio.options = BaseOptions(headers: { - 'Authorization': 'token ${publishConfig.token}', - }); + _dio.options = BaseOptions( + headers: { + 'Authorization': 'token ${publishConfig.token}', + }, + ); // Get uploadUrl String? uploadUrl; @@ -61,9 +63,11 @@ class AppPackagePublisherGithub extends AppPackagePublisher { /// Get uploadUrl by releaseName Future _getUploadurlByReleaseName( - PublishGithubConfig publishConfig) async { + PublishGithubConfig publishConfig, + ) async { Response resp = await _dio.get( - 'https://api.github.com/repos/${publishConfig.repoOwner}/${publishConfig.repoName}/releases'); + 'https://api.github.com/repos/${publishConfig.repoOwner}/${publishConfig.repoName}/releases', + ); List relist = (resp.data as List?) ?? []; var release = relist.firstWhere( (item) => item['name'] == publishConfig.releaseTitle, @@ -79,7 +83,7 @@ class AppPackagePublisherGithub extends AppPackagePublisher { data: { 'tag_name': publishConfig.releaseTitle, 'name': publishConfig.releaseTitle, - 'draft': true + 'draft': true, }, ); return resp.data?['upload_url']; @@ -87,15 +91,20 @@ class AppPackagePublisherGithub extends AppPackagePublisher { /// Get uploadUrl by latest release Future _getUploadurlByLatestRelease( - PublishGithubConfig publishConfig) async { + PublishGithubConfig publishConfig, + ) async { Response resp = await _dio.get( - 'https://api.github.com/repos/${publishConfig.repoOwner}/${publishConfig.repoName}/releases/latest'); + 'https://api.github.com/repos/${publishConfig.repoOwner}/${publishConfig.repoName}/releases/latest', + ); return resp.data?['upload_url']; } /// Upload Release Asset - Future _uploadReleaseAsset(File file, String uploadUrl, - PublishProgressCallback? onPublishProgress) async { + Future _uploadReleaseAsset( + File file, + String uploadUrl, + PublishProgressCallback? onPublishProgress, + ) async { // Fromat uploadUrl uploadUrl = uploadUrl.split('{').first; String fileName = file.path.split('/').last; diff --git a/packages/flutter_app_publisher/lib/src/publishers/pgyer/app_package_publisher_pgyer.dart b/packages/flutter_app_publisher/lib/src/publishers/pgyer/app_package_publisher_pgyer.dart index 4fe0dc4a..b5ac7dd1 100644 --- a/packages/flutter_app_publisher/lib/src/publishers/pgyer/app_package_publisher_pgyer.dart +++ b/packages/flutter_app_publisher/lib/src/publishers/pgyer/app_package_publisher_pgyer.dart @@ -70,8 +70,11 @@ class AppPackagePublisherPgyer extends AppPackagePublisher { /// [tokenInfo] token信息 /// [file] 文件 /// [onPublishProgress] 进度回调 - Future uploadApp(Response tokenInfo, File file, - PublishProgressCallback? onPublishProgress) async { + Future uploadApp( + Response tokenInfo, + File file, + PublishProgressCallback? onPublishProgress, + ) async { var tokenData = tokenInfo.data['data']; String endpoint = tokenData['endpoint']; String key = tokenData['key']; @@ -111,7 +114,7 @@ class AppPackagePublisherPgyer extends AppPackagePublisher { if (tryCount > maxTryCount) { throw PublishError('getBuildInfo error :Too many retries'); } - await Future.delayed(Duration(seconds: 3)); + await Future.delayed(const Duration(seconds: 3)); try { Response response = await _dio.get( 'https://www.pgyer.com/apiv2/app/buildInfo', diff --git a/packages/flutter_app_publisher/lib/src/publishers/playstore/publish_playstore_config.dart b/packages/flutter_app_publisher/lib/src/publishers/playstore/publish_playstore_config.dart index 88e7ed5f..a490ff18 100644 --- a/packages/flutter_app_publisher/lib/src/publishers/playstore/publish_playstore_config.dart +++ b/packages/flutter_app_publisher/lib/src/publishers/playstore/publish_playstore_config.dart @@ -19,7 +19,8 @@ class PublishPlayStoreConfig extends PublishConfig { if ((credentialsFile ?? '').isEmpty) { throw PublishError( - 'Missing `$kEnvPlayStoreCredentialsFile` environment variable.'); + 'Missing `$kEnvPlayStoreCredentialsFile` environment variable.', + ); } PublishPlayStoreConfig publishConfig = PublishPlayStoreConfig( credentialsFile: credentialsFile!, diff --git a/packages/flutter_app_publisher/lib/src/publishers/vercel/app_package_publisher_vercel.dart b/packages/flutter_app_publisher/lib/src/publishers/vercel/app_package_publisher_vercel.dart index d62a11e2..7de3cf5c 100644 --- a/packages/flutter_app_publisher/lib/src/publishers/vercel/app_package_publisher_vercel.dart +++ b/packages/flutter_app_publisher/lib/src/publishers/vercel/app_package_publisher_vercel.dart @@ -29,10 +29,12 @@ class AppPackagePublisherVercel extends AppPackagePublisher { try { File file = File('${directory.path}/.vercel/project.json'); file.createSync(recursive: true); - file.writeAsStringSync(json.encode({ - 'orgId': publishConfig.orgId, - 'projectId': publishConfig.projectId, - })); + file.writeAsStringSync( + json.encode({ + 'orgId': publishConfig.orgId, + 'projectId': publishConfig.projectId, + }), + ); ProcessResult r = await $( 'vercel', ['--prod'], diff --git a/packages/flutter_distributor/bin/command_package.dart b/packages/flutter_distributor/bin/command_package.dart index 0cff9d1c..9eef4401 100644 --- a/packages/flutter_distributor/bin/command_package.dart +++ b/packages/flutter_distributor/bin/command_package.dart @@ -86,7 +86,7 @@ class CommandPackage extends Command { valueHelp: 'foo=bar', help: [ 'The --dart-define argument(s) passed to \'flutter build\'', - 'You may add multiple \'--build-dart-define key=value\' pairs' + 'You may add multiple \'--build-dart-define key=value\' pairs', ].join('\n'), ); } @@ -101,7 +101,7 @@ class CommandPackage extends Command { 'Package the current Flutter application', '', 'Options named --build-* are passed to \'flutter build\' as is', - 'Please consult the \'flutter build\' CLI help for more informations.' + 'Please consult the \'flutter build\' CLI help for more informations.', ].join('\n'); @override diff --git a/packages/flutter_distributor/lib/src/flutter_distributor.dart b/packages/flutter_distributor/lib/src/flutter_distributor.dart index d5a098b0..aff7eda4 100644 --- a/packages/flutter_distributor/lib/src/flutter_distributor.dart +++ b/packages/flutter_distributor/lib/src/flutter_distributor.dart @@ -1,7 +1,6 @@ import 'dart:convert'; import 'dart:io'; -import 'package:app_package_maker/app_package_maker.dart'; import 'package:app_package_publisher/app_package_publisher.dart'; import 'package:flutter_app_builder/flutter_app_builder.dart'; import 'package:flutter_app_packager/flutter_app_packager.dart'; @@ -157,7 +156,9 @@ class FlutterDistributor { arguments: buildArguments, environment: variables ?? globalVariables, ); - print(JsonEncoder.withIndent(' ').convert(buildResult.toJson())); + print( + const JsonEncoder.withIndent(' ').convert(buildResult.toJson()), + ); logger.info( 'Successfully built ${buildResult.outputDirectory} in ${buildResult.duration!.inSeconds}s' .brightGreen(), @@ -187,7 +188,9 @@ class FlutterDistributor { buildOutputDirectory: buildResult.outputDirectory, buildOutputFiles: buildResult.outputFiles, ); - print(JsonEncoder.withIndent(' ').convert(makeResult.toJson())); + print( + const JsonEncoder.withIndent(' ').convert(makeResult.toJson()), + ); FileSystemEntity artifact = makeResult.artifacts.first; logger.info( 'Successfully packaged ${artifact.path}'.brightGreen(), diff --git a/packages/flutter_distributor/pubspec.lock b/packages/flutter_distributor/pubspec.lock index 751f5911..0a182f39 100644 --- a/packages/flutter_distributor/pubspec.lock +++ b/packages/flutter_distributor/pubspec.lock @@ -33,13 +33,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.1" - app_package_maker: - dependency: "direct main" - description: - path: "../app_package_maker" - relative: true - source: path - version: "0.3.6" app_package_parser: dependency: "direct overridden" description: diff --git a/packages/flutter_distributor/pubspec.yaml b/packages/flutter_distributor/pubspec.yaml index b762fcfd..f33c3782 100644 --- a/packages/flutter_distributor/pubspec.yaml +++ b/packages/flutter_distributor/pubspec.yaml @@ -15,7 +15,6 @@ environment: dependencies: ansicolor: ^2.0.1 - app_package_maker: ^0.3.6 app_package_publisher: ^0.3.6 args: ^2.2.0 charset: ^2.0.1 diff --git a/packages/parse_app_package/bin/main.dart b/packages/parse_app_package/bin/main.dart index 21a536cc..00a0d01f 100644 --- a/packages/parse_app_package/bin/main.dart +++ b/packages/parse_app_package/bin/main.dart @@ -4,7 +4,7 @@ import 'dart:io'; import 'package:args/args.dart'; import 'package:parse_app_package/parse_app_package.dart'; -JsonEncoder _encoder = JsonEncoder.withIndent(' '); +JsonEncoder _encoder = const JsonEncoder.withIndent(' '); Future main(List args) async { ArgParser argParser = ArgParser(); diff --git a/packages/shell_executor/lib/src/utils/path_expansion.dart b/packages/shell_executor/lib/src/utils/path_expansion.dart index 71e8a69c..3e1bf593 100644 --- a/packages/shell_executor/lib/src/utils/path_expansion.dart +++ b/packages/shell_executor/lib/src/utils/path_expansion.dart @@ -9,7 +9,7 @@ String pathExpansion( final matches = [ ...RegExp(r'\$(\w+)').allMatches(path), - ...RegExp(r'\$\{(\w+)\}').allMatches(path) + ...RegExp(r'\$\{(\w+)\}').allMatches(path), ]; for (final match in matches) { final envName = match.group(1); diff --git a/packages/shell_uikit/lib/src/progress_bar.dart b/packages/shell_uikit/lib/src/progress_bar.dart index 1f209faa..85eac4fa 100644 --- a/packages/shell_uikit/lib/src/progress_bar.dart +++ b/packages/shell_uikit/lib/src/progress_bar.dart @@ -45,7 +45,7 @@ class ProgressBar { // set flag isActive = true; - timer = Timer.periodic(Duration(milliseconds: 10), (_) { + timer = Timer.periodic(const Duration(milliseconds: 10), (_) { render(); if (!isActive && timer?.isActive == true) { timer?.cancel(); @@ -94,10 +94,12 @@ class ProgressBar { String percentage = (value * 100 / total).toStringAsFixed(1); stdout.write('\r'); - stdout.write(format - .replaceAll('{bar}', bar) - .replaceAll('{percentage}', percentage) - .replaceAll('{value}', '$value') - .replaceAll('{total}', '$total')); + stdout.write( + format + .replaceAll('{bar}', bar) + .replaceAll('{percentage}', percentage) + .replaceAll('{value}', '$value') + .replaceAll('{total}', '$total'), + ); } }