mirror of
https://github.com/facebook/proxygen.git
synced 2025-04-19 01:04:16 +03:00
Add StatsWrapper.h generator script
Summary: Generate a wrapper around BaseStats to support custom Stats classes Reviewed By: jerryliu55 Differential Revision: D52939343 fbshipit-source-id: ec1748efca92e7cb5972322c338bcce856451fa2
This commit is contained in:
parent
68e5513f86
commit
e11a7d8762
1
.gitignore
vendored
1
.gitignore
vendored
@ -19,6 +19,7 @@ gen-cpp2
|
||||
/proxygen/lib/utils/TraceEventType.h
|
||||
/proxygen/lib/utils/TraceFieldType.cpp
|
||||
/proxygen/lib/utils/TraceFieldType.h
|
||||
/proxygen/lib/stats/StatsWrapper.h
|
||||
_build/
|
||||
|
||||
# common editor artifacts
|
||||
|
@ -27,6 +27,16 @@ add_custom_command(
|
||||
COMMENT "Generating HTTPCommonHeaders.h and HTTPCommonHeaders.cpp"
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${PROXYGEN_GENERATED_ROOT}/proxygen/lib/stats/StatsWrapper.h
|
||||
COMMAND
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/stats/gen_StatsWrapper.sh
|
||||
${PROXYGEN_FBCODE_ROOT}
|
||||
DEPENDS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/stats/BaseStats.h
|
||||
COMMENT "Generating StatsWrapper.h"
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT
|
||||
${PROXYGEN_GENERATED_ROOT}/proxygen/lib/utils/TraceEventType.h
|
||||
@ -56,6 +66,7 @@ add_custom_target(
|
||||
${PROXYGEN_GENERATED_ROOT}/proxygen/lib/utils/TraceEventType.cpp
|
||||
${PROXYGEN_GENERATED_ROOT}/proxygen/lib/utils/TraceFieldType.h
|
||||
${PROXYGEN_GENERATED_ROOT}/proxygen/lib/utils/TraceFieldType.cpp
|
||||
${PROXYGEN_GENERATED_ROOT}/proxygen/lib/stats/StatsWrapper.h
|
||||
)
|
||||
|
||||
set(
|
||||
|
38
proxygen/lib/stats/gen_StatsWrapper.sh
Executable file
38
proxygen/lib/stats/gen_StatsWrapper.sh
Executable file
@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the BSD-style license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
set -e
|
||||
|
||||
if [ "x$1" != "x" ];then
|
||||
OUTPUT_DIR="$1"
|
||||
fi
|
||||
|
||||
statsWrapper=$(cat <<EOF
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include <proxygen/lib/stats/BaseStats.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace proxygen {
|
||||
|
||||
using StatsWrapper = proxygen::BaseStats;
|
||||
|
||||
} // proxygen
|
||||
EOF
|
||||
)
|
||||
|
||||
touch "${OUTPUT_DIR?}/proxygen/lib/stats/StatsWrapper.h"
|
||||
echo "$statsWrapper" > "${OUTPUT_DIR?}/proxygen/lib/stats/StatsWrapper.h"
|
||||
|
||||
echo "Generated StatsWrapper.h"
|
Loading…
x
Reference in New Issue
Block a user