Skip to content
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

simplify build setup instructions for ubuntu #1049

Merged
merged 1 commit into from
Mar 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 29 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,37 @@ Encointer wallet and client for mobile phones

# Build Instructions

## Install Flutter
## Setup

Built with [Flutter](https://flutter.dev/), you need to have `Flutter` dev tools
installed on your computer to compile the project. check [Flutter Documentation](https://flutter.dev/docs)
to learn how to install `Flutter` and initialize a Flutter App.
The following works for ubuntu 22.04:

Install Android Studio from snap and set it up as follows:
1. Tools > SDK manager > Install SDK Android 8.0 Oreo (not sure if version matters much)
2. ... Tools > Install SDK commandline tools
3. Settings > Plugins > Install Flutter

then:

```
sudo apt install cmake ninja-build libgtk-3-dev npm build-essentials
./scripts/install_flutter_wrapper.sh
./flutterw pub global activate melos
# add the following line to `~/.bashrc` as well
export PATH="$PATH":"$HOME/.pub-cache/bin:$HOME/encointer/encointer-wallet-flutter/.flutter/bin"

melos bootstrap

sudo npm install --global yarn
# optional:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
```

In studio: under run configurations, add build flavor `dev`

Now: run!

### Additional Info

## Flutter wrapper
This project uses [flutter_wrapper](https://github.com/passsy/flutter_wrapper). Flutter wrapper is a tool that enables
having the same flutter version across multiple developers. It installs automatically the flutter version form the
pubspec.yml into the `.flutter` submodule.
Expand All @@ -55,35 +79,15 @@ Further info can be found in the [Medium Article](https://passsy.medium.com/flut
```shell
git submodule update --init
```

#### Linux and MacOs
Linux and MacOs users can simply replace all `flutter` CLI commands with `./flutterw` and it will just work.

#### Windows
In windows, this does unfortunately not work, but you can still set up your IDE to use the flutter version in from the `.flutter` git submodule. And you can do the following workaround:

```shell
# initialize .flutter git submodule (also works on windows)
./scripts/install_flutter_wrapper.sh

# refer to the flutter installation in your git submodule
./.flutter/bin/flutter doctor
```

## Install Melos

[Melos](https://melos.invertase.dev/) splitting up large code bases into separate independently versioned packages is extremely useful for code sharing. However, making changes across many repositories is messy and difficult to track, and testing across repositories gets complicated really fast.
To solve these (and many other) problems, some projects will organize their code bases into multi-package repositories (sometimes called [monorepos](https://en.wikipedia.org/wiki/Monorepo)).

Install
```shell
dart pub global activate melos
```
Setup
```shell
melos bootstrap
```

## Build js dependencies

Encointer wallet connects to the chains with [polkadot-js/api](https://polkadot.js.org/api/), running in a hidden webview.
Expand Down