Commit 79ad623b authored by S. Ganesh's avatar S. Ganesh Committed by Commit Bot

midl.py multiple guid substitution enhancements.

* Added support to prefix replacement guids with a fixed
'PLACEHOLDER-GUID-' string in the template file. This makes it easier to
see the GUIDs that are being replaced.
* Added support to regenerate the checked-in IDL files with the
replaceable guids. This is needed when the IDL template changes and the
checked-in IDL files need to be refreshed.

Bug: 1109612
Change-Id: Ie113d2504c1a44f408641e34422bb081733a7458
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2495396Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: S. Ganesh <ganesh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821500}
parent aee8cbe6
This diff is collapsed.
...@@ -4,8 +4,10 @@ ...@@ -4,8 +4,10 @@
import("//build/toolchain/win/midl.gni") import("//build/toolchain/win/midl.gni")
UpdaterClass_replaceable_uuid = "158428a4-6014-4978-83ba-9fad0dabe791" UpdaterClass_replaceable_uuid =
IUpdater_replaceable_uuid = "63B8FFB1-5314-48C9-9C57-93EC8BC6184B" "PLACEHOLDER-GUID-158428a4-6014-4978-83ba-9fad0dabe791"
IUpdater_replaceable_uuid =
"PLACEHOLDER-GUID-63B8FFB1-5314-48C9-9C57-93EC8BC6184B"
# TODO(crbug.com/1099904): this CLSID needs to be regenerated for every build. # TODO(crbug.com/1099904): this CLSID needs to be regenerated for every build.
# TODO(crbug.com/1099904): we need to use an indirection mechanism for the # TODO(crbug.com/1099904): we need to use an indirection mechanism for the
...@@ -13,28 +15,12 @@ IUpdater_replaceable_uuid = "63B8FFB1-5314-48C9-9C57-93EC8BC6184B" ...@@ -13,28 +15,12 @@ IUpdater_replaceable_uuid = "63B8FFB1-5314-48C9-9C57-93EC8BC6184B"
updater_clsid = "3d852661-c795-4d20-9b95-5561e9a1d2d9" updater_clsid = "3d852661-c795-4d20-9b95-5561e9a1d2d9"
IUPDATER_IID = "D0E1CACC-C63C-4192-94AB-BF8EAD0E3B83" IUPDATER_IID = "D0E1CACC-C63C-4192-94AB-BF8EAD0E3B83"
action("generate_updater_idl") {
script = "//build/util/version.py"
inputs = [ "updater_idl.template" ]
outputs = [ "$target_gen_dir/updater_idl.idl" ]
args = [
"-e",
"$UpdaterClass_replaceable_uuid='$updater_clsid'",
"-e",
"$IUpdater_replaceable_uuid='$IUPDATER_IID'",
rebase_path(inputs[0], root_build_dir),
rebase_path(outputs[0], root_build_dir),
]
}
midl("updater_idl_idl") { midl("updater_idl_idl") {
dynamic_guid = "$UpdaterClass_replaceable_uuid=$updater_clsid," + dynamic_guid = "$UpdaterClass_replaceable_uuid=$updater_clsid," +
"$IUpdater_replaceable_uuid=$IUPDATER_IID" "$IUpdater_replaceable_uuid=$IUPDATER_IID"
deps = [ ":generate_updater_idl" ]
header_file = "updater_idl.h" header_file = "updater_idl.h"
sources = get_target_outputs(":generate_updater_idl") sources = [ "updater_idl.template" ]
defines = [ defines = [
"IUPDATESTATE_IID=46ACF70B-AC13-406D-B53B-B2C4BF091FF6", "IUPDATESTATE_IID=46ACF70B-AC13-406D-B53B-B2C4BF091FF6",
......
...@@ -257,7 +257,7 @@ interface IUpdaterObserver : IUnknown { ...@@ -257,7 +257,7 @@ interface IUpdaterObserver : IUnknown {
[ [
object, object,
dual, dual,
uuid(@63B8FFB1-5314-48C9-9C57-93EC8BC6184B@), uuid(PLACEHOLDER-GUID-63B8FFB1-5314-48C9-9C57-93EC8BC6184B),
helpstring("IUpdater Interface"), helpstring("IUpdater Interface"),
pointer_default(unique) pointer_default(unique)
] ]
...@@ -299,7 +299,7 @@ library UpdaterLib { ...@@ -299,7 +299,7 @@ library UpdaterLib {
// single 'coclass' definition. Any other coclasses need to be defined in // single 'coclass' definition. Any other coclasses need to be defined in
// constants.h/cc. // constants.h/cc.
[ [
uuid(@158428a4-6014-4978-83ba-9fad0dabe791@), uuid(PLACEHOLDER-GUID-158428a4-6014-4978-83ba-9fad0dabe791),
helpstring("Updater Class") helpstring("Updater Class")
] ]
coclass UpdaterClass coclass UpdaterClass
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment