feat: split project into app, common, cli

This commit is contained in:
Tien Do Nam
2023-09-27 21:51:49 +02:00
parent 7ae0e6bc0c
commit c77d89bcc7
410 changed files with 534 additions and 105 deletions

View File

@ -1,4 +1,4 @@
{
"flutterSdkVersion": "3.13.2",
"flutterSdkVersion": "3.13.5",
"flavors": {}
}

View File

@ -7,7 +7,7 @@ on:
branches: [main]
env:
FLUTTER_VERSION: "3.13.2"
FLUTTER_VERSION: "3.13.5"
jobs:
format:
@ -20,8 +20,10 @@ jobs:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
- name: Dependencies
working-directory: app
run: flutter pub get
- name: Check format
working-directory: app
run: dart format --line-length 150 --set-exit-if-changed lib test
test:
@ -34,10 +36,14 @@ jobs:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
- name: Dependencies
working-directory: app
run: flutter pub get
- name: Build generated files
working-directory: app
run: flutter pub run build_runner build -d
- name: Analyze
working-directory: app
run: flutter analyze
- name: Test
working-directory: app
run: flutter test

View File

@ -4,7 +4,7 @@ on:
workflow_dispatch:
env:
FLUTTER_VERSION: "3.13.2"
FLUTTER_VERSION: "3.13.5"
APK_BUILD_DIR: "/tmp/build"
jobs:
@ -18,6 +18,7 @@ jobs:
- name: Get version from pubspec.yaml
id: get_version
working-directory: app
run: |
VERSION=$(sed -n 's/^version: \([0-9]*\.[0-9]*\.[0-9]*\).*/\1/p' pubspec.yaml)
echo "version=$VERSION" >> $GITHUB_OUTPUT
@ -28,16 +29,18 @@ jobs:
channel: "stable"
- name: Dependencies
working-directory: app
run: flutter pub get
- name: Build generated files
working-directory: app
run: flutter pub run build_runner build -d
- name: Upload updated lib files with generated code
uses: actions/upload-artifact@v3
with:
name: lib-files
path: ./lib/*
path: ./app/lib/*
build_appimage:
needs: build
@ -50,7 +53,7 @@ jobs:
uses: actions/download-artifact@v3
with:
name: lib-files
path: lib
path: app/lib
- name: Install dependencies
run: |
@ -63,17 +66,21 @@ jobs:
channel: "stable"
- name: Dependencies
working-directory: app
run: flutter pub get
- name: Compile linux
working-directory: app
run: flutter build linux
- name: Copy compiled linux files
working-directory: app
run: |
mkdir AppDir
cp -r build/linux/x64/release/bundle/* AppDir/
- name: Copy logo to AppDir
working-directory: app
run: |
mkdir -p AppDir/usr/share/icons/hicolor/32x32/apps
cp assets/img/logo-32.png AppDir/usr/share/icons/hicolor/32x32/apps/localsend.png
@ -85,10 +92,10 @@ jobs:
- name: Build AppImage
uses: AppImageCrafters/build-appimage@57c3bc6963f870ce3be103117de5b5e33ffbaeb6
with:
recipe: ./AppImageBuilder.yml
recipe: ./app/AppImageBuilder.yml
- name: Upload AppImage file
uses: actions/upload-artifact@v3
with:
name: appimage-result
path: ./*.AppImage
path: ./app/*.AppImage

51
.gitignore vendored
View File

@ -1,57 +1,12 @@
/.fvm/flutter_sdk
.idea
# Linux AppImage
/AppDir
/appimage-build
/app/AppDir
/app/appimage-build
*.g.dart
*.gen.dart
*.freezed.dart
/secrets
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
/dist/
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release

View File

@ -1,45 +0,0 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
version:
revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
channel: stable
project_type: app
# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
- platform: android
create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
- platform: ios
create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
- platform: linux
create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
- platform: macos
create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
- platform: web
create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
- platform: windows
create_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
base_revision: b8f7f1f9869bb2d116aa6a70dbeac61000b52849
# User provided section
# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'

View File

@ -1 +1 @@
assets/CHANGELOG.md
app/assets/CHANGELOG.md

View File

@ -22,8 +22,8 @@ You can help translating this app to other languages!
1. Fork this repository
2. Choose one
- Add missing translations in existing languages: Only update `_missing_translations_<locale>.json` in [assets/i18n](https://github.com/localsend/localsend/tree/main/assets/i18n)
- Fix existing translations: Update `strings_<locale>.i18n.json` in [assets/i18n](https://github.com/localsend/localsend/tree/main/assets/i18n)
- Add missing translations in existing languages: Only update `_missing_translations_<locale>.json` in [assets/i18n](https://github.com/localsend/localsend/tree/main/app/assets/i18n)
- Fix existing translations: Update `strings_<locale>.i18n.json` in [assets/i18n](https://github.com/localsend/localsend/tree/main/app/assets/i18n)
- Add new languages: Create a new file, see also: [locale codes](https://saimana.com/list-of-country-locale-code/).
3. Optional: Re-run this app
1. Make sure you have [run](#run) this app once.

View File

@ -41,7 +41,7 @@ LocalSend is a cross-platform app that enables secure communication between devi
It is recommended to download the app either from an app store or from a package manager because the app does not have auto-update.
| Windows | macOS | Linux | Android | iOS | Fire OS |
| Windows | macOS | Linux | Android | iOS | Fire OS |
|--------------------------|-------------------------|--------------------|----------------|---------------|------------|
| [Winget][] | [App Store][] | [Flathub][] | [Play Store][] | [App Store][] | [Amazon][] |
| [Scoop][] | [Homebrew][] | [AUR][] | [F-Droid][] | | |
@ -106,7 +106,7 @@ You can help translating this app to other languages!
3. Run app via `flutter run`
4. Open a pull request
[i18n]: https://github.com/localsend/localsend/tree/main/assets/i18n
[i18n]: https://github.com/localsend/localsend/tree/main/app/assets/i18n
[locale codes]: https://saimana.com/list-of-country-locale-code/
#### _Take note:_ Fields decorated with `@` are not meant to be translated, they are not used in the app in any way, being merely informative text about the file or to give context to the translator.

45
app/.gitignore vendored Normal file
View File

@ -0,0 +1,45 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
/dist/
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 844 B

After

Width:  |  Height:  |  Size: 844 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Some files were not shown because too many files have changed in this diff Show More