Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag to keep build dir #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cli/build_remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ func buildRemote(bParams *build.BuildParams) error {

buildDir := moscommon.GetBuildDir(projectDir)

os.RemoveAll(buildDir)
if !*flags.KeepBuildDir {
os.RemoveAll(buildDir)
}
if err := os.MkdirAll(buildDir, 0755); err != nil {
return errors.Annotatef(err, "failed to create build directory")
}
Expand Down
1 change: 1 addition & 0 deletions cli/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ var (
LibsExtra = flag.StringArray("lib-extra", []string{}, "Extra libs to add to the app being built. Value should be a YAML string. Can be used multiple times.")
SaveBuildStat = flag.Bool("save-build-stat", true, "save build statistics")
PreferPrebuiltLibs = flag.Bool("prefer-prebuilt-libs", false, "if both sources and prebuilt binary of a lib exists, use the binary")
KeepBuildDir = flag.Bool("keep-build-dir", false, "do not remove build dir before build, enables incremental remote builds")

DepsVersions = flag.String("deps-versions", "", "If specified, this file will be consulted for all libs and modules versions")
StrictDepsVersions = flag.Bool("strict-deps-versions", true, "If set, then --deps-versions will be in strict mode: missing deps will be disallowed")
Expand Down