Skip to content

Commit

Permalink
Merge pull request #388 from atsign-foundation/buildtools
Browse files Browse the repository at this point in the history
chore: add build-tools command to quickly build stuff
  • Loading branch information
gkc authored May 30, 2024
2 parents 329511c + 295c439 commit f0f5e40
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
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

0 comments on commit f0f5e40

Please sign in to comment.