Created
September 1, 2018 15:57
-
-
Save szabba/57597d7fb9cfc5a73f2de4dc5a50de74 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func runBuild(ctx context.Context, repos *repo.Set, flags *Flags) error { | |
phase := "syncing repos" | |
handle err { | |
return oops.Wrapf(err, "problem " + phase) | |
} | |
clones := check repo.SyncAll(ctx, repos, ".") | |
phase = "checking out appropriate branches" | |
check clones.EachTry(func(l repo.Local) error { | |
return l.CheckoutFirst(ctx, flags.branches.topic, flags.branches.default_) | |
}) | |
phase = "analyzing projects" | |
prjs := check analyzeProjects(ctx, clones) | |
ws := unibuild.NewWorkspace(prjs) | |
phase = "resolving build order" | |
order := check ws.BuildOrder() | |
for _, p := range order { | |
phase = fmt.Sprintf("building project %s", p.Info().Name) | |
check p.Build(ctx, os.Stdout) | |
log.Printf("succesfully built %s", p.Info().Name) | |
} | |
return nil | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func runBuild(ctx context.Context, repos *repo.Set, flags *Flags) error { | |
clones, err := repo.SyncAll(ctx, repos, ".") | |
if err != nil { | |
return oops.Wrapf(err, "problem syncing repos") | |
} | |
err = clones.EachTry(func(l repo.Local) error { | |
return l.CheckoutFirst(ctx, flags.branches.topic, flags.branches.default_) | |
}) | |
if err != nil { | |
return oops.Wrapf(err, "problem checking out appropriate branches") | |
} | |
prjs, err := analyzeProjects(ctx, clones) | |
if err != nil { | |
return oops.Wrapf(err, "problem analyzing projects") | |
} | |
ws := unibuild.NewWorkspace(prjs) | |
order, err := ws.BuildOrder() | |
if err != nil { | |
return oops.Wrapf(err, "problem finding build order") | |
} | |
for _, p := range order { | |
err := p.Build(ctx, os.Stdout) | |
if err != nil { | |
return oops.Wrapf(err, "problem building project %s", p.Info().Name) | |
} | |
log.Printf("succesfully built %s", p.Info().Name) | |
} | |
return nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment