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

provide way to get task that can be verified at plugin compilation time #23

Open
mathjeff opened this issue May 19, 2023 · 1 comment
Open

Comments

@mathjeff
Copy link
Collaborator

After applying and configuring the spdx-gradle-plugin, we'd like to include the spdx-building tasks in our build graph (making spdxSbomForRelease a dependency of another one of our tasks that we're already invoking).

something like https://android-review.git.corp.google.com/c/platform/frameworks/support/+/2592549/8/buildSrc/private/src/main/kotlin/androidx/build/sbom/Sbom.kt#283 which says

tasks.named("spdxSbomForRelease")

If I make a spelling mistake in this string or if the task name changes in the future, though, this error would only appear when trying to run the corresponding configuration logic rather than when trying to compile this logic into a plugin.

It could be nice to have some way to directly get the task from an SpdxSbomExtension's Target

@loosebazooka
Copy link
Collaborator

there is the aggregate task spdxSbom, but I'm not sure I know of a mechanism to do this, since it's dynamically created, and so are the targets? I guess you could make this a var in the build file?

val SBOM_TARGET = "release" // or const?
sbomExtension.targets.create(SBOM_TARGET)  { target -> ...
  ...
}
project.addToBuildOnServer(tasks.named("spdxSbomFor" + SBOM_TARGET.capitalize(/* or whatever the non deprecated method is */)))
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants