Skip to content

Commit aa6a5e4

Browse files
authored
Add new 'repo_profiles' argument for UnifiedTreeBuilder.getCmakeExBuildFactory() factory. (#227)
A name of the source code profile to get from the remote repository. Currently is supported only "default" profile and None. Default is "default". If None is passed, no the repository checkout steps will be added to the factory workflow. This is useful for the nested factories when the single repo is shared between them. A supporting of multiply profiles will be added when it gets supported by Zorg core.
1 parent bd30608 commit aa6a5e4

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

zorg/buildbot/builders/UnifiedTreeBuilder.py

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,7 @@ def getCmakeExBuildFactory(
608608
vs = None, # VS tools environment variable if using MSVC.
609609
vs_arch = None,
610610
clean = False, # Do clean build flag.
611+
repo_profiles = "default", # The source code repository profiles.
611612
extra_git_args = None, # Extra parameters for steps.Git step (such as 'config', 'workdir', etc.)
612613
llvm_srcdir = None, # A custom LLVM src directory within %(prop:builddir)s of the builder.
613614
src_to_build_dir = None,
@@ -724,6 +725,13 @@ def getCmakeExBuildFactory(
724725
clean : boolean
725726
Alsways do a clean build (default is False).
726727
728+
repo_profiles : string, optional
729+
A name of the source code profile to get from the remote repository. Currently is supported only "default"
730+
profile and None. Default is "default".
731+
732+
If None is passed, no the repository checkout steps will be added to the factory workflow. This is useful
733+
for the nested factories when the single repo is shared between them.
734+
727735
extra_git_args : dict, optional
728736
Provide extra arguments for the Git step (default is None).
729737
@@ -877,15 +885,6 @@ def norm_target_list_arg(lst):
877885
"objdir" : util.Interpolate(f.obj_dir),
878886
}
879887
),
880-
# Remove the source code for a clean checkout if requested by property.
881-
steps.RemoveDirectory(
882-
name = 'clean-src-dir',
883-
dir = util.Interpolate(f.monorepo_dir),
884-
description = ["Remove", util.Interpolate(f.monorepo_dir), "directory"],
885-
haltOnFailure = False,
886-
flunkOnFailure = False,
887-
doStepIf = util.Property("clean", False) == True,
888-
),
889888

890889
# This is an incremental build, unless otherwise has been requested.
891890
# Remove obj dirs for a clean build.
@@ -902,9 +901,22 @@ def norm_target_list_arg(lst):
902901
# Let's start from getting the source code. We share it between all stages.
903902

904903
# Add the Git step.
905-
extra_git_args = extra_git_args or {}
904+
if repo_profiles == "default":
905+
f.addSteps([
906+
# Remove the source code for a clean checkout if requested by property.
907+
steps.RemoveDirectory(
908+
name = f.makeStepName('clean-src-dir'),
909+
dir = f.monorepo_dir,
910+
description = ["Remove", f.monorepo_dir, "directory"],
911+
haltOnFailure = False,
912+
flunkOnFailure = False,
913+
doStepIf = util.Property("clean", False) == True,
914+
),
915+
])
916+
917+
extra_git_args = extra_git_args or {}
906918

907-
f.addGetSourcecodeSteps(**extra_git_args)
919+
f.addGetSourcecodeSteps(**extra_git_args)
908920

909921
# Add custom pre-configuration steps if specified.
910922
if pre_configure_steps:

0 commit comments

Comments
 (0)