summaryrefslogtreecommitdiff
path: root/build.go
diff options
context:
space:
mode:
Diffstat (limited to 'build.go')
-rw-r--r--build.go26
1 files changed, 17 insertions, 9 deletions
diff --git a/build.go b/build.go
index ccb32a5..579d738 100644
--- a/build.go
+++ b/build.go
@@ -48,14 +48,17 @@ func (f *Forge) doBuild(repo *gitpb.Repo, userFlags []string, goWhat string) err
return err
}
- // build the protobuf files in all protobuf repos
- all := repo.GoDeps.SortByGoPath()
- for all.Scan() {
- t := all.Next()
- found := f.Repos.FindByGoPath(t.GetGoPath())
- if found.RepoType() == "protobuf" {
- if err := f.runAutogenpb(found); err != nil {
- return err
+ // if not GoPrimitive, autogen each dependent git repo
+ if repo.GoDepsLen() != 0 {
+ // build the protobuf files in all protobuf repos
+ all := repo.GoDeps.SortByGoPath()
+ for all.Scan() {
+ t := all.Next()
+ found := f.Repos.FindByGoPath(t.GetGoPath())
+ if found.RepoType() == "protobuf" {
+ if err := f.runAutogenpb(found); err != nil {
+ return err
+ }
}
}
}
@@ -66,6 +69,11 @@ func (f *Forge) doBuild(repo *gitpb.Repo, userFlags []string, goWhat string) err
if repo.CheckDirty() {
version = version + "-dirty"
}
+ if repo.RepoType() == "plugin" {
+ if goWhat == "install" {
+ return errors.New("Can not go install plugins yet")
+ }
+ }
cmd := []string{"go", goWhat}
// if this is a plugin, use buildmode=plugin
@@ -118,7 +126,7 @@ func (f *Forge) doBuild(repo *gitpb.Repo, userFlags []string, goWhat string) err
log.Info("again failed cmd", strings.Join(cmd, "a"))
log.Info("again failed", strings.Join(res2.Stdout, "\n"))
}
- return errors.New("go build failed: " + fmt.Sprint(result.Error))
+ return errors.New("go " + goWhat + " failed: " + fmt.Sprint(result.Error))
}
}