Misc MsgGen fixes

Summary:
Fix a few issues with msggen:
1. run_msggen: fully-qualified path to clang-format
1. Updated the license for autogenerated files

Changelog: [Internal]

Reviewed By: neildhar

Differential Revision: D34114718

fbshipit-source-id: 831d4b20bfdc39cfa1226e2a32dcb445c8086ff3
This commit is contained in:
John Porto
2022-03-08 10:22:28 -08:00
committed by Facebook GitHub Bot
parent e97e3499c3
commit c8067f1ffd
4 changed files with 20 additions and 16 deletions
@@ -1,5 +1,5 @@
// Copyright 2004-present Facebook. All Rights Reserved.
// @generated <<SignedSource::*O*zOeWoEQle#+L!plEphiEmie@IsG>>
// Copyright (c) Meta Platforms, Inc. and affiliates. All Rights Reserved.
// @generated SignedSource<<130ce3da2ad67004eb7bb91f19028a89>>
#include "MessageTypes.h"
@@ -1,5 +1,5 @@
// Copyright 2004-present Facebook. All Rights Reserved.
// @generated <<SignedSource::*O*zOeWoEQle#+L!plEphiEmie@IsG>>
// Copyright (c) Meta Platforms, Inc. and affiliates. All Rights Reserved.
// @generated SignedSource<<41786947d74eb3f47d8168b82b5ccf85>>
#pragma once
@@ -12,5 +12,5 @@
// placeholder token that will be replaced by signedsource script
export const GeneratedHeader: string =
'// Copyright 2004-present Facebook. All Rights Reserved.\n' +
'// Copyright (c) Meta Platforms, Inc. and affiliates. All Rights Reserved.\n' +
'// @generated <<SignedSource::*O*zOeWoEQle#+L!plEphiEmie@IsG>>';
+15 -11
View File
@@ -3,24 +3,28 @@
set -e
DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
cd "${DIR}/msggen"
yarn install
yarn build
MSGTYPES_PATH="${DIR}/message_types.txt"
HEADER_PATH="${DIR}/../chrome/MessageTypes.h"
CPP_PATH="${DIR}/../chrome/MessageTypes.cpp"
FBSOURCE=$(hg root)
CLANG_FORMAT="${FBSOURCE}/tools/third-party/clang-format/clang-format"
SIGNEDSOURCE="${FBSOURCE}/tools/signedsource"
cd "${DIR}/msggen"
yarn install
yarn build
node bin/index.js \
--ignore-experimental \
--include-experimental=Runtime.getHeapUsage \
--roots "$MSGTYPES_PATH" \
"$HEADER_PATH" "$CPP_PATH"
--roots "${MSGTYPES_PATH}" \
"${HEADER_PATH}" "${CPP_PATH}"
clang-format -i --style=file "$HEADER_PATH"
clang-format -i --style=file "$CPP_PATH"
"${CLANG_FORMAT}" -i --style=file "${HEADER_PATH}"
"${CLANG_FORMAT}" -i --style=file "${CPP_PATH}"
FBSOURCE=$(hg root)
"${FBSOURCE}/tools/signedsource" sign "$HEADER_PATH"
"${FBSOURCE}/tools/signedsource" sign "$CPP_PATH"
"${SIGNEDSOURCE}" sign "${HEADER_PATH}"
"${SIGNEDSOURCE}" sign "${CPP_PATH}"