-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Android justfile #238
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a7dc715
chore: Android justfile
raphaelrobert 1efbf57
Revert dep upgrades
raphaelrobert ad1be54
Add Just to CI
raphaelrobert 238821a
Fix leftovers from makefile
raphaelrobert 40fee7d
Try to reclaim some disk space
raphaelrobert 6f7aeea
Remove debug mode
raphaelrobert 20b88e2
Adjust action
raphaelrobert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
|
||
export DATABASE_URL := "postgres://postgres:password@localhost:5432/phnx_db" | ||
|
||
# === Backend === | ||
|
||
# run postgres via docker compose and apply migrations | ||
init-db: generate-db-certs | ||
docker compose up --wait | ||
|
@@ -14,6 +16,47 @@ init-db: generate-db-certs | |
generate-db-certs: | ||
cd backend && TEST_CERT_DIR_NAME=test_certs scripts/generate_test_certs.sh | ||
|
||
# === App === | ||
|
||
app_dir := "prototype" | ||
app_lib_name := "applogic" | ||
app_rust_base_dir := app_lib_name | ||
|
||
# generate Rust and Dart flutter bridge files | ||
generate-flutter-ffi: | ||
cd prototype && make frb-generate | ||
frb-generate: | ||
rm -f {{app_rust_base_dir}}/src/frb_*.rs | ||
touch {{app_rust_base_dir}}/src/frb_generated.rs | ||
mkdir -p {{app_dir}}/lib/core | ||
rm -Rf {{app_dir}}/lib/core/* | ||
cd {{app_dir}} && flutter pub get | ||
cd {{app_dir}} && flutter_rust_bridge_codegen generate | ||
cd {{app_dir}} && flutter clean | ||
|
||
# integrate the Flutter Rust bridge | ||
frb-integrate: | ||
cd {{app_dir}} && mv flutter_rust_bridge.yaml flutter_rust_bridge.yaml.tmp | ||
cd {{app_dir}} && rm -Rf rust_builder test_driver | ||
cd {{app_dir}} && flutter_rust_bridge_codegen integrate --rust-crate-name phnxapplogic --rust-crate-dir ../{{app_rust_base_dir}} | ||
cd {{app_dir}} && git restore --source=HEAD --staged --worktree ../{{app_rust_base_dir}} lib | ||
cd {{app_dir}} && git clean -fd ../{{app_rust_base_dir}} lib | ||
cd {{app_dir}} && mv flutter_rust_bridge.yaml flutter_rust_bridge.yaml.generated.tmp | ||
cd {{app_dir}} && echo "# This is only to inspect the generated flutter_rust_bridge.yaml file. Remove if not needed.\n" > /tmp/header.tmp | ||
cd {{app_dir}} && cat /tmp/header.tmp flutter_rust_bridge.yaml.generated.tmp > flutter_rust_bridge.yaml.generated | ||
cd {{app_dir}} && mv flutter_rust_bridge.yaml.tmp flutter_rust_bridge.yaml | ||
cd {{app_dir}} && rm flutter_rust_bridge.yaml.generated.tmp | ||
just frb-generate | ||
|
||
# set up the CI environment for the app | ||
setup-ci: | ||
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash | ||
cargo binstall -y [email protected] cargo-expand | ||
|
||
# set up the CI environment for Android builds | ||
setup-android-ci: setup-ci | ||
cargo binstall -y cargo-ndk | ||
cd {{app_dir}}/fastlane && bundle install | ||
|
||
# build Android | ||
# we limit it to android-arm64 to speed up the build process | ||
build-android: | ||
cd {{app_dir}} && flutter build appbundle --target-platform android-arm64 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving here for reference: when casey/just#2438 is released, we can remove all
cd
s from here.