Browse Source

Fixed android sample app; added TOOD.md

master
chodak166 2 days ago
parent
commit
411834b73e
  1. 3
      TODO.md
  2. 14
      dev-init/dev-init-rust.sh
  3. 5
      projects/README.md
  4. 13
      sample_projects/flutter_android_demo/build.sh

3
TODO.md

@ -0,0 +1,3 @@
## dev-flutter TODO
[ ] android sample app compiled during dev-init-android require dev-init-rust to be run first, make it rust-independent.

14
dev-init/dev-init-rust.sh

@ -2,22 +2,22 @@
set -e set -e
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/dev.env" source "$SCRIPT_DIR/dev.env"
mkdir -p ${RUSTUP_HOME} ${CARGO_HOME} 2>/dev/null ||: mkdir -p ${RUSTUP_HOME} ${CARGO_HOME} 2> /dev/null || :
cd /tmp cd /tmp
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
rustup default stable && rustup default stable
rustup update rustup update
rustup component add rustfmt clippy rustup component add rustfmt clippy
rustup target add wasm32-unknown-unknown rustup target add wasm32-unknown-unknown
rustup toolchain install nightly rustup toolchain install nightly
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
cargo install --version 2.6.0 flutter_rust_bridge_codegen cargo install --version 2.12.0 flutter_rust_bridge_codegen
cargo install cargo-expand cargo install cargo-expand
cargo install wasm-pack cargo install wasm-pack
@ -26,9 +26,9 @@ dart --disable-analytics
# Build demo project if present # Build demo project if present
if [ -d "$RUST_SAMPLE_PROJECT" ]; then if [ -d "$RUST_SAMPLE_PROJECT" ]; then
"$RUST_SAMPLE_PROJECT/build.sh" "$RUST_SAMPLE_PROJECT/build.sh"
else else
echo "No sample project found in $RUST_SAMPLE_PROJECT" echo "No sample project found in $RUST_SAMPLE_PROJECT"
fi fi
echo "Rust development environment setup completed successfully!" echo "Rust development environment setup completed successfully!"

5
projects/README.md

@ -0,0 +1,5 @@
# projects directory
1. Clone your flutter project repo here.
2. Open parent (dev-flutter) dir in devcontainer.
3. Open cloned projects/yourproject in your IDE using the same container

13
sample_projects/flutter_android_demo/build.sh

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
set -e # Exit on error set -e # Exit on error
set -x # Print commands being executed set -x # Print commands being executed
cd "$(dirname "$0")" cd "$(dirname "$0")"
@ -11,8 +11,12 @@ cd "$(dirname "$0")"
flutter config --enable-android flutter config --enable-android
if [ ! -f lib/main.dart ]; then if [ ! -f lib/main.dart ]; then
flutter create -t app . flutter create -t app .
flutter_rust_bridge_codegen integrate fi
# Run integrate if the config file is missing
if [ ! -f flutter_rust_bridge.yaml ]; then
flutter_rust_bridge_codegen integrate
fi fi
# Create project structure (this will add platform-specific files) # Create project structure (this will add platform-specific files)
@ -45,4 +49,3 @@ flutter_rust_bridge_codegen generate
# flutter_rust_bridge_codegen build-web # flutter_rust_bridge_codegen build-web
flutter build apk --verbose flutter build apk --verbose

Loading…
Cancel
Save