BaseTools/build: Expand PREBUILD/POSTBUILD DSC actions

https://bugzilla.tianocore.org/show_bug.cgi?id=670

* Extend PREBUILD/POSTBUILD define values to support more than
  one argument.
* Delay normalization of PREBUILD/POSTBUILD define values
  until all arguments in the define values can be processed.
* Convert PREBUILD/POSTBUILD build define value arguments
  that are WORKSPACE or PACKAGES_PATH relative paths to
  absolute paths.
* Append -p PlatformFile, --conf=ConfDirectory, and build target
  flags to command line used to execute PREBUILD/POSTBUILD
  actions.
* Remove PrebuildScript and PostbuildScript fields from the
  Build class and use Prebuild and Postbuild fields instead.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
Michael D Kinney
2017-08-02 14:07:05 -07:00
parent cc993a16e4
commit af9c4e5e67
2 changed files with 81 additions and 29 deletions

View File

@ -237,7 +237,7 @@ class DscBuildData(PlatformBuildClassObject):
EdkLogger.error('build', FORMAT_INVALID, 'Missing double quotes in the end of %s statement.' % TAB_DSC_PREBUILD,
File=self.MetaFile, Line=Record[-1])
PrebuildValue = Record[2][1:-1]
self._Prebuild = PathClass(NormPath(PrebuildValue, self._Macros), GlobalData.gWorkspace)
self._Prebuild = PrebuildValue
elif Name == TAB_DSC_POSTBUILD:
PostbuildValue = Record[2]
if Record[2][0] == '"':
@ -245,7 +245,7 @@ class DscBuildData(PlatformBuildClassObject):
EdkLogger.error('build', FORMAT_INVALID, 'Missing double quotes in the end of %s statement.' % TAB_DSC_POSTBUILD,
File=self.MetaFile, Line=Record[-1])
PostbuildValue = Record[2][1:-1]
self._Postbuild = PathClass(NormPath(PostbuildValue, self._Macros), GlobalData.gWorkspace)
self._Postbuild = PostbuildValue
elif Name == TAB_DSC_DEFINES_SUPPORTED_ARCHITECTURES:
self._SupArchList = GetSplitValueList(Record[2], TAB_VALUE_SPLIT)
elif Name == TAB_DSC_DEFINES_BUILD_TARGETS: