Skip to content

Commit

Permalink
Removed the ability to configure ref and hard-coded it with 'dependsOn'
Browse files Browse the repository at this point in the history
Signed-off-by: Roland Asmann <roland.asmann@gmail.com>
  • Loading branch information
malice00 committed Jan 17, 2025
1 parent 97da21f commit 2c2c934
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
1 change: 0 additions & 1 deletion docs/ENV.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ The following environment variables are available to configure the bom generatio
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| CDXGEN_DEBUG_MODE | Set to `debug` to enable debug messages |
| GITHUB_TOKEN | Specify GitHub token to prevent traffic shaping while querying license and repo information |
| MULTI_BOM_COMPONENT_REF | When building a multi-language BOM, choose how the references between the components is handled. This can be useful if other tooling used to eg visualize the dependency-tree only uses 'dependsOn' (as the name dependency-tree more or less implies). Possible values: `dependsOn`, `provides`. Default: `dependesOn`. |
| MVN_CMD | Set to override maven command |
| MVN_ARGS | Set to pass additional arguments such as profile or settings to maven |
| MAVEN_HOME | Specify maven home |
Expand Down
12 changes: 3 additions & 9 deletions lib/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6506,12 +6506,6 @@ export async function createMultiXBom(pathList, options) {
delete parentComponent.components;
}
// Add references between the multiple sub-boms
// Default is 'provides', but since some tools only generate a tree for 'dependsOn',
// this can be configured with an EnvVar
const multiBomComponentRef =
"provides" === process.env.MULTI_BOM_COMPONENT_REF
? "provides"
: "dependsOn";
let parentDependencies = dependencies.find(
(d) => d["ref"] === parentComponent["bom-ref"],
);
Expand All @@ -6521,11 +6515,11 @@ export async function createMultiXBom(pathList, options) {
};
dependencies = mergeDependencies(dependencies, parentDependencies);
}
if (!parentDependencies[multiBomComponentRef]) {
parentDependencies[multiBomComponentRef] = [];
if (!parentDependencies["dependsOn"]) {
parentDependencies["dependsOn"] = [];
}
for (const parentSub of parentSubComponents) {
parentDependencies[multiBomComponentRef].push(parentSub["bom-ref"]);
parentDependencies["dependsOn"].push(parentSub["bom-ref"]);
}
}
// some cleanup, but not complete
Expand Down

0 comments on commit 2c2c934

Please sign in to comment.