Skip to content

Commit 7a0caca

Browse files
committed
remove xerces-c depends
1 parent c1dc37a commit 7a0caca

37 files changed

+34
-1001
lines changed

.github/workflows/codeql-analysis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
languages: ${{ matrix.language }}
3636

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

4040
- name: Create Build folder
4141
run: mkdir -p _build

.github/workflows/colorer_ci.yml

+5-31
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,15 @@ jobs:
3939
arch: [ x64 ]
4040
icu: [ON, OFF]
4141
zip: [ON, OFF]
42-
libxml: [ON, OFF]
4342

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

4645
steps:
4746
- name: Checkout source
4847
uses: actions/checkout@v4
4948

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

5352
- name: Create Build folder
5453
run: mkdir -p _build
@@ -66,7 +65,6 @@ jobs:
6665
-DCOLORER_BUILD_ARCH=${{ matrix.arch }}
6766
-DCOLORER_USE_ICU_STRINGS=${{ matrix.icu }}
6867
-DCOLORER_USE_ZIPINPUTSOURCE=${{ matrix.zip }}
69-
-DCOLORER_USE_LIBXML=${{ matrix.libxml }}
7068
7169
- name: Build
7270
run: cmake --build _build --config $BUILD_TYPE -j ${{ steps.cpu-cores.outputs.count }}
@@ -83,7 +81,6 @@ jobs:
8381
arch: [ x64, x86 ]
8482
icu: [ON, OFF]
8583
zip: [ON, OFF]
86-
libxml: [ON, OFF]
8784
include:
8885
- arch: x64
8986
triplet: x64-windows-static-rel
@@ -93,7 +90,7 @@ jobs:
9390
- arch: x86
9491
zip: OFF
9592

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

9895
steps:
9996
- name: Checkout source
@@ -146,7 +143,6 @@ jobs:
146143
-DVCPKG_FEATURE_FLAGS=manifests,versions
147144
-DCOLORER_USE_ICU_STRINGS=${{ matrix.icu }}
148145
-DCOLORER_USE_ZIPINPUTSOURCE=${{ matrix.zip }}
149-
-DCOLORER_USE_LIBXML=${{ matrix.libxml }}
150146
151147
- name: Build
152148
shell: bash
@@ -164,17 +160,16 @@ jobs:
164160
arch: [ x64 ]
165161
icu: [ON, OFF]
166162
zip: [ON, OFF]
167-
libxml: [ON, OFF]
168163

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

171166
steps:
172167
- name: Checkout source
173168
uses: actions/checkout@v4
174169

175170
- name: Install dependency
176171
# icu4c is already installed
177-
run: brew install xerces-c minizip ninja libxml2
172+
run: brew install minizip ninja libxml2
178173

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

199193
- name: Test
200194
run: ./_build/tests/unit/unit_tests
201-
202-
test-xercesc:
203-
# check build with xerces-c (unit16_t)
204-
runs-on: ubuntu-22.04
205-
name: linux-xercesc-uint16t
206-
207-
steps:
208-
- name: Checkout source
209-
uses: actions/checkout@v4
210-
211-
- name: 'Login to GitHub Container Registry'
212-
uses: docker/login-action@v3
213-
with:
214-
registry: ghcr.io
215-
username: ${{ secrets.PACKAGES_GITHUB_USER }}
216-
password: ${{ secrets.PACKAGES_GITHUB_TOKEN }}
217-
218-
- name: 'Build in docker'
219-
run: |
220-
docker build -f ci/Dockerfile-test-xercesc -t tempx:latest .

.github/workflows/docker_build.yml

-9
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,3 @@ jobs:
2525
tags: ghcr.io/colorer/devenv22_base:latest
2626
cache-from: type=registry,ref=ghcr.io/colorer/devenv22_base:latest
2727
cache-to: type=inline
28-
29-
- name: Build and push xercesc image
30-
uses: docker/build-push-action@v6
31-
with:
32-
file: ./ci/Dockerfile-xercesc
33-
push: true
34-
tags: ghcr.io/colorer/devenv22_xercesc:latest
35-
cache-from: type=registry,ref=ghcr.io/colorer/devenv22_base:latest
36-
cache-to: type=inline

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: actions/checkout@v4
1818

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

2222
- name: Create Build folder
2323
run: cmake -E make_directory build

CMakeLists.txt

+1-6
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ option(COLORER_BUILD_OLD_COMPILERS "Use own implementation for standard library"
4646
option(COLORER_USE_ZIPINPUTSOURCE "Use zip inputsource for schemes" ON)
4747
option(COLORER_USE_DEEPTRACE "Use trace logging" OFF)
4848
option(COLORER_USE_ICU_STRINGS "Use ICU library for strings" ON)
49-
option(COLORER_USE_LIBXML "Use LibXml2 library for parse xml, instead XercesC" OFF)
5049

5150
#====================================================
5251
# global compilation settings
@@ -76,11 +75,7 @@ if(COLORER_USE_ICU_STRINGS)
7675
find_package(ICU COMPONENTS uc data REQUIRED)
7776
endif()
7877

79-
if(COLORER_USE_LIBXML)
80-
find_package(LibXml2 REQUIRED)
81-
else()
82-
find_package(XercesC REQUIRED)
83-
endif()
78+
find_package(LibXml2 REQUIRED)
8479

8580
if(COLORER_USE_ZIPINPUTSOURCE)
8681
find_package(ZLIB REQUIRED)

CMakePresets.json

+4-23
Original file line numberDiff line numberDiff line change
@@ -129,20 +129,6 @@
129129
},
130130
"hidden": true
131131
},
132-
{
133-
"name": "XercesXml",
134-
"cacheVariables": {
135-
"COLORER_USE_LIBXML": "OFF"
136-
},
137-
"hidden": true
138-
},
139-
{
140-
"name": "LibXml2",
141-
"cacheVariables": {
142-
"COLORER_USE_LIBXML": "ON"
143-
},
144-
"hidden": true
145-
},
146132
{
147133
"name": "Tests",
148134
"cacheVariables": {
@@ -191,14 +177,9 @@
191177
{ "name": "msvc-arm64-Release", "description": "MSVC for ARM64 (Release, ICU)", "inherits": [ "base", "ARM64", "Release", "MSVC", "vcpkg_win_arm64" ] },
192178
{ "name": "msvc-arm64-Debug-noICU", "description": "MSVC for ARM64 (Debug, noICU)", "inherits": [ "base", "ARM64", "Debug", "MSVC", "vcpkg_win_arm64", "NoICU", "Tests" ] },
193179
{ "name": "msvc-arm64-Release-noICU", "description": "MSVC for ARM64 (Release, noICU)", "inherits": [ "base", "ARM64", "Release", "MSVC", "vcpkg_win_arm64", "NoICU" ] },
194-
{ "name": "linux-x64-Debug-noICU", "description": "Linux for x64 (Debug, noICU, LibXml)", "inherits": [ "base", "x64", "Debug", "NoVcpkg", "NoICU", "Tests", "LibXml2" ] },
195-
{ "name": "linux-x64-Release-noICU", "description": "Linux for x64 (Release, noICU, LibXml)", "inherits": [ "base", "x64", "Release", "NoVcpkg", "NoICU", "LibXml2" ] },
196-
{ "name": "linux-x64-Debug", "description": "Linux for x64 (Debug, ICU, LibXml)", "inherits": [ "base", "x64", "Debug", "NoVcpkg", "Tests", "LibXml2" ] },
197-
{ "name": "linux-x64-Release", "description": "Linux for x64 (Release, ICU, LibXml)", "inherits": [ "base", "x64", "Release", "NoVcpkg", "LibXml2" ] },
198-
{ "name": "linux-x64-Debug-noICU-Xerces", "description": "Linux for x64 (Debug, noICU, Xerces)", "inherits": [ "base", "x64", "Debug", "NoVcpkg", "NoICU", "Tests", "XercesXml"] },
199-
{ "name": "linux-x64-Release-noICU-Xerces", "description": "Linux for x64 (Release, noICU, Xerces)", "inherits": [ "base", "x64", "Release", "NoVcpkg", "NoICU", "XercesXml" ] },
200-
{ "name": "linux-x64-Debug-Xerces", "description": "Linux for x64 (Debug, ICU, Xerces)", "inherits": [ "base", "x64", "Debug", "NoVcpkg", "Tests", "XercesXml" ] },
201-
{ "name": "linux-x64-Release-Xerces", "description": "Linux for x64 (Release, ICU, Xerces)", "inherits": [ "base", "x64", "Release", "NoVcpkg", "XercesXml" ] }
202-
180+
{ "name": "linux-x64-Debug-noICU", "description": "Linux for x64 (Debug, noICU, LibXml)", "inherits": [ "base", "x64", "Debug", "NoVcpkg", "NoICU", "Tests" ] },
181+
{ "name": "linux-x64-Release-noICU", "description": "Linux for x64 (Release, noICU, LibXml)", "inherits": [ "base", "x64", "Release", "NoVcpkg", "NoICU" ] },
182+
{ "name": "linux-x64-Debug", "description": "Linux for x64 (Debug, ICU, LibXml)", "inherits": [ "base", "x64", "Debug", "NoVcpkg", "Tests" ] },
183+
{ "name": "linux-x64-Release", "description": "Linux for x64 (Release, ICU, LibXml)", "inherits": [ "base", "x64", "Release", "NoVcpkg" ] }
203184
]
204185
}

README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ You may build library on linux using standard package, without vcpkg.
4646
#### Ubuntu example
4747

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

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

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

9493
Links
9594
========================

ci/Dockerfile-test-xercesc

-17
This file was deleted.

ci/Dockerfile-xercesc

-30
This file was deleted.

cmake/colorerConfig.cmake.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set(COLORER_USE_ZIPINPUTSOURCE @COLORER_USE_ZIPINPUTSOURCE@)
44
if(COLORER_USE_ICU_STRINGS)
55
find_package(ICU COMPONENTS uc data REQUIRED)
66
endif()
7-
find_package(XercesC REQUIRED)
7+
find_package(LibXml2 REQUIRED)
88

99
if(COLORER_USE_ZIPINPUTSOURCE)
1010
find_package(ZLIB REQUIRED)

src/CMakeLists.txt

+17-48
Original file line numberDiff line numberDiff line change
@@ -94,48 +94,23 @@ set(SRC_COLORER
9494
colorer/xml/XmlReader.h
9595
)
9696

97-
if(COLORER_USE_LIBXML)
98-
set(COLORER_FEATURE_LIBXML 1)
99-
set(SRC_COLORER_XML
100-
colorer/xml/libxml2/LibXmlReader.cpp
101-
colorer/xml/libxml2/LibXmlReader.h
102-
colorer/xml/libxml2/LibXmlInputSource.h
103-
colorer/xml/libxml2/LibXmlInputSource.cpp
104-
)
105-
else()
106-
set(SRC_COLORER_XML
107-
colorer/xml/xercesc/BaseEntityResolver.cpp
108-
colorer/xml/xercesc/BaseEntityResolver.h
109-
colorer/xml/xercesc/LocalFileXmlInputSource.cpp
110-
colorer/xml/xercesc/LocalFileXmlInputSource.h
111-
colorer/xml/xercesc/SharedXmlInputSource.cpp
112-
colorer/xml/xercesc/SharedXmlInputSource.h
113-
colorer/xml/xercesc/XercesXmlInputSource.cpp
114-
colorer/xml/xercesc/XercesXmlInputSource.h
115-
colorer/xml/xercesc/XmlParserErrorHandler.cpp
116-
colorer/xml/xercesc/XmlParserErrorHandler.h
117-
colorer/xml/xercesc/XercesXmlReader.h
118-
colorer/xml/xercesc/XercesXmlReader.cpp
119-
)
120-
endif()
97+
98+
set(SRC_COLORER_XML
99+
colorer/xml/libxml2/LibXmlReader.cpp
100+
colorer/xml/libxml2/LibXmlReader.h
101+
colorer/xml/libxml2/LibXmlInputSource.h
102+
colorer/xml/libxml2/LibXmlInputSource.cpp
103+
)
104+
121105

122106
if(COLORER_USE_ZIPINPUTSOURCE)
123107
set(COLORER_FEATURE_ZIPINPUTSOURCE 1)
124-
if(COLORER_USE_LIBXML)
125-
set(SRC_COLORER_ZIP
126-
colorer/xml/libxml2/SharedXmlInputSource.cpp
127-
colorer/xml/libxml2/SharedXmlInputSource.h
128-
colorer/zip/MemoryFile.cpp
129-
colorer/zip/MemoryFile.h
130-
)
131-
else ()
132-
set(SRC_COLORER_ZIP
133-
colorer/xml/xercesc/ZipXmlInputSource.cpp
134-
colorer/xml/xercesc/ZipXmlInputSource.h
135-
colorer/zip/MemoryFile.cpp
136-
colorer/zip/MemoryFile.h
137-
)
138-
endif ()
108+
set(SRC_COLORER_ZIP
109+
colorer/xml/libxml2/SharedXmlInputSource.cpp
110+
colorer/xml/libxml2/SharedXmlInputSource.h
111+
colorer/zip/MemoryFile.cpp
112+
colorer/zip/MemoryFile.h
113+
)
139114
endif()
140115

141116
if(COLORER_USE_ICU_STRINGS)
@@ -256,15 +231,9 @@ set_target_properties(colorer_lib PROPERTIES
256231
CXX_EXTENSIONS NO
257232
)
258233

259-
if(COLORER_USE_LIBXML)
260-
target_link_libraries(colorer_lib
261-
PUBLIC LibXml2::LibXml2
262-
)
263-
else()
264-
target_link_libraries(colorer_lib
265-
PUBLIC XercesC::XercesC
266-
)
267-
endif()
234+
target_link_libraries(colorer_lib
235+
PUBLIC LibXml2::LibXml2
236+
)
268237

269238
if(COLORER_USE_ICU_STRINGS)
270239
target_link_libraries(colorer_lib

src/colorer/common/Features.h.in

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#cmakedefine COLORER_USE_DEEPTRACE
55

6-
#cmakedefine COLORER_FEATURE_LIBXML
76
/**
87
If defined, JAR InputSource is implemented.
98
*/

0 commit comments

Comments
 (0)