Skip to content

Commit

Permalink
[IMP] Improve development guide and tools (#128)
Browse files Browse the repository at this point in the history
* build guide updated and mage tool added

* go fmt on all the files

* mage setup fix
  • Loading branch information
Deep Dhillon committed Feb 15, 2019
1 parent 81e301d commit d6fd02f
Show file tree
Hide file tree
Showing 95 changed files with 7,006 additions and 7,344 deletions.
13 changes: 9 additions & 4 deletions .travis.yml
Expand Up @@ -4,18 +4,23 @@ language: go
go:
- "1.11"

env:
- GO111MODULE=on

go_import_path: wio

before_install:
- source wenv
- sudo apt-get update
- sudo apt-get install gcc-avr avr-libc avrdude
- sudo apt-get install libboost-system-dev libboost-thread-dev libboost-coroutine-dev
- go get github.com/magefile/mage
install:
- wmake travis-setup
- mage setup

script:
- wmake build
- mage build
- mage fmtLint
- go env
- go test -v ./...
- cd test
- ./runtests.sh
- ./wmake test
51 changes: 39 additions & 12 deletions CONTRIBUTING.md
@@ -1,21 +1,48 @@
# Development Setup

Clone the repository into your `GOPATH` as `$(GOPATH)/src/wio` with `--recursive` or `git submodule update --init`
to retrieve some of the CMake toolchain modules.
## Building Wio with Your Changes

Run `make get` to retrieve development dependencies and make sure to install your OS-specific go library.
For linux users `wmake linux-setup` should handle most things. You will need to symlink `bin/toolchain` to
the `toolchain` folder in order to use `wio build` and `wio run`.
Wio uses [mage](https://github.com/magefile/mage) to sync vendor dependencies, build Wio, and other things. You must run mage from the Wio directory.

The repo includes some scripts like `wmake` that shorthand some common development commands. And running
`source wenv` will allow the local `wio` executable to take precedence over an installed version. It also
adds `wmake` to your path for easier development
Install mage
```bash
go get github.com/magefile/mage
```

### Installing Go
To build wio
```bash
mage build
```

Wio binary is created inside the `bin` fodler of your root directory. You can source `wenv` for unix based systems and `env.bat` or `env.ps1` for windows.
This will add the binary to the path.

Wio development should be done on Go version 1.10.2. On linux this can be installed with
To build wio
```bash
mage build
```

To clean build files
```bash
mage clean
```

To install dependencies
```bash
curl -o golang.tar https://storage.googleapis.com/golang/go1.10.2.linux-amd64.tar.gz
tar -xzvf golang.tar
mage install
```

Currently the script only runs tests on `bash` based systems. To run the tests:
```bash
wmake test
```

To list all available commands along with descriptions:
```bash
mage -l
```


### Installing Go

Wio development should be done on Go version 1.11

0 comments on commit d6fd02f

Please sign in to comment.