Skip to content

Commit 9128741

Browse files
rng file is built.
Closes #155.
1 parent beccd6f commit 9128741

File tree

3 files changed

+15
-423
lines changed

3 files changed

+15
-423
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- { name: "MSVC 14.3 - C++20", os: windows-2022, cxxstd: '20', cmake_args: -G "Visual Studio 17 2022" -A x64, github_release: true }
2727
- { name: "GCC 12 - C++20", os: ubuntu-22.04, cc: gcc-12, cxx: g++-12, cxxstd: '20', install: g++-12, github_release: true }
2828
- { name: "GCC 11 - C++20", os: ubuntu-22.04, cc: gcc-11, cxx: g++-11, cxxstd: 20, install: g++-11 }
29-
- { name: "Clang 15 - C++20", os: ubuntu-22.04, cc: clang-15, cxx: clang++-15, cxxstd: 20, install: "clang-15 libxml2-utils" }
29+
- { name: "Clang 15 - C++20", os: ubuntu-22.04, cc: clang-15, cxx: clang++-15, cxxstd: 20, install: "clang-15 libxml2-utils default-jre" }
3030

3131
# no <source_location>
3232
# - { name: "GCC 10 - C++20", os: ubuntu-22.04, cc: gcc-10, cxx: g++-10, cxxstd: 20, install: g++-10 }

CMakeLists.txt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,22 @@ if (BUILD_TESTING)
314314

315315
find_package(LibXml2)
316316
if (LibXml2_FOUND)
317-
file(GLOB_RECURSE XML_SOURCES CONFIGURE_DEPENDS test-files/*.xml)
317+
find_package(Java REQUIRED Runtime)
318+
# FindJava
319+
if (NOT Java_FOUND)
320+
message(FATAL_ERROR "Java is needed to run xml-lint")
321+
endif()
322+
323+
add_custom_target(mrdox.rng ALL DEPENDS mrdox.rnc
324+
COMMAND ${Java_JAVA_EXECUTABLE} -jar ${CMAKE_CURRENT_SOURCE_DIR}/tools/trang.jar
325+
${CMAKE_CURRENT_SOURCE_DIR}/mrdox.rnc ${CMAKE_CURRENT_BINARY_DIR}/mrdox.rng)
318326

327+
328+
file(GLOB_RECURSE XML_SOURCES CONFIGURE_DEPENDS test-files/*.xml)
319329
add_test(NAME xml-lint
320-
COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --dropdtd --noout
321-
--relaxng ${CMAKE_CURRENT_SOURCE_DIR}/mrdox.rng ${XML_SOURCES}
322-
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
330+
COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --dropdtd --noout
331+
--relaxng ${CMAKE_CURRENT_BINARY_DIR}/mrdox.rng ${XML_SOURCES}
332+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
323333
endif()
324334
endif()
325335

0 commit comments

Comments
 (0)