-
-
Notifications
You must be signed in to change notification settings - Fork 182
Auto-detect gradle composite builds #1658
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
Conversation
Signed-off-by: Prabhu Subramanian <[email protected]>
Not right this minute, I have no access to a computer right now. But I can look it over in a couple of hours when I get back home. |
Signed-off-by: Prabhu Subramanian <[email protected]>
Signed-off-by: Prabhu Subramanian <[email protected]>
Merged so that this can be tested with a container image. |
lgtm |
Thank you so much for checking! Is there a sample repo that we can use for repotests to demonstrate this? |
I'd say elasticsearch, which is already in repotests -- we could probably add a run without the EnvVar for included build, or remove it altogether? |
Will test with elasticsearch tomorrow to see if the auto-detection is working correctly. |
With your changes I get the same results both with auto-detection and when explicitly setting GRADLE_INCLUDED_BUILDS! |
oh wow, thank you for checking! Next experiment, does the order of the included builds affect the precision of the generated sbom. |
* Auto-detect gradle composite builds Signed-off-by: Prabhu Subramanian <[email protected]> --------- Signed-off-by: Prabhu Subramanian <[email protected]> Signed-off-by: emcfins <[email protected]>
@prabhu I believe the current approach might be a bit too eager. I have a bunch of commented-out lines in a settings.gradle file to toggle composite builds: pluginManagement {
repositories {
// ...
}
resolutionStrategy {
// ...
}
// toggle for a composite build with required plugins
// includeBuild '../my-plugin1'
// includeBuild '../my-plugin2'
}
// toggle for a composite build with required libraries
// includeBuild '../my-library1'
// includeBuild '../my-library2' This results in the following output when running cdxgen on Jenkins (-> the required repositories are not checked out as siblings of the current project):
|
@nightm4re94 Good find! Could you contribute a PR?
Something that checks for comment prefix must work. Maybe we must check for
Tests could be added here. https://github.com/CycloneDX/cdxgen/blob/master/lib/helpers/package_specific/gradleutils.test.js |
I've opened PR #1731 to address this. Thanks for pointing me in the right direction! |
Composite builds are now auto-detected.
@malice00 Can you help test this PR?