Skip to content

Commit

Permalink
chore: Remove fvm
Browse files Browse the repository at this point in the history
  • Loading branch information
holzeis committed May 29, 2024
1 parent 521070b commit cacb804
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 145 deletions.
45 changes: 0 additions & 45 deletions .github/actions/setup-fvm/action.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .github/workflows/android-fastlane.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ jobs:
- name: List used Xcode version
run: /usr/bin/xcodebuild -version

- uses: ./.github/actions/setup-fvm
with:
fvm_config: ./mobile/.fvmrc
working_dir: ./mobile

- name: Install just
run: cargo install just --force

Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ jobs:
- name: Setup rust toolchain
run: rustup show
- uses: Swatinem/rust-cache@v2.2.0
- uses: ./.github/actions/setup-fvm
with:
fvm_config: ./mobile/.fvmrc
working_dir: ./mobile
- name: Install FFI bindings
run: just deps-gen
- name: Generate FFI bindings
Expand Down Expand Up @@ -90,15 +86,6 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: extractions/setup-just@v1
- uses: ./.github/actions/setup-fvm
with:
fvm_config: ./mobile/.fvmrc
working_dir: ./mobile

- uses: ./.github/actions/setup-fvm
with:
fvm_config: ./webapp/frontend/.fvmrc
working_dir: ./webapp/frontend
- name: Download Dart mocks directory
uses: actions/download-artifact@v2
with:
Expand All @@ -125,10 +112,6 @@ jobs:
- name: Setup rust toolchain
run: rustup show
- uses: Swatinem/rust-cache@v2.2.0
- uses: ./.github/actions/setup-fvm
with:
fvm_config: ./mobile/.fvmrc
working_dir: ./mobile
- name: Download Rust generated FFI flutter bindings
uses: actions/download-artifact@v2
with:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ jobs:
- uses: extractions/setup-just@v1
if: matrix.bin == 'webapp'

- uses: ./.github/actions/setup-fvm
with:
fvm_config: ./webapp/frontend/.fvmrc
working_dir: ./webapp/frontend

- name: build flutter for webapp
if: matrix.bin == 'webapp'
run: just build-web --release
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/ios-fastlane.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ jobs:
- name: List used Xcode version
run: /usr/bin/xcodebuild -version

- uses: ./.github/actions/setup-fvm
with:
fvm_config: ./mobile/.fvmrc
working_dir: ./mobile

- name: Check cocoapods version
run: /usr/local/bin/pod --version
- name: Re-install cocoapods
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/testflight-for-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ jobs:
- name: List used Xcode version
run: /usr/bin/xcodebuild -version

- uses: ./.github/actions/setup-fvm
with:
fvm_config: ./mobile/.fvmrc
working_dir: ./mobile

- name: Check cocoapods version
run: /usr/local/bin/pod --version
- name: Re-install cocoapods
Expand Down
13 changes: 0 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
To begin, ensure that you have a working installation of the following items:

- [Docker](https://docs.docker.com/) and docker-compose
- [Flutter Version Manager (FVM)](https://fvm.app/)
- [Rust language](https://rustup.rs/)
- Appropriate [Rust targets](https://rust-lang.github.io/rustup/cross-compilation.html) for cross-compiling to your device
- For Android targets:
Expand All @@ -28,18 +27,6 @@ echo "ANDROID_NDK=.." >> ~/.gradle/gradle.properties
- XCode
- Cocoapods

## FVM (Flutter Version Manager)

We use FVM to be able to easily switch between different Flutter versions.
Make sure to install it locally.
Once installed, you can use your favorite flutter commands as before, just add `fvm` before, e.g.

```bash
fvm flutter run
```

You can see whether you have all the sufficient dependencies for your platform by running `flutter doctor`.

## Contributing

We encourage community contributions whether it be a bug fix or an improvement to the documentation.
Expand Down
46 changes: 20 additions & 26 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,12 @@ deps-ios:
cargo install cargo-lipo
rustup target add aarch64-apple-ios x86_64-apple-ios

gen flutter_channel="":
gen:
#!/usr/bin/env bash
set -euxo pipefail
cd mobile
if [ -n "{{flutter_channel}}" ]; then
echo "Flutter channel is set to: {{flutter_channel}}"
fvm spawn {{flutter_channel}} pub get
else
echo "Flutter channel is default"
fvm flutter pub get
fi
flutter pub get

RUST_LOG={{ rust_log_for_frb }} flutter_rust_bridge_codegen \
--rust-input native/src/api.rs \
Expand All @@ -90,13 +84,13 @@ android-release:

# Build flutter webapp for cargo run --bin webapp
build-web args="":
cd webapp/frontend && fvm flutter build web {{args}}
cd webapp/frontend && flutter build web {{args}}

build-web-release:
cd webapp/frontend && fvm flutter build web --release
cd webapp/frontend && flutter build web --release

run-web:
cd webapp/frontend && fvm flutter run -d chrome --web-browser-flag "--disable-web-security"
cd webapp/frontend && flutter run -d chrome --web-browser-flag "--disable-web-security"

run-web-backend:
cargo run --bin web
Expand All @@ -115,7 +109,7 @@ ios-release:
run args="":
#!/usr/bin/env bash
cd mobile && \
fvm flutter run {{args}} \
flutter run {{args}} \
--dart-define="COMMIT=$(git rev-parse HEAD)" \
--dart-define="BRANCH=$(git rev-parse --abbrev-ref HEAD)" \
--dart-define="REGTEST_FAUCET=http://localhost:8080" \
Expand All @@ -126,7 +120,7 @@ run args="":
run-regtest args="":
#!/usr/bin/env bash
cd mobile && \
fvm flutter run {{args}} \
flutter run {{args}} \
--dart-define="COMMIT=$(git rev-parse HEAD)" \
--dart-define="BRANCH=$(git rev-parse --abbrev-ref HEAD)" \
--dart-define="ELECTRS_ENDPOINT={{public_regtest_electrs}}" \
Expand All @@ -140,7 +134,7 @@ run-regtest args="":
run-mainnet args="":
#!/usr/bin/env bash
cd mobile && \
fvm flutter run {{args}} \
flutter run {{args}} \
--dart-define="COMMIT=$(git rev-parse HEAD)" \
--dart-define="BRANCH=$(git rev-parse --abbrev-ref HEAD)" \
--dart-define="ELECTRS_ENDPOINT=http://api.10101.finance:3000" \
Expand All @@ -155,7 +149,7 @@ run-mainnet args="":
run-regtest-android args="":
#!/usr/bin/env bash
cd mobile && \
fvm flutter run {{args}} \
flutter run {{args}} \
--dart-define="COMMIT=$(git rev-parse HEAD)" \
--dart-define="BRANCH=$(git rev-parse --abbrev-ref HEAD)" \
--dart-define="ELECTRS_ENDPOINT={{public_regtest_electrs}}" \
Expand All @@ -172,7 +166,7 @@ run-local-android args="":
LOCAL_IP=$({{get_local_ip}})
echo "Android app will connect to $LOCAL_IP for 10101 services"
cd mobile && \
fvm flutter run {{args}} \
flutter run {{args}} \
--dart-define="COMMIT=$(git rev-parse HEAD)" \
--dart-define="BRANCH=$(git rev-parse --abbrev-ref HEAD)" \
--dart-define="ELECTRS_ENDPOINT=http://${LOCAL_IP}:3000" \
Expand All @@ -195,7 +189,7 @@ clean:
set -euxo pipefail
cd mobile
rm -rf mobile/android/app/src/main/jniLibs/*
fvm flutter clean
flutter clean
cd native && cargo clean
# Wipes everything
Expand Down Expand Up @@ -282,8 +276,8 @@ cargo-clippy:
cargo clippy --all-targets -- -D warnings

lint-flutter:
cd mobile && fvm flutter analyze --fatal-infos .
cd webapp/frontend && fvm flutter analyze --fatal-infos .
cd mobile && flutter analyze --fatal-infos .
cd webapp/frontend && flutter analyze --fatal-infos .

alias flutter-lint := lint-flutter

Expand Down Expand Up @@ -327,7 +321,7 @@ lnd-mock:
cargo run --package lnd-bridge --example mock

flutter-test:
cd mobile && fvm flutter pub run build_runner build --delete-conflicting-outputs && fvm flutter test
cd mobile && flutter pub run build_runner build --delete-conflicting-outputs && flutter test

# Tests for the `native` crate
native-test:
Expand Down Expand Up @@ -520,7 +514,7 @@ build-ipa args="":
args+=(--flavor test)
fi

cd mobile && fvm flutter build ipa "${args[@]}" \
cd mobile && flutter build ipa "${args[@]}" \
--dart-define="ELECTRS_ENDPOINT=${ELECTRS_ENDPOINT}" \
--dart-define="COORDINATOR_P2P_ENDPOINT=${COORDINATOR_P2P_ENDPOINT}" \
--dart-define="NETWORK=${NETWORK}" \
Expand All @@ -547,15 +541,15 @@ publish-testflight-fastlane:
release-testflight: gen ios build-ipa publish-testflight

version:
cargo --version && rustc --version && fvm flutter --version
cargo --version && rustc --version && flutter --version

build-apk-regtest:
#!/usr/bin/env bash
BUILD_NAME=$(yq -r .version {{pubspec}})
BUILD_NUMBER=$(git rev-list HEAD --count)
echo "build name: ${BUILD_NAME}"
echo "build number: ${BUILD_NUMBER}"
cd mobile && fvm flutter build apk \
cd mobile && flutter build apk \
--build-name=${BUILD_NAME} \
--build-number=${BUILD_NUMBER} \
--release \
Expand All @@ -577,7 +571,7 @@ build-app-bundle-regtest:
BUILD_NUMBER=$(git rev-list HEAD --count)
echo "build name: ${BUILD_NAME}"
echo "build number: ${BUILD_NUMBER}"
cd mobile && fvm flutter build appbundle \
cd mobile && flutter build appbundle \
--build-name=${BUILD_NAME} \
--build-number=${BUILD_NUMBER} \
--release \
Expand Down Expand Up @@ -610,7 +604,7 @@ build-android-app-bundle:
os={{os()}}
echo "building on '$os' for '$NETWORK'"

cd mobile && fvm flutter build appbundle \
cd mobile && flutter build appbundle \
--build-name=${BUILD_NAME} \
--build-number=${BUILD_NUMBER} \
--release \
Expand Down Expand Up @@ -643,7 +637,7 @@ build-android-app-apk args="":
os={{os()}}
echo "building on '$os' for '$NETWORK'"

cd mobile && fvm flutter build apk {{args}} \
cd mobile && flutter build apk {{args}} \
--build-name=${BUILD_NAME} \
--build-number=${BUILD_NUMBER} \
--release \
Expand Down
3 changes: 0 additions & 3 deletions mobile/.fvmrc

This file was deleted.

Loading

0 comments on commit cacb804

Please sign in to comment.