Add binary
type for binary targets to add-target
command.
#8290
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updates the
add-target
subcommand to allow creating a target that references a remote or local binary artifact.Motivation:
The
add-target
command currently accepts a set of arguments that make it seem like it should be able to create a.binaryTarget
in the package's manifest. However, when trying to use the command in this way, you'll either get an error because of validation if trying to create a target for a remote binary artifact, or a regular source target will be created if trying to create a target for a local binary artifact. Issue #8277 has the full details.Modifications:
This PR adds
.binary
as a new value for theTargetType
enum (which is used for parsing the--type
argument of theadd-target
command). This value gets mapped toTargetDescription.TargetKind.binary
when actually creating the target in the manifest.Result:
By specifying
--type binary
for theadd-target
command and providing a value for--url
or--path
, a.binaryTarget
will be added to the package's manifest, with the appropriate configuration depending on if the binary artifact is sourced from a remote URL or a local path.