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

Pack console apps using publish output by default #324

Merged
merged 1 commit into from
Feb 25, 2023
Merged

Conversation

kzu
Copy link
Member

@kzu kzu commented Feb 25, 2023

We have an SDK-compatible mechanism for packing .NET tools: PackAsTool. This satisfies a very specific scenario for .NET tools, but doesn't work for regular CLI tools that don't need packing as standalone dotnet tools.

For these CLI tools, packing the output of Publish makes much more sense, and results in way fewer customizations in package references.

We introduce a new property, PackAsPublish, which is initialized to true whenever the project is publishable and a cross-platform executable (pending widening the definition upon feedback). In this case, we don't infer content from package dependencies and references with copy local and so on, but rather rely exclusively on Publish doing its work. We don't change the PackFolder treatment, so that property is orthogonal to PackAsPublish, although it's likely tools will be the most commonly used folder.

The property's default true value is calculated dynamically in an initial target since we need to inspect ProjectCapability which is set by the SDK to include CrossPlatformExecutable. This is the more extensible approach, rather than checking the output type ourselves.

@kzu kzu added the enhancement New feature or request label Feb 25, 2023
@kzu kzu enabled auto-merge (rebase) February 25, 2023 05:14
We have an SDK-compatible mechanism for packing .NET tools: PackAsTool. This satisfies a very specific scenario for .NET tools, but doesn't work for regular CLI tools that don't need packing as standalone dotnet tools.

For these CLI tools, packing the output of Publish makes much more sense, and results in way fewer customizations in package references.

We introduce a new property, PackAsPublish, which is initialized to `true` whenever the project is publishable and a cross-platform executable (pending widening the definition upon feedback). In this case, we don't infer content from package dependencies and references with copy local and so on, but rather rely exclusively on Publish doing its work. We don't change the PackFolder treatment, so that property is orthogonal to PackAsPublish, although it's likely `tools` will be the most commonly used folder.

The property's default `true` value is calculated dynamically in an initial target since we need to inspect `ProjectCapability` which is set by the SDK to include `CrossPlatformExecutable`. This is the more extensible approach, rather than checking the output type ourselves.
@kzu kzu force-pushed the dev/PackAsPublish branch from f0ca28b to a6161dd Compare February 25, 2023 05:30
@kzu kzu merged commit 38c07d6 into main Feb 25, 2023
@kzu kzu deleted the dev/PackAsPublish branch February 25, 2023 05:40
@devlooped devlooped locked and limited conversation to collaborators Nov 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant