From 04f2a1de146b17d832c09c3cad0133e7bc789bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=81=A5=E8=8E=B9?= Date: Sun, 1 Sep 2024 11:32:40 +0800 Subject: [PATCH] wip: Add any_app_packager & any_app_publisher --- packages/any_app_packager/.gitignore | 6 +++++ packages/any_app_packager/CHANGELOG.md | 3 +++ packages/any_app_packager/LICENSE | 21 +++++++++++++++ packages/any_app_packager/README.md | 10 +++++++ .../any_app_packager/analysis_options.yaml | 5 ++++ packages/any_app_packager/bin/main.dart | 3 +++ .../lib/any_app_packager.dart | 3 +++ .../lib/src/any_app_packager.dart | 26 +++++++++++++++++++ packages/any_app_packager/pubspec.yaml | 18 +++++++++++++ packages/any_app_publisher/.gitignore | 4 +++ packages/any_app_publisher/CHANGELOG.md | 3 +++ packages/any_app_publisher/LICENSE | 21 +++++++++++++++ packages/any_app_publisher/README.md | 10 +++++++ .../any_app_publisher/analysis_options.yaml | 5 ++++ packages/any_app_publisher/bin/main.dart | 3 +++ .../lib/any_app_publisher.dart | 3 +++ .../lib/src/any_app_publisher.dart | 24 +++++++++++++++++ packages/any_app_publisher/pubspec.yaml | 18 +++++++++++++ 18 files changed, 186 insertions(+) create mode 100644 packages/any_app_packager/.gitignore create mode 100644 packages/any_app_packager/CHANGELOG.md create mode 100644 packages/any_app_packager/LICENSE create mode 100644 packages/any_app_packager/README.md create mode 100644 packages/any_app_packager/analysis_options.yaml create mode 100644 packages/any_app_packager/bin/main.dart create mode 100644 packages/any_app_packager/lib/any_app_packager.dart create mode 100644 packages/any_app_packager/lib/src/any_app_packager.dart create mode 100644 packages/any_app_packager/pubspec.yaml create mode 100644 packages/any_app_publisher/.gitignore create mode 100644 packages/any_app_publisher/CHANGELOG.md create mode 100644 packages/any_app_publisher/LICENSE create mode 100644 packages/any_app_publisher/README.md create mode 100644 packages/any_app_publisher/analysis_options.yaml create mode 100644 packages/any_app_publisher/bin/main.dart create mode 100644 packages/any_app_publisher/lib/any_app_publisher.dart create mode 100644 packages/any_app_publisher/lib/src/any_app_publisher.dart create mode 100644 packages/any_app_publisher/pubspec.yaml diff --git a/packages/any_app_packager/.gitignore b/packages/any_app_packager/.gitignore new file mode 100644 index 00000000..7d8bb591 --- /dev/null +++ b/packages/any_app_packager/.gitignore @@ -0,0 +1,6 @@ +.dart_tool/ +.packages +build/ +pubspec.lock # Except for application packages +.flutter-plugins +.flutter-plugins-dependencies diff --git a/packages/any_app_packager/CHANGELOG.md b/packages/any_app_packager/CHANGELOG.md new file mode 100644 index 00000000..60732342 --- /dev/null +++ b/packages/any_app_packager/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.1.0 + +* Initial release. diff --git a/packages/any_app_packager/LICENSE b/packages/any_app_packager/LICENSE new file mode 100644 index 00000000..083c92d0 --- /dev/null +++ b/packages/any_app_packager/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024-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/any_app_packager/README.md b/packages/any_app_packager/README.md new file mode 100644 index 00000000..85da1bf6 --- /dev/null +++ b/packages/any_app_packager/README.md @@ -0,0 +1,10 @@ +# any_app_packager + +[![pub version][pub-image]][pub-url] + +[pub-image]: https://img.shields.io/pub/v/any_app_packager.svg +[pub-url]: https://pub.dev/packages/any_app_packager + +--- + +Part of [fastforge](https://github.com/fastforgedev), See also https://fastforge.dev diff --git a/packages/any_app_packager/analysis_options.yaml b/packages/any_app_packager/analysis_options.yaml new file mode 100644 index 00000000..d42ee439 --- /dev/null +++ b/packages/any_app_packager/analysis_options.yaml @@ -0,0 +1,5 @@ +include: package:mostly_reasonable_lints/analysis_options.yaml + +linter: + rules: + avoid_print: false diff --git a/packages/any_app_packager/bin/main.dart b/packages/any_app_packager/bin/main.dart new file mode 100644 index 00000000..72267c4f --- /dev/null +++ b/packages/any_app_packager/bin/main.dart @@ -0,0 +1,3 @@ +void main() { + print('any_app_packager is still under development'); +} diff --git a/packages/any_app_packager/lib/any_app_packager.dart b/packages/any_app_packager/lib/any_app_packager.dart new file mode 100644 index 00000000..fe2cb7e8 --- /dev/null +++ b/packages/any_app_packager/lib/any_app_packager.dart @@ -0,0 +1,3 @@ +library any_app_packager; + +export 'src/any_app_packager.dart'; diff --git a/packages/any_app_packager/lib/src/any_app_packager.dart b/packages/any_app_packager/lib/src/any_app_packager.dart new file mode 100644 index 00000000..ee2da201 --- /dev/null +++ b/packages/any_app_packager/lib/src/any_app_packager.dart @@ -0,0 +1,26 @@ +import 'dart:io'; + +import 'package:flutter_app_packager/flutter_app_packager.dart'; + +class AnyAppPackager { + final FlutterAppPackager _flutterAppPackager = FlutterAppPackager(); + + /// Packages the app for the given platform and target. + Future package( + String platform, + String target, + Map? arguments, + Directory outputDirectory, { + required Directory buildOutputDirectory, + required List buildOutputFiles, + }) { + return _flutterAppPackager.package( + platform, + target, + arguments, + outputDirectory, + buildOutputDirectory: buildOutputDirectory, + buildOutputFiles: buildOutputFiles, + ); + } +} diff --git a/packages/any_app_packager/pubspec.yaml b/packages/any_app_packager/pubspec.yaml new file mode 100644 index 00000000..f83d181d --- /dev/null +++ b/packages/any_app_packager/pubspec.yaml @@ -0,0 +1,18 @@ +name: any_app_packager +description: Package your any app into OS-specific bundles (.dmg, .exe, etc.) via Dart or the command line. +version: 0.1.0 +homepage: https://fastforge.dev/any_app_packager +repository: https://github.com/leanflutter/flutter_distributor/tree/main/packages/any_app_packager + +environment: + sdk: ">=2.16.0 <4.0.0" + +dependencies: + flutter_app_packager: ^0.4.5 + +dev_dependencies: + dependency_validator: ^3.0.0 + mostly_reasonable_lints: ^0.1.2 + +executables: + packageanyapp: main diff --git a/packages/any_app_publisher/.gitignore b/packages/any_app_publisher/.gitignore new file mode 100644 index 00000000..227ea1b7 --- /dev/null +++ b/packages/any_app_publisher/.gitignore @@ -0,0 +1,4 @@ +.dart_tool/ +.packages +build/ +pubspec.lock # Except for application packages \ No newline at end of file diff --git a/packages/any_app_publisher/CHANGELOG.md b/packages/any_app_publisher/CHANGELOG.md new file mode 100644 index 00000000..60732342 --- /dev/null +++ b/packages/any_app_publisher/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.1.0 + +* Initial release. diff --git a/packages/any_app_publisher/LICENSE b/packages/any_app_publisher/LICENSE new file mode 100644 index 00000000..083c92d0 --- /dev/null +++ b/packages/any_app_publisher/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024-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/any_app_publisher/README.md b/packages/any_app_publisher/README.md new file mode 100644 index 00000000..d2f1704f --- /dev/null +++ b/packages/any_app_publisher/README.md @@ -0,0 +1,10 @@ +# any_app_publisher + +[![pub version][pub-image]][pub-url] + +[pub-image]: https://img.shields.io/pub/v/any_app_publisher.svg +[pub-url]: https://pub.dev/packages/any_app_publisher + +--- + +Part of [fastforge](https://github.com/fastforgedev), See also https://fastforge.dev diff --git a/packages/any_app_publisher/analysis_options.yaml b/packages/any_app_publisher/analysis_options.yaml new file mode 100644 index 00000000..d42ee439 --- /dev/null +++ b/packages/any_app_publisher/analysis_options.yaml @@ -0,0 +1,5 @@ +include: package:mostly_reasonable_lints/analysis_options.yaml + +linter: + rules: + avoid_print: false diff --git a/packages/any_app_publisher/bin/main.dart b/packages/any_app_publisher/bin/main.dart new file mode 100644 index 00000000..868a9d79 --- /dev/null +++ b/packages/any_app_publisher/bin/main.dart @@ -0,0 +1,3 @@ +void main() { + print('any_app_publisher is still under development'); +} diff --git a/packages/any_app_publisher/lib/any_app_publisher.dart b/packages/any_app_publisher/lib/any_app_publisher.dart new file mode 100644 index 00000000..cd6ffcdf --- /dev/null +++ b/packages/any_app_publisher/lib/any_app_publisher.dart @@ -0,0 +1,3 @@ +library any_app_publisher; + +export 'src/any_app_publisher.dart'; diff --git a/packages/any_app_publisher/lib/src/any_app_publisher.dart b/packages/any_app_publisher/lib/src/any_app_publisher.dart new file mode 100644 index 00000000..5120b22e --- /dev/null +++ b/packages/any_app_publisher/lib/src/any_app_publisher.dart @@ -0,0 +1,24 @@ +import 'dart:io'; + +import 'package:flutter_app_publisher/flutter_app_publisher.dart'; + +class AnyAppPublisher { + final FlutterAppPublisher _flutterAppPublisher = FlutterAppPublisher(); + + /// Publishes the app for the given target. + Future publish( + FileSystemEntity fileSystemEntity, { + required String target, + Map? environment, + Map? publishArguments, + PublishProgressCallback? onPublishProgress, + }) async { + return _flutterAppPublisher.publish( + fileSystemEntity, + target: target, + environment: environment, + publishArguments: publishArguments, + onPublishProgress: onPublishProgress, + ); + } +} diff --git a/packages/any_app_publisher/pubspec.yaml b/packages/any_app_publisher/pubspec.yaml new file mode 100644 index 00000000..82dfcd4a --- /dev/null +++ b/packages/any_app_publisher/pubspec.yaml @@ -0,0 +1,18 @@ +name: any_app_publisher +description: Publish your any app into popular testing or distribution platforms via Dart or the command line. +version: 0.1.0 +homepage: https://fastforge.dev/any_app_publisher +repository: https://github.com/leanflutter/flutter_distributor/tree/main/packages/any_app_publisher + +environment: + sdk: ">=2.16.0 <4.0.0" + +dependencies: + flutter_app_publisher: ^0.4.5 + +dev_dependencies: + dependency_validator: ^3.0.0 + mostly_reasonable_lints: ^0.1.2 + +executables: + publishanyapp: main