Skip to content

Add ability to specify output path when using as library. #778

@kurasaiteja

Description

@kurasaiteja

When using cargo-cyclonedx as a library dependency, we're finding that we can't control the location where SBOM files are written. Currently, write_to_files() always writes relative to the manifest path.

Our use case is integrating cargo-cyclonedx where we need to:

  • Write SBOMs to specific directories. (like build/sbom/)
  • Control output locations programmatically

It would be helpful if there was a way to specify the output directory, either through:

  • Additional configuration in SbomConfig
  • Exposing the write_to_file method as a public API could provide the flexibility we need. It would allow us to specify exact file paths for SBOM output, giving us full control over where files are written.

Note: This is related to #775 but focuses on library usage rather than CLI functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions