Skip to content

Commit

Permalink
remove xerces-c depends
Browse files Browse the repository at this point in the history
  • Loading branch information
ctapmex committed Sep 30, 2024
1 parent c1dc37a commit fb31de1
Show file tree
Hide file tree
Showing 35 changed files with 34 additions and 946 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
languages: ${{ matrix.language }}

- name: Install dependency
run: sudo apt-get -y install ninja-build libicu-dev libxerces-c-dev zlib1g-dev libminizip-dev
run: sudo apt-get -y install ninja-build libicu-dev libxml2-dev zlib1g-dev libminizip-dev

- name: Create Build folder
run: mkdir -p _build
Expand Down
36 changes: 5 additions & 31 deletions .github/workflows/colorer_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,15 @@ jobs:
arch: [ x64 ]
icu: [ON, OFF]
zip: [ON, OFF]
libxml: [ON, OFF]

name: linux-${{ matrix.arch }}-icu_${{ matrix.icu }}-zip_${{ matrix.zip }}-libxml_${{ matrix.libxml }}
name: linux-${{ matrix.arch }}-icu_${{ matrix.icu }}-zip_${{ matrix.zip }}

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Install dependency
run: sudo apt-get -y install ninja-build libicu-dev libxerces-c-dev zlib1g-dev libminizip-dev libxml2-dev
run: sudo apt-get -y install ninja-build libicu-dev zlib1g-dev libminizip-dev libxml2-dev

- name: Create Build folder
run: mkdir -p _build
Expand All @@ -66,7 +65,6 @@ jobs:
-DCOLORER_BUILD_ARCH=${{ matrix.arch }}
-DCOLORER_USE_ICU_STRINGS=${{ matrix.icu }}
-DCOLORER_USE_ZIPINPUTSOURCE=${{ matrix.zip }}
-DCOLORER_USE_LIBXML=${{ matrix.libxml }}
- name: Build
run: cmake --build _build --config $BUILD_TYPE -j ${{ steps.cpu-cores.outputs.count }}
Expand All @@ -83,7 +81,6 @@ jobs:
arch: [ x64, x86 ]
icu: [ON, OFF]
zip: [ON, OFF]
libxml: [ON, OFF]
include:
- arch: x64
triplet: x64-windows-static-rel
Expand All @@ -93,7 +90,7 @@ jobs:
- arch: x86
zip: OFF

name: windows-${{ matrix.arch }}-icu_${{ matrix.icu }}-zip_${{ matrix.zip }}-libxml_${{ matrix.libxml }}
name: windows-${{ matrix.arch }}-icu_${{ matrix.icu }}-zip_${{ matrix.zip }}

steps:
- name: Checkout source
Expand Down Expand Up @@ -146,7 +143,6 @@ jobs:
-DVCPKG_FEATURE_FLAGS=manifests,versions
-DCOLORER_USE_ICU_STRINGS=${{ matrix.icu }}
-DCOLORER_USE_ZIPINPUTSOURCE=${{ matrix.zip }}
-DCOLORER_USE_LIBXML=${{ matrix.libxml }}
- name: Build
shell: bash
Expand All @@ -164,17 +160,16 @@ jobs:
arch: [ x64 ]
icu: [ON, OFF]
zip: [ON, OFF]
libxml: [ON, OFF]

name: macos-${{ matrix.arch }}-icu_${{ matrix.icu }}-zip_${{ matrix.zip }}-libxml_${{ matrix.libxml }}
name: macos-${{ matrix.arch }}-icu_${{ matrix.icu }}-zip_${{ matrix.zip }}

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Install dependency
# icu4c is already installed
run: brew install xerces-c minizip ninja libxml2
run: brew install minizip ninja libxml2

- name: Relink icu, because he is 'keg-only'
run: brew link icu4c --force
Expand All @@ -191,30 +186,9 @@ jobs:
-DCOLORER_BUILD_ARCH=${{ matrix.arch }}
-DCOLORER_USE_ICU_STRINGS=${{ matrix.icu }}
-DCOLORER_USE_ZIPINPUTSOURCE=${{ matrix.zip }}
-DCOLORER_USE_LIBXML=${{ matrix.libxml }}
- name: Build
run: cmake --build _build --config $BUILD_TYPE -j$(getconf _NPROCESSORS_ONLN)

- name: Test
run: ./_build/tests/unit/unit_tests

test-xercesc:
# check build with xerces-c (unit16_t)
runs-on: ubuntu-22.04
name: linux-xercesc-uint16t

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.PACKAGES_GITHUB_USER }}
password: ${{ secrets.PACKAGES_GITHUB_TOKEN }}

- name: 'Build in docker'
run: |
docker build -f ci/Dockerfile-test-xercesc -t tempx:latest .
9 changes: 0 additions & 9 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,3 @@ jobs:
tags: ghcr.io/colorer/devenv22_base:latest
cache-from: type=registry,ref=ghcr.io/colorer/devenv22_base:latest
cache-to: type=inline

- name: Build and push xercesc image
uses: docker/build-push-action@v6
with:
file: ./ci/Dockerfile-xercesc
push: true
tags: ghcr.io/colorer/devenv22_xercesc:latest
cache-from: type=registry,ref=ghcr.io/colorer/devenv22_base:latest
cache-to: type=inline
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v4

- name: Install dependency
run: sudo apt-get -y install ninja-build libicu-dev libxerces-c-dev libxml2-dev zlib1g-dev libminizip-dev
run: sudo apt-get -y install ninja-build libicu-dev libxml2-dev libxml2-dev zlib1g-dev libminizip-dev

- name: Create Build folder
run: cmake -E make_directory build
Expand Down
7 changes: 1 addition & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ option(COLORER_BUILD_OLD_COMPILERS "Use own implementation for standard library"
option(COLORER_USE_ZIPINPUTSOURCE "Use zip inputsource for schemes" ON)
option(COLORER_USE_DEEPTRACE "Use trace logging" OFF)
option(COLORER_USE_ICU_STRINGS "Use ICU library for strings" ON)
option(COLORER_USE_LIBXML "Use LibXml2 library for parse xml, instead XercesC" OFF)

#====================================================
# global compilation settings
Expand Down Expand Up @@ -76,11 +75,7 @@ if(COLORER_USE_ICU_STRINGS)
find_package(ICU COMPONENTS uc data REQUIRED)
endif()

if(COLORER_USE_LIBXML)
find_package(LibXml2 REQUIRED)
else()
find_package(XercesC REQUIRED)
endif()
find_package(LibXml2 REQUIRED)

if(COLORER_USE_ZIPINPUTSOURCE)
find_package(ZLIB REQUIRED)
Expand Down
27 changes: 4 additions & 23 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,6 @@
},
"hidden": true
},
{
"name": "XercesXml",
"cacheVariables": {
"COLORER_USE_LIBXML": "OFF"
},
"hidden": true
},
{
"name": "LibXml2",
"cacheVariables": {
"COLORER_USE_LIBXML": "ON"
},
"hidden": true
},
{
"name": "Tests",
"cacheVariables": {
Expand Down Expand Up @@ -191,14 +177,9 @@
{ "name": "msvc-arm64-Release", "description": "MSVC for ARM64 (Release, ICU)", "inherits": [ "base", "ARM64", "Release", "MSVC", "vcpkg_win_arm64" ] },
{ "name": "msvc-arm64-Debug-noICU", "description": "MSVC for ARM64 (Debug, noICU)", "inherits": [ "base", "ARM64", "Debug", "MSVC", "vcpkg_win_arm64", "NoICU", "Tests" ] },
{ "name": "msvc-arm64-Release-noICU", "description": "MSVC for ARM64 (Release, noICU)", "inherits": [ "base", "ARM64", "Release", "MSVC", "vcpkg_win_arm64", "NoICU" ] },
{ "name": "linux-x64-Debug-noICU", "description": "Linux for x64 (Debug, noICU, LibXml)", "inherits": [ "base", "x64", "Debug", "NoVcpkg", "NoICU", "Tests", "LibXml2" ] },
{ "name": "linux-x64-Release-noICU", "description": "Linux for x64 (Release, noICU, LibXml)", "inherits": [ "base", "x64", "Release", "NoVcpkg", "NoICU", "LibXml2" ] },
{ "name": "linux-x64-Debug", "description": "Linux for x64 (Debug, ICU, LibXml)", "inherits": [ "base", "x64", "Debug", "NoVcpkg", "Tests", "LibXml2" ] },
{ "name": "linux-x64-Release", "description": "Linux for x64 (Release, ICU, LibXml)", "inherits": [ "base", "x64", "Release", "NoVcpkg", "LibXml2" ] },
{ "name": "linux-x64-Debug-noICU-Xerces", "description": "Linux for x64 (Debug, noICU, Xerces)", "inherits": [ "base", "x64", "Debug", "NoVcpkg", "NoICU", "Tests", "XercesXml"] },
{ "name": "linux-x64-Release-noICU-Xerces", "description": "Linux for x64 (Release, noICU, Xerces)", "inherits": [ "base", "x64", "Release", "NoVcpkg", "NoICU", "XercesXml" ] },
{ "name": "linux-x64-Debug-Xerces", "description": "Linux for x64 (Debug, ICU, Xerces)", "inherits": [ "base", "x64", "Debug", "NoVcpkg", "Tests", "XercesXml" ] },
{ "name": "linux-x64-Release-Xerces", "description": "Linux for x64 (Release, ICU, Xerces)", "inherits": [ "base", "x64", "Release", "NoVcpkg", "XercesXml" ] }

{ "name": "linux-x64-Debug-noICU", "description": "Linux for x64 (Debug, noICU, LibXml)", "inherits": [ "base", "x64", "Debug", "NoVcpkg", "NoICU", "Tests" ] },
{ "name": "linux-x64-Release-noICU", "description": "Linux for x64 (Release, noICU, LibXml)", "inherits": [ "base", "x64", "Release", "NoVcpkg", "NoICU" ] },
{ "name": "linux-x64-Debug", "description": "Linux for x64 (Debug, ICU, LibXml)", "inherits": [ "base", "x64", "Debug", "NoVcpkg", "Tests" ] },
{ "name": "linux-x64-Release", "description": "Linux for x64 (Release, ICU, LibXml)", "inherits": [ "base", "x64", "Release", "NoVcpkg" ] }
]
}
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ You may build library on linux using standard package, without vcpkg.
#### Ubuntu example

```bash
sudo apt install libicu-dev libxerces-c-dev zlib1g-dev libminizip-dev libxml2-dev
sudo apt install libicu-dev zlib1g-dev libminizip-dev libxml2-dev
git clone https://github.com/colorer/Colorer-library.git
cd Colorer-library
mkdir _build
Expand All @@ -57,7 +57,7 @@ cmake --build _build -j$(nproc --all)
#### CentOS Example

```bash
sudo yum install libicu-devel xerces-c-devel zlib-devel minizip1.2-devel
sudo yum install libicu-devel zlib-devel minizip1.2-devel
git clone https://github.com/colorer/Colorer-library.git
cd Colorer-library
mkdir _build
Expand All @@ -67,7 +67,7 @@ cmake --build _build -j$(nproc --all)
### MacOS

```bash
brew install xerces-c icu4c minizip ninja libxml2
brew install icu4c minizip ninja libxml2
git clone https://github.com/colorer/Colorer-library.git
cd Colorer-library
mkdir _build
Expand All @@ -89,7 +89,6 @@ This options available for build
* `COLORER_USE_ZIPINPUTSOURCE` - Enable the ability to work with schemes in zip archives. Default 'ON'.
* `COLORER_USE_DEEPTRACE` - Use trace logging. Default 'OFF'.
* `COLORER_USE_ICU_STRINGS` - Use ICU library for strings. Default 'ON'.
* `COLORER_USE_LIBXML` - Use LibXml2 library for parse xml, instead XercesC. Default 'OFF'.

Links
========================
Expand Down
17 changes: 0 additions & 17 deletions ci/Dockerfile-test-xercesc

This file was deleted.

30 changes: 0 additions & 30 deletions ci/Dockerfile-xercesc

This file was deleted.

2 changes: 1 addition & 1 deletion cmake/colorerConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set(COLORER_USE_ZIPINPUTSOURCE @COLORER_USE_ZIPINPUTSOURCE@)
if(COLORER_USE_ICU_STRINGS)
find_package(ICU COMPONENTS uc data REQUIRED)
endif()
find_package(XercesC REQUIRED)
find_package(LibXml2 REQUIRED)

if(COLORER_USE_ZIPINPUTSOURCE)
find_package(ZLIB REQUIRED)
Expand Down
65 changes: 17 additions & 48 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,48 +94,23 @@ set(SRC_COLORER
colorer/xml/XmlReader.h
)

if(COLORER_USE_LIBXML)
set(COLORER_FEATURE_LIBXML 1)
set(SRC_COLORER_XML
colorer/xml/libxml2/LibXmlReader.cpp
colorer/xml/libxml2/LibXmlReader.h
colorer/xml/libxml2/LibXmlInputSource.h
colorer/xml/libxml2/LibXmlInputSource.cpp
)
else()
set(SRC_COLORER_XML
colorer/xml/xercesc/BaseEntityResolver.cpp
colorer/xml/xercesc/BaseEntityResolver.h
colorer/xml/xercesc/LocalFileXmlInputSource.cpp
colorer/xml/xercesc/LocalFileXmlInputSource.h
colorer/xml/xercesc/SharedXmlInputSource.cpp
colorer/xml/xercesc/SharedXmlInputSource.h
colorer/xml/xercesc/XercesXmlInputSource.cpp
colorer/xml/xercesc/XercesXmlInputSource.h
colorer/xml/xercesc/XmlParserErrorHandler.cpp
colorer/xml/xercesc/XmlParserErrorHandler.h
colorer/xml/xercesc/XercesXmlReader.h
colorer/xml/xercesc/XercesXmlReader.cpp
)
endif()

set(SRC_COLORER_XML
colorer/xml/libxml2/LibXmlReader.cpp
colorer/xml/libxml2/LibXmlReader.h
colorer/xml/libxml2/LibXmlInputSource.h
colorer/xml/libxml2/LibXmlInputSource.cpp
)


if(COLORER_USE_ZIPINPUTSOURCE)
set(COLORER_FEATURE_ZIPINPUTSOURCE 1)
if(COLORER_USE_LIBXML)
set(SRC_COLORER_ZIP
colorer/xml/libxml2/SharedXmlInputSource.cpp
colorer/xml/libxml2/SharedXmlInputSource.h
colorer/zip/MemoryFile.cpp
colorer/zip/MemoryFile.h
)
else ()
set(SRC_COLORER_ZIP
colorer/xml/xercesc/ZipXmlInputSource.cpp
colorer/xml/xercesc/ZipXmlInputSource.h
colorer/zip/MemoryFile.cpp
colorer/zip/MemoryFile.h
)
endif ()
set(SRC_COLORER_ZIP
colorer/xml/libxml2/SharedXmlInputSource.cpp
colorer/xml/libxml2/SharedXmlInputSource.h
colorer/zip/MemoryFile.cpp
colorer/zip/MemoryFile.h
)
endif()

if(COLORER_USE_ICU_STRINGS)
Expand Down Expand Up @@ -256,15 +231,9 @@ set_target_properties(colorer_lib PROPERTIES
CXX_EXTENSIONS NO
)

if(COLORER_USE_LIBXML)
target_link_libraries(colorer_lib
PUBLIC LibXml2::LibXml2
)
else()
target_link_libraries(colorer_lib
PUBLIC XercesC::XercesC
)
endif()
target_link_libraries(colorer_lib
PUBLIC LibXml2::LibXml2
)

if(COLORER_USE_ICU_STRINGS)
target_link_libraries(colorer_lib
Expand Down
1 change: 0 additions & 1 deletion src/colorer/common/Features.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#cmakedefine COLORER_USE_DEEPTRACE

#cmakedefine COLORER_FEATURE_LIBXML
/**
If defined, JAR InputSource is implemented.
*/
Expand Down
Loading

0 comments on commit fb31de1

Please sign in to comment.