Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow downstream clients to use the dependency scope field #392

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion build.gradle
Expand Up @@ -20,13 +20,14 @@ versionFile << version

repositories {
maven { url "https://sig-repo.synopsys.com/bds-bdio-release" }
mavenLocal()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This PR is dependent/blocked by the release of integrations-bdio 26.0.8. Once that release exists, this PR can be updated to remove this mavenLocal line, and use a non-SNAPSHOT version.
Given the lack of SNAPSHOT availability to the build pipeline, it is likely PR builds will fail for this request until this change is applied.

}

dependencies {
api 'com.synopsys.integration:blackduck-common-api:2022.10.4'
api 'com.synopsys.integration:phone-home-client:5.1.7'

api 'com.synopsys.integration:integration-bdio:26.0.7'
api 'com.synopsys.integration:integration-bdio:26.0.8-SNAPSHOT'
api 'com.blackducksoftware.bdio:bdio2:3.2.5'


Expand Down
Expand Up @@ -179,7 +179,13 @@ private Pair<List<Project>, List<Component>> createAndLinkComponentsFromGraph(
}
} else {
Component component = componentFromDependency(dependency);
linkComponentDependency.dependency(new com.blackducksoftware.bdio2.model.Dependency().dependsOn(component));
com.blackducksoftware.bdio2.model.Dependency dependencyEntry = new com.blackducksoftware.bdio2.model.Dependency().dependsOn(component);

if (dependency.getScope() != null) {
dependencyEntry = dependencyEntry.scope(dependency.getScope());
}

linkComponentDependency.dependency(dependencyEntry);

if (!existingComponents.containsKey(dependency.getExternalId())) {
addedComponents.add(component);
Expand Down
Expand Up @@ -44,7 +44,7 @@ void testCreateAndLinkComponents() {
DependencyGraph dependencyGraph = Mockito.mock(DependencyGraph.class);
Set<Dependency> dependencies = new HashSet<>();
ProjectDependency subProjectDependency = new ProjectDependency(subProjectName, subProjectVersion, subProjectExternalId);
Dependency componentDependency = new Dependency(componentExternalId);
Dependency componentDependency = new Dependency(componentExternalId, null);
dependencies.add(subProjectDependency);
dependencies.add(componentDependency);
Mockito.when(dependencyGraph.getDirectDependencies()).thenReturn(dependencies);
Expand Down