// SetBuild sets the Build field's value.
778119
func (s *UpdateBuildOutput) SetBuild(v *Build) *UpdateBuildOutput {
	s.Build = v
	return s
}
916948
func ProjectBuild(p project.APIProject, c *cli.Context) error {
	config := options.Build{
		NoCache:     c.Bool("no-cache"),
		ForceRemove: c.Bool("force-rm"),
		Pull:        c.Bool("pull"),
	}
	err := p.Build(context.Background(), config, c.Args()...)
	if err != nil {
		return cli.NewExitError(err.Error(), 1)
	}
	return nil
}
861967
func (s *Project) SetSource(v *ProjectSource) *Project {
	s.Source = v
	return s
}
1265056
func autobuild(p *build.Package) error {
	if p.Dir == "" {
		return fmt.Errorf("no files to build")
	}
	ps, err := os.Stat(p.PkgObj)
	if err != nil {
		// Assume package file does not exist and build for the first time.
		return build_package(p)
	}
	pt := ps.ModTime()
	fs, err := readdir_lstat(p.Dir)
	if err != nil {
		return err
	}
	for _, f := range fs {
		if f.IsDir() {
			continue
		}
		if f.ModTime().After(pt) {
			// Source file is newer than package file; rebuild.
			return build_package(p)
		}
	}
	return nil
}
843095
func (s *Branch) SetBuildSpec(v string) *Branch {
	s.BuildSpec = &v
	return s
}
929544
func (s *Source) SetArchitecture(v string) *Source {
	s.Architecture = &v
	return s
}
631971
func (s *StartBuildInput) SetBuildspecOverride(v string) *StartBuildInput {
	s.BuildspecOverride = &v
	return s
}
875621
func (s *H264Settings) SetBufFillPct(v int64) *H264Settings {
	s.BufFillPct = &v
	return s
}
804618
func setVersion() {
	// A development build is one that's not at a tag or has uncommitted changes
	devBuild = gitTag == "" || gitShortStat != ""

	// Only set the appVersion if -ldflags was used
	if gitNearestTag != "" || gitTag != "" {
		if devBuild && gitNearestTag != "" {
			appVersion = fmt.Sprintf("%s (+%s %s)",
				strings.TrimPrefix(gitNearestTag, "v"), gitCommit, buildDate)
		} else if gitTag != "" {
			appVersion = strings.TrimPrefix(gitTag, "v")
		}
	}
}
184278
func (s *CreateBuildOutput) SetBuild(v *Build) *CreateBuildOutput {
	s.Build = v
	return s
}
91249
func (s *CreateBranchInput) SetBuildSpec(v string) *CreateBranchInput {
	s.BuildSpec = &v
	return s
}
157148
func (s *UpdateBuildInput) SetBuildId(v string) *UpdateBuildInput {
	s.BuildId = &v
	return s
}
806102
func (o *Organization) CreateBuild(ctx context.Context, projectUUID, ref, commitSha string) (bool, Response, error) {
	path := fmt.Sprintf("/organizations/%s/projects/%s/builds", o.UUID, projectUUID)

	_, resp, err := o.client.request(ctx, "POST", path, buildRequest{
		Ref:       ref,
		CommitSha: commitSha,
	})
	if err != nil {
		return false, resp, errors.Wrap(err, "unable to create build")
	}

	return true, resp, nil
}
1030409
func (s *CreateApplicationVersionInput) SetBuildConfiguration(v *BuildConfiguration) *CreateApplicationVersionInput {
	s.BuildConfiguration = v
	return s
}
485920
func (s *CreateFleetInput) SetBuildId(v string) *CreateFleetInput {
	s.BuildId = &v
	return s
}
669015
func (s *CreatePlatformVersionOutput) SetBuilder(v *Builder) *CreatePlatformVersionOutput {
	s.Builder = v
	return s
}
189751
func (b *Builder) setTask(task *structs.Task) *Builder {
	b.taskName = task.Name
	b.envvars = make(map[string]string, len(task.Env))
	for k, v := range task.Env {
		b.envvars[k] = v
	}

	// COMPAT(0.11): Remove in 0.11
	if task.Resources == nil {
		b.memLimit = 0
		b.cpuLimit = 0
	} else {
		b.memLimit = int64(task.Resources.MemoryMB)
		b.cpuLimit = int64(task.Resources.CPU)
	}
	return b
}