in aws_lambda_builders/workflow.py [0:0]
def _select_build_dir(self, build_in_source: Optional[bool]) -> str:
"""
Returns the build directory for the workflow.
"""
should_build_in_source = build_in_source
if build_in_source not in self.BUILD_IN_SOURCE_SUPPORT.value:
# assign default value
should_build_in_source = self.DEFAULT_BUILD_DIR == BuildDirectory.SOURCE
# only show warning if an unsupported value was explicitly passed in
if build_in_source is not None:
LOG.warning(
'Workflow %s does not support value "%s" for building in source. Using default value "%s".',
self.NAME,
build_in_source,
should_build_in_source,
)
build_directory_mapping = {
BuildDirectory.SCRATCH: self.scratch_dir,
BuildDirectory.ARTIFACTS: self.artifacts_dir,
BuildDirectory.SOURCE: self.source_dir,
}
return self.source_dir if should_build_in_source else build_directory_mapping.get(self.DEFAULT_BUILD_DIR)