Repository: nifi-minifi-cpp Updated Branches: refs/heads/master 73ecc6671 -> 22657c48a
MINIFI-177 - Apache RAT build integration Incorporating Apache RAT to build with a custom target of apache-rat. Updating non-compliant files and/or listing exclusions in .rat-excludes This commit introduces a separate CMake file to manage the acquisition of the RAT binary. Run RAT as part of Travis builds. This closes #103. Signed-off-by: Bryan Rosander <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/22657c48 Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/22657c48 Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/22657c48 Branch: refs/heads/master Commit: 22657c48aece3791c66ef31b537bad1fdf435fcd Parents: 73ecc66 Author: Aldrin Piri <[email protected]> Authored: Tue May 23 12:47:12 2017 -0400 Committer: Bryan Rosander <[email protected]> Committed: Mon Jun 5 12:27:24 2017 -0400 ---------------------------------------------------------------------- .gitignore | 19 ++++++++ .travis.yml | 2 +- CMakeLists.txt | 8 +++- cmake/RunApacheRAT.cmake | 47 ++++++++++++++++++++ examples/iOSPort/iOSPortREADME.md | 15 +++++++ libminifi/cmake/iOS.cmake | 17 +++++++ libminifi/test/Server.cpp | 18 ++++++++ .../test/resources/TestControllerServices.yml | 18 ++++++++ .../test/resources/TestProvenanceReporting.yml | 18 ++++++++ thirdparty/apache-rat/.rat-excludes | 8 ++++ 10 files changed, 168 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/22657c48/.gitignore ---------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore index 990e6c4..4a4c064 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,21 @@ +# 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. +# + # Standard ignores .DS_Store @@ -28,6 +46,7 @@ thirdparty/**/*.o thirdparty/**/*.a libminifi/test/**/*.a docs/generated +thirdparty/apache-rat/apache-rat* # Ignore source files that have been placed in the docker directory during build docker/minificppsource http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/22657c48/.travis.yml ---------------------------------------------------------------------- diff --git a/.travis.yml b/.travis.yml index 61cbbee..b74f40d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,4 +63,4 @@ matrix: - package='graphviz'; [[ $(brew ls --versions ${package}) ]] && { brew outdated ${package} || brew upgrade ${package}; } || brew install ${package} script: - - mkdir ./build && cd ./build && cmake .. && make VERBOSE=1 && make test ARGS="--output-on-failure" && make linter && make docs + - mkdir ./build && cd ./build && cmake .. && make VERBOSE=1 && make test ARGS="--output-on-failure" && make linter && make apache-rat && make docs http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/22657c48/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c65d14..fdae7ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -154,4 +154,10 @@ include(DockerConfig) add_custom_target( linter COMMAND ${CMAKE_SOURCE_DIR}/thirdparty/google-styleguide/run_linter.sh ${CMAKE_SOURCE_DIR}/libminifi/include/ ${CMAKE_SOURCE_DIR}/libminifi/src/ - COMMAND ${CMAKE_SOURCE_DIR}/thirdparty/google-styleguide/run_linter.sh ${CMAKE_SOURCE_DIR}/libminifi/include/ ${CMAKE_SOURCE_DIR}/libminifi/test/ ) \ No newline at end of file + COMMAND ${CMAKE_SOURCE_DIR}/thirdparty/google-styleguide/run_linter.sh ${CMAKE_SOURCE_DIR}/libminifi/include/ ${CMAKE_SOURCE_DIR}/libminifi/test/ ) + +# Custom target to download and run Apache Release Audit Tool (RAT) +add_custom_target( + apache-rat + ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/cmake/RunApacheRAT.cmake + COMMAND java -jar ${CMAKE_SOURCE_DIR}/thirdparty/apache-rat/apache-rat-0.12/apache-rat-0.12.jar -E ${CMAKE_SOURCE_DIR}/thirdparty/apache-rat/.rat-excludes -d ${CMAKE_SOURCE_DIR} | grep -B 1 -A 15 Summary ) http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/22657c48/cmake/RunApacheRAT.cmake ---------------------------------------------------------------------- diff --git a/cmake/RunApacheRAT.cmake b/cmake/RunApacheRAT.cmake new file mode 100644 index 0000000..76e329b --- /dev/null +++ b/cmake/RunApacheRAT.cmake @@ -0,0 +1,47 @@ +# 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. + +# This file is invoked in CMake script mode from the source root of the overall project + +# Find the preferred Apache mirror to use for the download by querying the list of mirrors and filtering out 'preferred' +execute_process(COMMAND curl -s https://www.apache.org/dyn/closer.lua/?asjson=1 + COMMAND grep preferred + COMMAND awk "{print $2}" + COMMAND tr -d "\"" + TIMEOUT 10 + OUTPUT_STRIP_TRAILING_WHITESPACE + OUTPUT_VARIABLE MIRROR_URL ) + +# Make use of parent thirdparty by adjusting relative to the source of this CMake file +set(PARENT_THIRDPARTY_DIR "${CMAKE_SOURCE_DIR}/../thirdparty") +set(RAT_BASENAME "apache-rat-0.12") +set(RAT_DIR "${PARENT_THIRDPARTY_DIR}/apache-rat") +set(RAT_BINARY "${RAT_DIR}/${RAT_BASENAME}-bin/${RAT_BASENAME}.jar") + +file(DOWNLOAD + "${MIRROR_URL}creadur/${RAT_BASENAME}/${RAT_BASENAME}-bin.tar.gz" + "${RAT_DIR}/${RAT_BASENAME}-bin.tar.gz" + EXPECTED_HASH SHA512=460d53fa3e1546d960bd03ebd97c930a39306cffd98c9ebc09bf22f9e50a9723578b98c4e7dc71dd6f19dfb6dae00811cb11a4eabce70c21502a6cef2d9fd2fa ) + +execute_process( + COMMAND tar xf "${RAT_DIR}/${RAT_BASENAME}-bin.tar.gz" -C "${RAT_DIR}" + COMMAND grep preferred + COMMAND awk "{print $2}" + COMMAND tr -d "\"" + TIMEOUT 10 + OUTPUT_STRIP_TRAILING_WHITESPACE + OUTPUT_VARIABLE MIRROR_URL ) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/22657c48/examples/iOSPort/iOSPortREADME.md ---------------------------------------------------------------------- diff --git a/examples/iOSPort/iOSPortREADME.md b/examples/iOSPort/iOSPortREADME.md index 3631b05..11e5005 100644 --- a/examples/iOSPort/iOSPortREADME.md +++ b/examples/iOSPort/iOSPortREADME.md @@ -1,3 +1,18 @@ +<!-- + 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. +--> + 1) Install XCode 2) Build libminfi.a cd libminifi, mkdir lib, cd lib http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/22657c48/libminifi/cmake/iOS.cmake ---------------------------------------------------------------------- diff --git a/libminifi/cmake/iOS.cmake b/libminifi/cmake/iOS.cmake index 57b82f9..87148f7 100644 --- a/libminifi/cmake/iOS.cmake +++ b/libminifi/cmake/iOS.cmake @@ -1,3 +1,20 @@ +# 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. + # This file is based off of the Platform/Darwin.cmake and Platform/UnixPaths.cmake # files which are included with CMake 2.8.4 # It has been altered for iOS development http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/22657c48/libminifi/test/Server.cpp ---------------------------------------------------------------------- diff --git a/libminifi/test/Server.cpp b/libminifi/test/Server.cpp index 875e7a9..bb3e682 100644 --- a/libminifi/test/Server.cpp +++ b/libminifi/test/Server.cpp @@ -1,3 +1,21 @@ +/** + * + * 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. + */ + /* A simple server in the internet domain using TCP The port number is passed as an argument */ #include <stdio.h> http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/22657c48/libminifi/test/resources/TestControllerServices.yml ---------------------------------------------------------------------- diff --git a/libminifi/test/resources/TestControllerServices.yml b/libminifi/test/resources/TestControllerServices.yml index 3923c87..d2d2a5a 100644 --- a/libminifi/test/resources/TestControllerServices.yml +++ b/libminifi/test/resources/TestControllerServices.yml @@ -1,3 +1,21 @@ +# +# 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. +# Flow Controller: name: MiNiFi Flow id: 2438e3c8-015a-1000-79ca-83af40ec1990 http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/22657c48/libminifi/test/resources/TestProvenanceReporting.yml ---------------------------------------------------------------------- diff --git a/libminifi/test/resources/TestProvenanceReporting.yml b/libminifi/test/resources/TestProvenanceReporting.yml index 5b906a5..375a4a9 100644 --- a/libminifi/test/resources/TestProvenanceReporting.yml +++ b/libminifi/test/resources/TestProvenanceReporting.yml @@ -1,3 +1,21 @@ +# +# 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. +# Flow Controller: name: MiNiFi Flow id: 2438e3c8-015a-1000-79ca-83af40ec1990 http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/22657c48/thirdparty/apache-rat/.rat-excludes ---------------------------------------------------------------------- diff --git a/thirdparty/apache-rat/.rat-excludes b/thirdparty/apache-rat/.rat-excludes new file mode 100644 index 0000000..ccd4a6a --- /dev/null +++ b/thirdparty/apache-rat/.rat-excludes @@ -0,0 +1,8 @@ +thirdparty +generated +build +spdlog +cmake-build-debug +.gitignore +CPPLINT.cfg +cn.pass \ No newline at end of file
