szaszm commented on a change in pull request #1268: URL: https://github.com/apache/nifi-minifi-cpp/pull/1268#discussion_r823843635
########## File path: cmake/GoogleCloudCpp.cmake ########## @@ -0,0 +1,63 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +include(FetchContent) +set(NLOHMANN_JSON_INCLUDE_DIR "${CMAKE_BINARY_DIR}/_deps/nlohmann/" CACHE STRING "" FORCE) +if(NOT EXISTS "${NLOHMANN_JSON_INCLUDE_DIR}/nlohmann/json.hpp") + file(DOWNLOAD "https://github.com/nlohmann/json/releases/download/v3.10.5/json.hpp" "${NLOHMANN_JSON_INCLUDE_DIR}/nlohmann/json.hpp" + EXPECTED_HASH SHA256=e832d339d9e0c042e7dff807754769d778cf5d6ae9730ce21eed56de99cb5e86) +endif() +set(GOOGLE_CLOUD_CPP_NLOHMANN_JSON_HEADER ${NLOHMANN_JSON_INCLUDE_DIR}) + +set(ABSL_PROPAGATE_CXX_STD ON CACHE INTERNAL absl-propagate-cxx) +set(ABSL_ENABLE_INSTALL ON CACHE INTERNAL "") +FetchContent_Declare( + absl + URL https://github.com/abseil/abseil-cpp/archive/refs/tags/20211102.0.tar.gz + URL_HASH SHA256=dcf71b9cba8dc0ca9940c4b316a0c796be8fab42b070bb6b7cab62b48f0e66c4 +) +FetchContent_MakeAvailable(absl) + + +set(CRC32C_USE_GLOG OFF CACHE INTERNAL crc32c-glog-off) +set(CRC32C_BUILD_TESTS OFF CACHE INTERNAL crc32c-gtest-off) +set(CRC32C_BUILD_BENCHMARKS OFF CACHE INTERNAL crc32-benchmarks-off) +set(CRC32C_INSTALL ON CACHE INTERNAL crc32-install-on) +FetchContent_Declare( + crc32c + URL https://github.com/google/crc32c/archive/refs/tags/1.1.1.tar.gz + URL_HASH SHA256=a6533f45b1670b5d59b38a514d82b09c6fb70cc1050467220216335e873074e8 +) +FetchContent_MakeAvailable(crc32c) +add_library(Crc32c::crc32c ALIAS crc32c) + +set(PATCH_FILE_1 "${CMAKE_SOURCE_DIR}/thirdparty/google-cloud-cpp/remove-find_package.patch") +set(PATCH_FILE_2 "${CMAKE_SOURCE_DIR}/thirdparty/google-cloud-cpp/nlohmann_lib_as_interface.patch") +set(PC ${Bash_EXECUTABLE} -c "set -x &&\ + (\\\"${Patch_EXECUTABLE}\\\" -R -p1 -s -f --dry-run -i ${PATCH_FILE_1} || \\\"${Patch_EXECUTABLE}\\\" -p1 -i ${PATCH_FILE_1}) &&\ + (\\\"${Patch_EXECUTABLE}\\\" -R -p1 -s -f --dry-run -i ${PATCH_FILE_2} || \\\"${Patch_EXECUTABLE}\\\" -p1 -i ${PATCH_FILE_2})") Review comment: I think these are too many backslashes. We need to escape the quote in cmake, so that it ends up in bash and makes it work even if there is space in the patch executable path. We also need to escape the patch file path. Check out BundledAwsSdkCpp.cmake for example. ########## File path: PROCESSORS.md ########## @@ -1448,6 +1449,60 @@ In the list below, the names of required properties appear in bold. Any other pr |success|Files that have been successfully written to Azure storage are transferred to this relationship| +## PutGcsObject + +### Description + +Puts content into a Google Cloud Storage bucket +### Properties + +In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language. + +| Name | Default Value | Allowable Values | Description | +|---------------------------------------|---------------|-----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **Bucket Name** | | | The name of the Bucket to upload to. If left empty the _gcs.bucket_ attribute will be used by default.<br>**Supports Expression Language: true** | +| **Object Name** | | | The name of the object to be uploaded. If left empty the _filename_ attribute will be used by default.<br>**Supports Expression Language: true** | Review comment: Consider bringing the interface closer to the nifi equivalent, so that users have an easier time switching or cross-referencing docs. https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-gcp-nar/1.15.3/org.apache.nifi.processors.gcp.storage.PutGCSObject/index.html ########## File path: cmake/GoogleCloudCpp.cmake ########## @@ -0,0 +1,63 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +include(FetchContent) +set(NLOHMANN_JSON_INCLUDE_DIR "${CMAKE_BINARY_DIR}/_deps/nlohmann/" CACHE STRING "" FORCE) +if(NOT EXISTS "${NLOHMANN_JSON_INCLUDE_DIR}/nlohmann/json.hpp") + file(DOWNLOAD "https://github.com/nlohmann/json/releases/download/v3.10.5/json.hpp" "${NLOHMANN_JSON_INCLUDE_DIR}/nlohmann/json.hpp" + EXPECTED_HASH SHA256=e832d339d9e0c042e7dff807754769d778cf5d6ae9730ce21eed56de99cb5e86) +endif() +set(GOOGLE_CLOUD_CPP_NLOHMANN_JSON_HEADER ${NLOHMANN_JSON_INCLUDE_DIR}) Review comment: Did normal FetchContent not work here? Could you separate the different libs to different files? I may want to use abseil or json without crc32 or google-cloud-cpp in the future. ########## File path: PROCESSORS.md ########## @@ -1448,6 +1449,60 @@ In the list below, the names of required properties appear in bold. Any other pr |success|Files that have been successfully written to Azure storage are transferred to this relationship| +## PutGcsObject Review comment: Normally I'm for casing abbreviations like normal words, but in this case I would prefer more consistency with [the existing nifi interface](https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-gcp-nar/1.15.3/org.apache.nifi.processors.gcp.storage.PutGCSObject/index.html). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
