You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rm...@apache.org on 2022/10/28 23:58:31 UTC

[logging-log4cxx] branch master updated: LOGCXX-562 (#144)

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

rmiddleton pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git


The following commit(s) were added to refs/heads/master by this push:
     new d117f0be LOGCXX-562 (#144)
d117f0be is described below

commit d117f0bef87b73a77eafb71b2e5ab31e7a2092a4
Author: Robert Middleton <rm...@users.noreply.github.com>
AuthorDate: Fri Oct 28 19:58:26 2022 -0400

    LOGCXX-562 (#144)
    
    Added new workflow runs and moved some others around.
    
    Added test to compile with C++11
    
    Update actions to latest versions.
    
    Co-authored-by: Stephen Webb <st...@sabreautonomous.com.au>
---
 .github/workflows/log4cxx-cpp11.yml          |  48 +++++++++++
 .github/workflows/log4cxx-posix.yml          |  86 +++++++++++++++++++
 .github/workflows/log4cxx-windows-static.yml |  87 ++++++++++++++++++++
 .github/workflows/log4cxx-windows.yml        |  86 +++++++++++++++++++
 .github/workflows/log4cxx.yml                | 119 ---------------------------
 src/examples/cpp/CMakeLists.txt              |   2 +-
 src/examples/cpp/format-string.cpp           |   2 +
 7 files changed, 310 insertions(+), 120 deletions(-)

diff --git a/.github/workflows/log4cxx-cpp11.yml b/.github/workflows/log4cxx-cpp11.yml
new file mode 100644
index 00000000..803c9b93
--- /dev/null
+++ b/.github/workflows/log4cxx-cpp11.yml
@@ -0,0 +1,48 @@
+# 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.
+name: log4cxx-cpp11
+
+on: [push, pull_request]
+
+jobs:
+  job:
+    name: log4cxx-cpp11
+    runs-on: ubuntu-20.04
+    timeout-minutes: 38
+    steps:
+    - uses: actions/checkout@v3
+      with:
+        path: main
+
+    - name: 'Configure Dependencies - Ubuntu'
+      run: |
+        sudo apt-get update
+        sudo apt-get install -y libapr1-dev libaprutil1-dev libboost-filesystem-dev libboost-thread-dev
+
+    - name: 'run cmake - *nix'
+      run: |
+        cd main
+        mkdir build
+        cd build
+        cmake -DCMAKE_CXX_STANDARD=11 ..
+        cmake --build .
+
+    - name: run unit tests
+      shell: pwsh
+      run: |
+        cd main
+        cd build
+        ctest -C Debug --output-on-failure -V
+
diff --git a/.github/workflows/log4cxx-posix.yml b/.github/workflows/log4cxx-posix.yml
new file mode 100644
index 00000000..7f3b98e2
--- /dev/null
+++ b/.github/workflows/log4cxx-posix.yml
@@ -0,0 +1,86 @@
+# 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.
+name: log4cxx-posix
+
+on: [push, pull_request]
+
+jobs:
+  job:
+    name: ${{ matrix.os }}-${{ matrix.cxx }}-build-and-test
+    runs-on: ${{ matrix.os }}
+    timeout-minutes: 38
+    strategy:
+      fail-fast: false
+      matrix:
+        name: [ubuntu18-gcc, ubuntu18-clang, ubuntu20-gcc, ubuntu20-clang, ubuntu22-gcc, ubuntu22-clang, osx-11, osx-12]
+        include:
+          - name: ubuntu18-gcc
+            os: ubuntu-18.04
+            cxx: g++
+            cc: gcc
+          - name: ubuntu18-clang
+            os: ubuntu-18.04
+            cxx: clang++
+            cc: clang
+          - name: ubuntu20-gcc
+            os: ubuntu-20.04
+            cxx: g++
+            cc: gcc
+          - name: ubuntu20-clang
+            os: ubuntu-20.04
+            cxx: clang++
+            cc: clang
+          - name: ubuntu22-gcc
+            os: ubuntu-22.04
+            cxx: g++
+            cc: gcc
+          - name: ubuntu22-clang
+            os: ubuntu-22.04
+            cxx: clang++
+            cc: clang
+          - name: osx-11
+            os: macos-11
+            cxx: clang++
+            cc: clang
+          - name: osx-12
+            os: macos-12
+            cxx: clang++
+            cc: clang
+
+    steps:
+    - uses: actions/checkout@v3
+      with:
+        path: main
+
+    - name: 'Configure Dependencies - Ubuntu'
+      if: startsWith( matrix.name,'ubuntu' )
+      run: |
+        sudo apt-get update
+        sudo apt-get install -y libapr1-dev libaprutil1-dev libfmt-dev
+
+    - name: 'run cmake - posix'
+      run: |
+        cd main
+        mkdir build
+        cd build
+        cmake -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DCMAKE_C_COMPILER=${{ matrix.cc }} ..
+        cmake --build .
+
+    - name: run unit tests
+      shell: pwsh
+      run: |
+        cd main
+        cd build
+        ctest -C Debug --output-on-failure -V
diff --git a/.github/workflows/log4cxx-windows-static.yml b/.github/workflows/log4cxx-windows-static.yml
new file mode 100644
index 00000000..5cb4de2a
--- /dev/null
+++ b/.github/workflows/log4cxx-windows-static.yml
@@ -0,0 +1,87 @@
+# 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.
+name: log4cxx-windows-static
+
+on: [push, pull_request]
+
+jobs:
+  job:
+    name: ${{ matrix.os }}-${{ matrix.cxx }}-build-and-test
+    runs-on: ${{ matrix.os }}
+    timeout-minutes: 38
+    strategy:
+      fail-fast: false
+      matrix:
+        name: [windows-2019, windows-2022]
+        include:
+          - name: windows-2019
+            os: windows-2019
+          - name: windows-2022
+            os: windows-2022
+
+    steps:
+    - uses: actions/checkout@v3
+      with:
+        path: main
+
+    - name: 'Restore Prebuilt Dependencies'
+      id: restore-vcpkg-cache
+      uses: actions/cache@v3
+      with:
+        path: vcpkg
+        key: ${{ runner.os }}-${{ matrix.name }}-cache-x64-static
+
+    - name: 'Checkout VCPKG'
+      if: steps.restore-vcpkg-cache.outputs.cache-hit != 'true'
+      uses: actions/checkout@v3
+      with:
+        repository: microsoft/vcpkg
+        path: vcpkg
+        ref: 2022.10.19
+
+    - name: 'Configure Dependencies'
+      if: steps.restore-vcpkg-cache.outputs.cache-hit != 'true'
+      id: runvcpkg
+      shell: pwsh
+      run: |
+        cd vcpkg
+        ./bootstrap-vcpkg.bat
+        ./vcpkg install apr apr-util --triplet=x64-windows-static
+
+    - name: 'Install zip'
+      id: install-zip
+      shell: pwsh
+      run: |
+        $Env:PATH += ";C:\msys64\usr\bin"
+        pacman --noconfirm -S zip
+
+    - name: 'run cmake - static'
+      shell: pwsh
+      run: |
+        $THISDIR=Get-Location
+        cd main
+        mkdir build
+        cd build
+        cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DBUILD_SHARED_LIBS=off -DLOG4CXX_TEST_PROGRAM_PATH=C:\msys64\usr\bin "-DCMAKE_TOOLCHAIN_FILE=$THISDIR/vcpkg/scripts/buildsystems/vcpkg.cmake" ..
+        cmake --build .
+
+    - name: run unit tests
+      shell: pwsh
+      run: |
+        cd main
+        cd build
+        ctest -C Debug --output-on-failure -V
+
+
diff --git a/.github/workflows/log4cxx-windows.yml b/.github/workflows/log4cxx-windows.yml
new file mode 100644
index 00000000..2dcc0b69
--- /dev/null
+++ b/.github/workflows/log4cxx-windows.yml
@@ -0,0 +1,86 @@
+# 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.
+name: log4cxx-windows
+
+on: [push, pull_request]
+
+jobs:
+  job:
+    name: ${{ matrix.os }}-${{ matrix.cxx }}-build-and-test
+    runs-on: ${{ matrix.os }}
+    timeout-minutes: 38
+    strategy:
+      fail-fast: false
+      matrix:
+        name: [windows-2019, windows-2022]
+        include:
+          - name: windows-2019
+            os: windows-2019
+          - name: windows-2022
+            os: windows-2022
+
+    steps:
+    - uses: actions/checkout@v3
+      with:
+        path: main
+
+    - name: 'Restore Prebuilt Dependencies'
+      id: restore-vcpkg-cache
+      uses: actions/cache@v3
+      with:
+        path: vcpkg
+        key: ${{ runner.os }}-${{ matrix.name }}-cache-x64
+
+    - name: 'Checkout VCPKG'
+      if: steps.restore-vcpkg-cache.outputs.cache-hit != 'true'
+      uses: actions/checkout@v3
+      with:
+        repository: microsoft/vcpkg
+        path: vcpkg
+        ref: 2022.10.19
+
+    - name: 'Configure Dependencies'
+      if: steps.restore-vcpkg-cache.outputs.cache-hit != 'true'
+      id: runvcpkg
+      shell: pwsh
+      run: |
+        cd vcpkg
+        ./bootstrap-vcpkg.bat
+        ./vcpkg install apr apr-util --triplet=x64-windows
+
+    - name: 'Install zip'
+      id: install-zip
+      shell: pwsh
+      run: |
+        $Env:PATH += ";C:\msys64\usr\bin"
+        pacman --noconfirm -S zip
+
+    - name: 'run cmake'
+      shell: pwsh
+      run: |
+        $THISDIR=Get-Location
+        cd main
+        mkdir build
+        cd build
+        cmake -DLOG4CXX_TEST_PROGRAM_PATH=C:\msys64\usr\bin "-DCMAKE_TOOLCHAIN_FILE=$THISDIR/vcpkg/scripts/buildsystems/vcpkg.cmake" ..
+        cmake --build .
+
+    - name: run unit tests
+      shell: pwsh
+      run: |
+        cd main
+        cd build
+        ctest -C Debug --output-on-failure -V
+
diff --git a/.github/workflows/log4cxx.yml b/.github/workflows/log4cxx.yml
deleted file mode 100644
index 469691d4..00000000
--- a/.github/workflows/log4cxx.yml
+++ /dev/null
@@ -1,119 +0,0 @@
-# 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.
-name: log4cxx
-
-on: [push, pull_request]
-
-jobs:
-  job:
-    name: ${{ matrix.os }}-${{ matrix.cxx }}-build-and-test
-    runs-on: ${{ matrix.os }}
-    timeout-minutes: 38
-    strategy:
-      fail-fast: false
-      matrix:
-        name: [ubuntu18-gcc, ubuntu18-clang, osx, windows-2019]
-        include:
-          - name: windows-2019
-            os: windows-2019
-            cxx: cl.exe
-            cc: cl.exe
-          - name: ubuntu18-gcc
-            os: ubuntu-18.04
-            cxx: g++
-            cc: gcc
-          - name: ubuntu18-clang
-            os: ubuntu-18.04
-            cxx: clang++
-            cc: clang
-          - name: osx
-            os: macos-latest
-            cxx: clang++
-            cc: clang
-
-    steps:
-    - uses: actions/checkout@v2
-      with:
-        path: main
-
-    - name: 'Configure Dependencies - Ubuntu'
-      if: matrix.name == 'ubuntu18-gcc' || matrix.name == 'ubuntu18-clang'
-      run: |
-        sudo apt-get update
-        sudo apt-get install -y libapr1-dev libaprutil1-dev
-
-    - name: 'Restore Prebuilt Dependencies - Windows'
-      id: restore-vcpkg-cache
-      if: matrix.name == 'windows-2019' || matrix.name == 'windows-2016'
-      uses: actions/cache@v2
-      with:
-        path: vcpkg
-        key: ${{ runner.os }}-${{ matrix.name }}-cache-x64
-
-    - name: 'Checkout VCPKG - Windows'
-      if: (matrix.name == 'windows-2019' || matrix.name == 'windows-2016') && steps.restore-vcpkg-cache.outputs.cache-hit != 'true'
-      uses: actions/checkout@v2
-      with:
-        repository: microsoft/vcpkg
-        path: vcpkg
-        ref: af2287382b1991dbdcb7e5112d236f3323b9dd7a
-
-    - name: 'Configure Dependencies - Windows'
-      if: (matrix.name == 'windows-2019' || matrix.name == 'windows-2016') && steps.restore-vcpkg-cache.outputs.cache-hit != 'true'
-      id: runvcpkg
-      shell: pwsh
-      run: |
-        cd vcpkg
-        ./bootstrap-vcpkg.bat
-        ./vcpkg install apr apr-util --triplet=x64-windows
-        ./vcpkg install apr apr-util --triplet=x64-windows-static
-
-    - name: 'run cmake - win'
-      if: (matrix.name == 'windows-2019' || matrix.name == 'windows-2016') 
-      shell: pwsh
-      run: |
-        $THISDIR=Get-Location
-        cd main
-        mkdir build
-        cd build
-        cmake -DLOG4CXX_TEST_PROGRAM_PATH=C:\msys64\usr\bin "-DCMAKE_TOOLCHAIN_FILE=$THISDIR/vcpkg/scripts/buildsystems/vcpkg.cmake" -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DCMAKE_C_COMPILER=${{ matrix.cc }} ..
-        cmake --build .
-
-    - name: 'run cmake - win-static'
-      if: matrix.name == 'windows-2019'
-      shell: pwsh
-      run: |
-        $THISDIR=Get-Location
-        cd main
-        mkdir build-static
-        cd build-static
-        cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DBUILD_SHARED_LIBS=off -DLOG4CXX_TEST_PROGRAM_PATH=C:\msys64\usr\bin "-DCMAKE_TOOLCHAIN_FILE=$THISDIR/vcpkg/scripts/buildsystems/vcpkg.cmake" -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DCMAKE_C_COMPILER=${{ matrix.cc }} ..
-        cmake --build .
-
-    - name: 'run cmake - *nix'
-      if: matrix.name != 'windows-2019'
-      run: |
-        cd main
-        mkdir build
-        cd build
-        cmake -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DCMAKE_C_COMPILER=${{ matrix.cc }} ..
-        cmake --build .
-
-    - name: run unit tests
-      shell: pwsh
-      run: |
-        cd main
-        cd build
-        ctest -C Debug --output-on-failure -V
diff --git a/src/examples/cpp/CMakeLists.txt b/src/examples/cpp/CMakeLists.txt
index cfb2fe7a..be6092de 100644
--- a/src/examples/cpp/CMakeLists.txt
+++ b/src/examples/cpp/CMakeLists.txt
@@ -29,7 +29,7 @@ configure_file( custom-appender.xml
     COPYONLY )
 
 # Custom handling for format string example, since it utilizes libfmt
-find_package(fmt QUIET)
+find_package(fmt 6.0 QUIET)
 if(${fmt_FOUND})
     add_executable( format-string format-string.cpp )
     target_compile_definitions(format-string PRIVATE ${LOG4CXX_COMPILE_DEFINITIONS} ${APR_COMPILE_DEFINITIONS} ${APR_UTIL_COMPILE_DEFINITIONS} )
diff --git a/src/examples/cpp/format-string.cpp b/src/examples/cpp/format-string.cpp
index cab349c1..19dafa37 100644
--- a/src/examples/cpp/format-string.cpp
+++ b/src/examples/cpp/format-string.cpp
@@ -34,7 +34,9 @@ std::ostream& operator<<( std::ostream& stream, const MyStruct& mystruct ){
 		stream << "[MyStruct x:" << mystruct.x << "]";
 		return stream;
 }
+#if FMT_VERSION >= (9 * 10000)
 template <> struct fmt::formatter<MyStruct> : ostream_formatter {};
+#endif
 
 int main()
 {