Skip to content

Commit

Permalink
fix duplicate mkdir in update_file_lists.sh
Browse files Browse the repository at this point in the history
- merge loop for .h and .proto includes
- fix shellcheck errors
  • Loading branch information
Mizux committed Apr 25, 2018
1 parent 3ad8efc commit 2bd7f51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
3 changes: 0 additions & 3 deletions cmake/extract_includes.bat.in
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\wire_format.h" includ
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\wire_format_lite.h" include\google\protobuf\wire_format_lite.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\wire_format_lite_inl.h" include\google\protobuf\wire_format_lite_inl.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\wrappers.pb.h" include\google\protobuf\wrappers.pb.h
mkdir include\google
mkdir include\google\protobuf
mkdir include\google\protobuf\compiler
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\any.proto" include\google\protobuf\any.proto
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\api.proto" include\google\protobuf\api.proto
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\plugin.proto" include\google\protobuf\compiler\plugin.proto
Expand Down
25 changes: 7 additions & 18 deletions update_file_lists.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,26 +128,15 @@ set_cmake_value $CMAKE_DIR/tests.cmake lite_arena_test_files $CMAKE_PREFIX $LITE

# Generate extract_includes.bat
echo "mkdir include" > $EXTRACT_INCLUDES_BAT
for HEADER in $PUBLIC_HEADERS; do
HEADER_DIR=$(dirname $HEADER)
while [ ! "$HEADER_DIR" = "." ]; do
echo $HEADER_DIR | sed "s/\\//\\\\/g"
HEADER_DIR=$(dirname $HEADER_DIR)
done
done | sort | uniq | sed "s/^/mkdir include\\\\/" >> $EXTRACT_INCLUDES_BAT
for HEADER in $PUBLIC_HEADERS; do
WINPATH=$(echo $HEADER | sed 's;/;\\;g')
echo "copy \"\${PROTOBUF_SOURCE_WIN32_PATH}\\..\\src\\$WINPATH\" include\\$WINPATH" >> $EXTRACT_INCLUDES_BAT
done
for PROTO in ${WKT_PROTOS}; do
PROTO_DIR=$(dirname "$PROTO")
while [ ! "$PROTO_DIR" = "." ]; do
echo "mkdir include\\${PROTO_DIR//\//\\}"
PROTO_DIR=$(dirname "$PROTO_DIR")
for INCLUDE in $PUBLIC_HEADERS $WKT_PROTOS; do
INCLUDE_DIR=$(dirname "$INCLUDE")
while [ ! "$INCLUDE_DIR" = "." ]; do
echo "mkdir include\\${INCLUDE_DIR//\//\\}"
INCLUDE_DIR=$(dirname "$INCLUDE_DIR")
done
done | sort | uniq >> $EXTRACT_INCLUDES_BAT
for PROTO in $WKT_PROTOS; do
WINPATH=${PROTO//\//\\}
for INCLUDE in $PUBLIC_HEADERS $WKT_PROTOS; do
WINPATH=${INCLUDE//\//\\}
echo "copy \"\${PROTOBUF_SOURCE_WIN32_PATH}\\..\\src\\$WINPATH\" include\\$WINPATH" >> $EXTRACT_INCLUDES_BAT
done

Expand Down

0 comments on commit 2bd7f51

Please sign in to comment.