Zeus + Go Build

Find Tips and tricks on how to better use the Zeus IDE. Feel free to post your own tips but please do not post bug reports, feature requests or questions here.
Post Reply
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Zeus + Go Build

Post by jussij »

The latest release of the Zeus IDE adds support for Go Build.

Go Build (gb) is an alternative build tool for the Go programming language.

More details about gb can be found here: http://dave.cheney.net/2015/05/12/introducing-gb

How Go Build Works
To see how Go Build works consider the Converting and Existing Project found here: http://getgb.io/examples/getting-started/

Now assuming Git, Go and Go Build are all installed an in the PATH environment variable, the steps described in the link above can be replicated inside a Window command line prompt as shown below:

Code: Select all

C:\projects]mkdir devel\sftp

C:\projects]cd devel/sftp

C:\projects\devel\sftp]mkdir src\github.com\pkg\sftp

C:\projects\devel\sftp]git clone https://github.com/pkg/sftp src/github.com/pkg/sftp
Cloning into 'src/github.com/pkg/sftp'...
remote: Counting objects: 468, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 468 (delta 0), reused 0 (delta 0), pack-reused 463
Receiving objects:  99% (464/468), 1.32 MiB | 238.00 KiB/s
Receiving objects: 100% (468/468), 1.39 MiB | 244.00 KiB/s, done.
Resolving deltas: 100% (257/257), done.
Checking connectivity... done.

C:\projects\devel\sftp]mkdir vendor\src\github.com\kr\fs

C:\projects\devel\sftp]git clone https://github.com/kr/fs vendor/src/github.com/kr/fs
Cloning into 'vendor/src/github.com/kr/fs'...
remote: Counting objects: 18, done.
remote: Total 18 (delta 0), reused 0 (delta 0), pack-reused 18
Unpacking objects: 100% (18/18), done.
Checking connectivity... done.

C:\projects\devel\sftp]mkdir vendor\src\golang.org\x\crypto

C:\projects\devel\sftp]git clone https://github.com/golang/crypto vendor/src/golang.org/x/crypto
Cloning into 'vendor/src/golang.org/x/crypto'...
remote: Counting objects: 1889, done.
remote: Total 1889 (delta 0), reused 0 (delta 0), pack-reused 1889
Receiving objects: 100% (1889/1889), 1.20 MiB | 205.00 KiB/s, done.
Resolving deltas: 100% (1262/1262), done.
Checking connectivity... done.

C:\projects\devel\sftp]gb build all
github.com/kr/fs
golang.org/x/crypto/ssh
golang.org/x/crypto/ssh/agent
github.com/pkg/sftp
github.com/pkg/sftp/examples/buffered-read-benchmark
github.com/pkg/sftp/examples/buffered-write-benchmark
github.com/pkg/sftp/examples/gsftp
github.com/pkg/sftp/examples/streaming-read-benchmark
github.com/pkg/sftp/examples/streaming-write-benchmark
How to Use Go Build Inside Zeus
The latest version of Zeus adds a Python macro that is designed to work with Go Build and it does this by automatically creating a Zeus workspace that matches the Go Build project.

1. To see how this works just open this file in Zeus:

Code: Select all

C:\projects\devel\sftp\src\github.com\pkg\sftp\sftp.go
2. Next with that Go file as the active file, select the Macros, Build, New Go Workspace menu and run that macro to create an load the Go Build workspace.

3. The readme.txt file gives more details on how the macro works.

Running that macro will create a new workspace with a structure as shown below:
Image
To run the go build, right click on the github.com and select the build all option as shown below:
Image
This will result in the following output:

Code: Select all

Using workspace project options....

github.com/kr/fs
golang.org/x/crypto/ssh
golang.org/x/crypto/ssh/agent
github.com/pkg/sftp
github.com/pkg/sftp/examples/buffered-read-benchmark
github.com/pkg/sftp/examples/buffered-write-benchmark
github.com/pkg/sftp/examples/gsftp
github.com/pkg/sftp/examples/streaming-read-benchmark
github.com/pkg/sftp/examples/streaming-write-benchmark
Class Browsing and Code Navigation
One of the benefits of having a workspace is Zeus will automatically create ctags information for each of the items of the workspace.

Zeus displays that information in it's class browser tree as shown below.

Image

Zeus also uses that ctags information to drive the code navigation.
Post Reply