Developing for Snap on Windows - Snap-for-Windows/snap GitHub Wiki
Setup
- Using MinGW-w64 as demonstrated in this pull request, run
/scripts/build_all.sh
Alternative Manual Setup
- Install Go as documented on the official Go installation page
- Install git
- Install Python 2.7
- Decide where you want your Go files to reside (a matter of personal preference) and set your
GOPATH
environment variable to reflect your choice- The path you choose will contain any Go source code, binaries, and packages involved in your development
- Edit the Windows
Path
to include Go's\bin
folder (contained within the path chosen above) so Go executables can be run from anywhere in the command prompt go get github.com/Masterminds/glide
go get -d github.com/Snap-for-Windows/snap
cd %GOPATH%\src\github.com\Snap-for-Windows\snap
glide install
- Installs specific versions of Snap's dependencies
go install
- This will build the executable and place it inside Go's
\bin
folder.
- This will build the executable and place it inside Go's
cd \cmd\snapctl
go install
Note: At the time of this writing, BYU's networks currently have issue contacting some of the repositories for Snap's dependencies. If Glide errors out, try passing your connection through a VPN outside of BYU's networks.
Testing
After installing and configuring Go, if you wish to test your Go install's functionality, run the following commands:
go get github.com/golang/example/hello
hello
If you see Hello, Go examples!
, your installation is working.
Next Steps
Run Snap as instructed here by running the following command in a PowerShell prompt:
snap -t 0 -l 1
In a new PowerShell prompt, run the following command to load a test plugin:
snapctl plugin load %GOPATH%\src\github.com\Snap-for-Windows\snap\plugin\snap-plugin-collector-psutil.exe
Build and install the test plugins as described.