You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ab...@apache.org on 2021/05/31 15:38:01 UTC

[nifi-minifi-cpp] branch main updated: MINIFICPP-1575 - Make linter creation configurable

This is an automated email from the ASF dual-hosted git repository.

aboda pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git


The following commit(s) were added to refs/heads/main by this push:
     new 88deb7a  MINIFICPP-1575 - Make linter creation configurable
88deb7a is described below

commit 88deb7a0e4672ca3a66d9698022ae21906e1f817
Author: Adam Debreceni <ad...@apache.org>
AuthorDate: Mon May 31 13:41:12 2021 +0200

    MINIFICPP-1575 - Make linter creation configurable
    
    Signed-off-by: Arpad Boda <ab...@apache.org>
    
    This closes #1091
---
 .github/workflows/ci.yml |  2 +-
 CMakeLists.txt           |  1 +
 cmake/Extensions.cmake   | 10 ++++++----
 win_build_vs.bat         |  4 +++-
 4 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d330b4a..489fed1 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -152,7 +152,7 @@ jobs:
         run: |
           PATH %PATH%;C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64
           PATH %PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Roslyn
-          win_build_vs.bat build /2019 /64 /CI /S /A /PDH /T
+          win_build_vs.bat build /2019 /64 /CI /S /A /PDH /T /L
         shell: cmd
       - name: test
         run: cd build && ctest --timeout 300 --parallel 8 -C Release --output-on-failure
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8c80382..ab21b88 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,6 +37,7 @@ include(ExternalProject)
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
 include(WholeArchive)
 
+option(ENABLE_LINTER "Create linter components" ON)
 option(SKIP_TESTS "Skips building all tests." OFF)
 option(PORTABLE "Instructs the compiler to remove architecture specific optimizations" ON)
 option(USE_SHARED_LIBS "Builds using shared libraries" ON)
diff --git a/cmake/Extensions.cmake b/cmake/Extensions.cmake
index 774a001..2475906 100644
--- a/cmake/Extensions.cmake
+++ b/cmake/Extensions.cmake
@@ -68,10 +68,12 @@ endfunction()
 
 
 macro(register_extension_linter target-name)
-  get_property(extensions GLOBAL PROPERTY EXTENSION-LINTERS)
-  set_property(GLOBAL APPEND PROPERTY EXTENSION-LINTERS "${target-name}")
-  add_custom_target(${target-name}
-  COMMAND python ${CMAKE_SOURCE_DIR}/thirdparty/google-styleguide/run_linter.py -q -i ${CMAKE_CURRENT_LIST_DIR}/)
+  if (ENABLE_LINTER)
+    get_property(extensions GLOBAL PROPERTY EXTENSION-LINTERS)
+    set_property(GLOBAL APPEND PROPERTY EXTENSION-LINTERS "${target-name}")
+    add_custom_target(${target-name}
+    COMMAND python ${CMAKE_SOURCE_DIR}/thirdparty/google-styleguide/run_linter.py -q -i ${CMAKE_CURRENT_LIST_DIR}/)
+  endif()
 endmacro()
 
 # ARGN WILL be the
diff --git a/win_build_vs.bat b/win_build_vs.bat
index 952e3af..b710792 100755
--- a/win_build_vs.bat
+++ b/win_build_vs.bat
@@ -36,6 +36,7 @@ set cpack=OFF
 set installer_merge_modules=OFF
 set strict_gsl_checks=
 set redist=
+set build_linter=OFF
 
 set arg_counter=0
 for %%x in (%*) do (
@@ -58,12 +59,13 @@ for %%x in (%*) do (
     if [%%~x] EQU [/DD]          set cmake_build_type=Debug
     if [%%~x] EQU [/CI]          set "strict_gsl_checks=-DSTRICT_GSL_CHECKS=AUDIT" & set test_custom_wel_provider=ON
     if [%%~x] EQU [/NONFREEUCRT] set "redist=-DMSI_REDISTRIBUTE_UCRT_NONASL=ON"
+    if [%%~x] EQU [/L]           set build_linter=ON
 )
 
 mkdir %builddir%
 pushd %builddir%\
 
-cmake -G %generator% -A %build_platform% -DINSTALLER_MERGE_MODULES=%installer_merge_modules% -DTEST_CUSTOM_WEL_PROVIDER=%test_custom_wel_provider% -DENABLE_SQL=%build_SQL% -DCMAKE_BUILD_TYPE_INIT=%cmake_build_type% -DCMAKE_BUILD_TYPE=%cmake_build_type% -DWIN32=WIN32 -DENABLE_LIBRDKAFKA=%build_kafka% -DENABLE_JNI=%build_jni% -DOPENSSL_OFF=OFF -DENABLE_COAP=%build_coap% -DENABLE_AWS=%build_AWS% -DENABLE_PDH=%build_PDH% -DENABLE_AZURE=%build_azure% -DENABLE_SFTP=%build_SFTP%  -DUSE_SHARED_L [...]
+cmake -G %generator% -A %build_platform% -DINSTALLER_MERGE_MODULES=%installer_merge_modules% -DTEST_CUSTOM_WEL_PROVIDER=%test_custom_wel_provider% -DENABLE_SQL=%build_SQL% -DCMAKE_BUILD_TYPE_INIT=%cmake_build_type% -DCMAKE_BUILD_TYPE=%cmake_build_type% -DWIN32=WIN32 -DENABLE_LIBRDKAFKA=%build_kafka% -DENABLE_JNI=%build_jni% -DOPENSSL_OFF=OFF -DENABLE_COAP=%build_coap% -DENABLE_AWS=%build_AWS% -DENABLE_PDH=%build_PDH% -DENABLE_AZURE=%build_azure% -DENABLE_SFTP=%build_SFTP%  -DUSE_SHARED_L [...]
 IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
 if [%cpack%] EQU [ON] (
     cpack -C %cmake_build_type%