Skip to content

Commit

Permalink
Add build of a JSON manifest file to the build process
Browse files Browse the repository at this point in the history
  • Loading branch information
matejak committed Jun 28, 2023
1 parent 4b752a2 commit a5ef8e5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cmake/SSGCommon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,21 @@ macro(ssg_build_cpe_oval_unlinked PRODUCT)
)
endmacro()

macro(ssg_build_manifest PRODUCT)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/manifest.json"
COMMAND env "PYTHONPATH=$ENV{PYTHONPATH}" "${PYTHON_EXECUTABLE}" "${SSG_BUILD_SCRIPTS}/generate_manifest.py" --output "${CMAKE_CURRENT_BINARY_DIR}/manifest.json" --build-root "${CMAKE_CURRENT_BINARY_DIR}"
# The manifest requires compiled artifacts and OVAL, and the latter is the blocker.
# Individual OVAL files are produced during the build of "unlinked OVAL".
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/oval-unlinked.xml"
COMMENT "[${PRODUCT}-content] generating JSON manifest"
)
add_custom_target(
generate-ssg-${PRODUCT}-manifest.json
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/manifest.json"
)
endmacro()

# Builds SCE content into the build system. This occurs prior to XCCDF
# generation so that the XCCDF builder can correctly place SCE content
# (without needing a separate XML or XSLT linking step) and also place
Expand Down Expand Up @@ -736,6 +751,7 @@ macro(ssg_build_product PRODUCT)
endif()
ssg_build_oval_unlinked(${PRODUCT})
ssg_build_cpe_oval_unlinked(${PRODUCT})
ssg_build_manifest(${PRODUCT})
ssg_build_cpe_dictionary(${PRODUCT})
ssg_build_xccdf_final(${PRODUCT})
ssg_build_oval_final(${PRODUCT})
Expand All @@ -750,6 +766,7 @@ macro(ssg_build_product PRODUCT)
generate-ssg-${PRODUCT}-xccdf.xml
generate-ssg-${PRODUCT}-oval.xml
generate-ssg-${PRODUCT}-ocil.xml
generate-ssg-${PRODUCT}-manifest.json
generate-ssg-${PRODUCT}-cpe-dictionary.xml
generate-ssg-${PRODUCT}-ds.xml
generate-ssg-tables-${PRODUCT}-all
Expand Down

0 comments on commit a5ef8e5

Please sign in to comment.