Commit 1622134
committed
Project build & development toolchain
>>> Mage
The main project development and build toolchain for snowsaw is
Mage (1), a Make/rake-like build tool using Go.
The `magefile.go` file provides all relevant project tasks - from
development and production builds, testing amd linting workflows,
benchmarking up to code optimizations and asset handling.
Even though Go comes with a complete development/testing/deployment
suite out-of-the-box, a project build tool ensures all commands always
executed in the correct order and all necessary information are
provided. Under the hood, the `magefile` file will make use of Go's
official toolchain, but ensures consistency and a simple usage through
Mage's UI features.
>>> IntelliJ Development Setup
Next to Mage this commit also adds file watcher configurations (2) for
IntelliJ's (3) official "File Watcher" plugin (4).
IntelliJ plus the official Go plugin (5) is the recommended development
IDE since it is the most complete and powerful for Go (as well as the
most popular IDE for Java), providing a large amount of features.
The official Go plugin (5) makes IntelliJ feature-equal to Goland (6)
which is a "stripped down" version of IntelliJ's core engine only
bundled with Go features.
>>> GolangCI
To ensure a good code quality the Go ecosystem has hundreds of linters,
each with a different purpose. Instead of installing and running
multiple linters separately GolangCI (7) provides a uniform interface to
run most popular and useful linters in parallel and with many additional
configuration features. The service is like many other great platforms
free for open source projects.
The actual runner golangci-lint (8) is also open source and can be used
locally as well in any private CI/CD pipelines. In order to use it for
snowsaw, a `.golangci.yml` configuration file has been added and the
runner will be executed through the `lint` Mage task.
>>> Cross-Compilation
Go comes with all necessary tools to cross-compile out-of-the-box,
but instead of running the commands manually gox (9) is used to also
simplify this task as well as running and managing the compilation in
parallel. To create distributions with and without binary artifact
optimizations new Mage tasks have also been implemented.
>>> Formatting
To adhere to the Go code styleguide and conventions the official
goimports (10) tool is used and executed through the dedicated `format`
Mage task.
>>> Testing
Go comes with all necessary testing tools out-of-the-box that are used
through Mage tasks where a distinction is made between unit and
integration tests as well as with and without coverage profiling.
The coverage reports can be used later on to integrate services like
CodeCov (11) into snowsaw's CI/CD pipeline.
References:
(1) https://github.com/magefile/mage
(2) https://www.jetbrains.com/help/idea/using-file-watchers.html
(3) https://www.jetbrains.com/idea
(4) https://plugins.jetbrains.com/plugin/7177-file-watchers
(5) https://plugins.jetbrains.com/plugin/9568-go
(6) https://www.jetbrains.com/go
(7) https://golangci.com
(8) https://github.com/golangci/golangci-lint
(9) https://github.com/mitchellh/gox
(10) https://godoc.org/golang.org/x/tools/cmd/goimports
(11) https://codecov.io
Epic GH-33
Depends on GH-58
Resolves GH-621 parent b1ed2cc commit 1622134
File tree
8 files changed
+724
-0
lines changed- .idea
- saved-exports
8 files changed
+724
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
0 commit comments