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

chore: add build-tools command to quickly build stuff #388

Merged
merged 3 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ build/
pubspec.lock
pubspec_overrides.yaml

build-tools/

# Directory created by dartdoc
# If you don't generate documentation locally you can remove this line.
doc/api/
Expand All @@ -30,4 +32,4 @@ doc/api/
#vscode
.vscode

pubspec_overrides.yaml #melos
pubspec_overrides.yaml #melos
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,23 @@ atProtocol.
[at_ve_doctor](./packages/at_ve_doctor) A very simple way to test the status of the
secondaries running in the Virtual Environment. Using the
[at_server_status](https://pub.dev/packages/at_server_status) package.

### Quickly build tools

Using melos, we can quickly build at_pkam, at_cram, at_cli, and at_repl via the
following commands:

```bash
dart pub get
dart run melos run build-tools
```

Then move the tools to a folder which you've exposed to the path for
convenience, for example:

```bash
cp ./build-tools/* ~/.local/bin/
# or
sudo cp ./build-tools/* /usr/local/bin/
```

3 changes: 3 additions & 0 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ name: at_tools

packages:
- packages/**

scripts:
build-tools: ./tools/build-tools.sh
13 changes: 13 additions & 0 deletions tools/build-tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

script_dir="$(dirname -- "$(readlink -f -- "$0")")"
cd "$script_dir/.." || exit 1 # cd to root of repo

melos bootstrap --scope=at_cli --scope=at_cram --scope=at_pkam --scope=at_repl

mkdir -p build-tools

dart compile exe packages/at_cli/bin/main.dart -o build-tools/at_cli
dart compile exe packages/at_cram/bin/at_cram.dart -o build-tools/at_cram
dart compile exe packages/at_pkam/bin/main.dart -o build-tools/at_pkam
dart compile exe packages/at_repl/bin/at_repl.dart -o build-tools/at_repl