From 0cb85e5264cfc6d7efc40609c86d5396dbf3df4f Mon Sep 17 00:00:00 2001 From: sneurlax Date: Mon, 6 May 2024 20:25:58 -0500 Subject: [PATCH] Remove duplicate Flutter section and add example scripts --- docs/building.md | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/docs/building.md b/docs/building.md index 397fd225b..0d88b1bb2 100644 --- a/docs/building.md +++ b/docs/building.md @@ -9,10 +9,22 @@ Here you will find instructions on how to install the necessary tools for buildi - 100 GB of storage ## Linux host + The following instructions are for building and running on a Linux host. Alternatively, see the [Mac](#mac-host) and/or [Windows](#windows-host) section. This entire section (except for the Android Studio section) needs to be completed in WSL if building on a Windows host. ### Flutter -Install Flutter 3.19.6 by following these instructions: https://docs.flutter.dev/get-started/install/linux/desktop?tab=download#install-the-flutter-sdk. You can also clone https://github.com/flutter/flutter, check out the `3.19.6` tag, and add its `flutter/bin` folder to your PATH. Run `flutter doctor` in a terminal to confirm its installation. +Install Flutter 3.19.6 by [following their guide](https://docs.flutter.dev/get-started/install/linux/desktop?tab=download#install-the-flutter-sdk). You can also clone https://github.com/flutter/flutter, check out the `3.19.6` tag, and add its `flutter/bin` folder to your PATH as in +```sh +FLUTTER_DIR="$HOME/development/flutter" +git clone https://github.com/flutter/flutter.git "$FLUTTER_DIR" +cd "$FLUTTER_DIR" +git checkout 3.16.9 +echo 'export PATH="$PATH:'"$FLUTTER_DIR"'/bin"' >> "$HOME/.profile" +source "$HOME/.profile" +flutter precache +``` + +Run `flutter doctor` in a terminal to confirm its installation. ### Android Studio Install Android Studio. Follow instructions here [https://developer.android.com/studio/install#linux](https://developer.android.com/studio/install#linux) or install via snap: @@ -38,17 +50,7 @@ The following *may* be needed for Android studio: sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386 ``` -### Flutter - -Flutter and the Dart SDK should have been set up by Android studio, but if running `flutter` doesn't work (try `flutter doctor`, too), follow the [guide to install Flutter on any of their supported platforms](https://docs.flutter.dev/get-started/install) or: - - `git clone https://github.com/flutter/flutter` somewhere it can live (`/var`, `/opt`, `~`) - - `git checkout 3.16.0` after navigating into the `flutter` directory, and - - add `flutter/bin` to your PATH (on Ubuntu, add `PATH=$PATH:path/to/flutter/bin` to `~/.profile`). - -Run `flutter doctor` to install any missing dependencies and review and agree to any license agreements. - ### Build dependencies - Install basic dependencies ``` sudo apt-get install libssl-dev curl unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake libgit2-dev clang libncurses5-dev libncursesw5-dev zlib1g-dev llvm python3-distutils @@ -221,7 +223,6 @@ cd scripts/macos ``` ### Run prebuild script - Certain test wallet parameter and API key template files must be created in order to run Stack Wallet. These can be created by script as in ``` cd scripts @@ -247,6 +248,7 @@ flutter run macos ``` ## Windows host + ### Visual Studio Visual Studio is required for Windows development with the Flutter SDK. Download it at https://visualstudio.microsoft.com/downloads/ and install the "Desktop development with C++", "Linux development with C++", and "Visual C++ build tools" workloads. You may also need the Windows 10, 11, and/or Universal SDK workloads depending on your Windows version. @@ -280,7 +282,18 @@ Copy the resulting `dll`s to their respective positions on the Windows host: Frostdart will be built by the Windows host later. ### Install Flutter on Windows host -Install Flutter 3.19.6 on your Windows host (not in WSL2) by following these instructions: https://docs.flutter.dev/get-started/install/windows/desktop?tab=download#install-the-flutter-sdk. You can also clone https://github.com/flutter/flutter, check out the `3.19.6` tag, and add its `flutter/bin` folder to your PATH. Run `flutter doctor` in PowerShell to confirm its installation. +Install Flutter 3.19.6 on your Windows host (not in WSL2) by [following their guide](https://docs.flutter.dev/get-started/install/windows/desktop?tab=download#install-the-flutter-sdk) or by cloning https://github.com/flutter/flutter, checking out the `3.19.6` tag, and adding its `flutter/bin` folder to your PATH as in +```bat +@echo off +set "FLUTTER_DIR=%USERPROFILE%\development\flutter" +git clone https://github.com/flutter/flutter.git "%FLUTTER_DIR%" +cd /d "%FLUTTER_DIR%" +git checkout 3.16.9 +setx PATH "%PATH%;%FLUTTER_DIR%\bin" +echo Flutter setup completed. Please restart your command prompt. +``` + +Run `flutter doctor` in PowerShell to confirm its installation. ### Rust Install [Rust](https://www.rust-lang.org/tools/install) on the Windows host (not in WSL2). Download the installer from [rustup.rs](https://rustup.rs), make sure it works on the commandline (you may need to open a new terminal), and install the following versions: