From 230a068d45ec5110448b552e6e03a98ae4c6513a Mon Sep 17 00:00:00 2001 From: Codel1417 Date: Wed, 15 May 2024 13:44:16 -0400 Subject: [PATCH] Readme updates --- README.md | 112 ++++++++++++++++++++++++++++++++--- Scripts/build.sh | 5 +- Scripts/build/.last_build_id | 1 - Scripts/launchBuild.sh | 4 ++ 4 files changed, 113 insertions(+), 9 deletions(-) delete mode 100644 Scripts/build/.last_build_id diff --git a/README.md b/README.md index 83dbea99..015fbfc9 100644 --- a/README.md +++ b/README.md @@ -2,30 +2,125 @@ ![Translation](https://img.shields.io/weblate/progress/tail_app?server=https%3A%2F%2Fweblate.codel1417.xyz&style=for-the-badge) ![Sponsor](https://img.shields.io/github/sponsors/codel1417?style=for-the-badge) -![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/codel1417/tail_app/build_apk.yml?style=for-the-badge) +![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/codel1417/tail_app/build.yml?style=for-the-badge) A Cross Platform Tail Company gear control App ## Features -- Support for the same actions/moves from Crumpet +- Supports Android and IOS +- Firmware Updates +- The same actions/moves from Crumpet - Triggers for walking, shaking and other gestures - Custom Actions -- Joystick for moving gear +- Joystick for manually moving gear - Dark Mode +- Color Themes +- Background mode on IOS -Google Play Services is required for android, so non Play Store Android devices are unsupported +> [!WARNING] +>Google Play Services is required for android, so non Play Store Android devices are unsupported ## Have a suggestion? Small or large, feel free to leave suggestions for new features, or changes to existing features. -- As long as the suggestion is not related to a specific day or event, or involves requesting/accessing personally identifying information +- As long as the suggestion is not related to a specific day or event -# Building +## Thanks + +- @darkgrue for helping me with gear firmware behavior & developing the firmware the Gear uses +- @MasterTailer for providing useful feedback and suggestions, and creating the gear this app controls +- @ToeiRei for inspiring me to use more privacy-preserving infrastructure like plausible. + +
+ +Development + +## Development + +### Requirements Follow the instructions here to set up a Flutter environment https://docs.flutter.dev/get-started/install/windows/mobile?tab=download#software-requirements +- [Android Studio](https://developer.android.com/studio) + - [Flutter Plugin](https://plugins.jetbrains.com/plugin/9212-flutter) + - [Dart Plugin](https://plugins.jetbrains.com/plugin/6351-dart) + - [Flutter Enhancement Suite (Recommended)](https://plugins.jetbrains.com/plugin/12693-flutter-enhancement-suite) +- [Java `17` (For Android)](https://adoptium.net/temurin/releases/?package=jdk&version=17) +- [XCode `15` (For IOS)](https://developer.apple.com/xcode/) with IOS & CLI Tools installed +- [CocoaPods (For IOS)](https://cocoapods.org/) +- [Flutter SDK `3.22.0`](https://docs.flutter.dev/get-started/install) +- Bash (Windows & Linux) or ZSH (MacOS) +- [Git](https://git-scm.com/downloads) + +### Building + +#### Preparing for build + +> [!TIP] +> A pre-made build script exists at [`scripts/build,sh`](Scripts/build.sh) + +> [!IMPORTANT] +> These commands must be run before building or running. + +```shell +flutter pub get +flutter gen-l10n +dart run intl_translation:generate_from_arb --output-dir=lib/l10n --no-use-deferred-loading lib/Frontend/intn_defs.dart lib/l10n/*.arb +flutter pub run build_runner build --delete-conflicting-outputs +``` + +- To generate base EN localalization file, run + +```shell +dart run intl_translation:extract_to_arb --locale=en --output-file='./lib/l10n/messages_en.arb' ./lib/Frontend/intn_defs.dart +``` + +- To build localization files, run + +```shell +flutter gen-l10n && dart run intl_translation:generate_from_arb --output-dir=lib/l10n --no-use-deferred-loading lib/Frontend/intn_defs.dart lib/l10n/*.arb +``` + +- To build generated `.g` files, run + +```shell +flutter pub run build_runner build --delete-conflicting-outputs +``` + +- If you get a flutter version error, run + +```shell +flutter Upgrade +``` + +#### Building for each platform + +##### For IOS + +```shell +cd ios +rm Podfile.lock # Handles a CocoaPods error about version management +pod install +cd .. +flutter build ipa --debug --no-codesign +``` + +> [!WARNING] +> If CocoaPods returns a version error, delete [`ios/Podfile.lock`](ios/Podfile.lock) + +##### For Android + +```shell +# Build APK +flutter build apk --debug --dart-define=cronetHttpNoPlay=true +# build AppBundle +flutter build appbundle --debug --dart-define=cronetHttpNoPlay=true +``` + +App packages can be found in [`build/app/output`](build/app/outputs/) + ## Dev Features - Gear console @@ -38,6 +133,7 @@ Follow the instructions here to set up a Flutter environment https://docs.flutte Long press Github button, enter the following code 🦊🐉🦦🦖 +
### Internal URLS @@ -46,4 +142,6 @@ Long press Github button, enter the following code [Plausible](https://plausible.codel1417.xyz/tail-app) [Uptime](https://uptime.codel1417.xyz/status/public) -UUIDs were generated using https://www.uuidgenerator.net/version4 +### Misc + +UUIDs were generated using https://www.uuidgenerator.net/version4 \ No newline at end of file diff --git a/Scripts/build.sh b/Scripts/build.sh index 5d2d6af5..2ada4382 100644 --- a/Scripts/build.sh +++ b/Scripts/build.sh @@ -4,6 +4,7 @@ set -x if [[ "$(pwd)" == *"/Scripts" ]]; then cd .. fi +# get the Build Bumber & version from git VERSION="$(cat VERSION)" BUILD_NUMBER="$(git rev-list HEAD --count)" # Gets the release tag from github if it exists (Github Actions) @@ -12,6 +13,8 @@ if [[ -v RELEASE_TAG ]] && [[ -n $RELEASE_TAG ]]; then TAG="${RELEASE_TAG,,}" VERSION="${TAG//"v"}" fi + +# Configure flutter & pre-build tasks flutter config --no-cli-animations flutter pub get flutter gen-l10n @@ -24,7 +27,7 @@ fi dart run intl_translation:generate_from_arb --output-dir=lib/l10n --no-use-deferred-loading lib/Frontend/intn_defs.dart lib/l10n/*.arb flutter pub run build_runner build --delete-conflicting-outputs if [[ ! -v SKIP_BUILD ]]; then - + # Build if [[ $OS == 'macos-latest' ]]; then cd ios pod install diff --git a/Scripts/build/.last_build_id b/Scripts/build/.last_build_id deleted file mode 100644 index 2c7279af..00000000 --- a/Scripts/build/.last_build_id +++ /dev/null @@ -1 +0,0 @@ -e728d5ba4e52068eb059d8c80cc8e750 \ No newline at end of file diff --git a/Scripts/launchBuild.sh b/Scripts/launchBuild.sh index a8a72315..4fb65fb2 100644 --- a/Scripts/launchBuild.sh +++ b/Scripts/launchBuild.sh @@ -1,6 +1,10 @@ #!/bin/bash set -e set -x + +# MacOS bash is outdated compared to the version shipped with ubuntu, and is missing some features used in the build script +# This changes the interpreter to zsh for MacOS and launches the build script + if [[ $OS == 'macos-latest' ]]; then interpreter=zsh else