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

Add TargetNetStandard switch #11

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions Remora.Sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,16 @@ The following properties are defined by the SDK.
### Framework Targets
The following properties are defined by the SDK.

| Property | Value | Overridable |
|-----------------------|------------------------------|-------------|
| LibraryFrameworks* | netstandard2.1;net6.0;net7.0 | Yes |
| ExecutableFrameworks* | net7.0 | Yes |
| TargetFramework | | Yes |
| TargetFrameworks | (varies) | Yes |
| Property | Value | Overridable |
|-----------------------|---------------|-------------|
| LibraryFrameworks* | net6.0;net7.0 | Yes |
| ExecutableFrameworks* | net7.0 | Yes |
| TargetFramework | | Yes |
| TargetFrameworks | (varies) | Yes |
| TargetNetStandard | true | Yes |
Copy link
Member

Choose a reason for hiding this comment

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

You're missing an asterisk here to mark the property as a Remora extension.


If `TargetNetStandard` is `true`, `netstandard2.1` will be included as a target when building libraries.
Set the property to `false` if this is undesirable.

Notably, the SDK defines a set of standard targets for libraries and frameworks,
then applies this to the `TargetFrameworks` property based on the project's
Expand Down
3 changes: 2 additions & 1 deletion Remora.Sdk/Sdk/Sdk.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
<!-- Default targeting configuration -->
<PropertyGroup>
<ExecutableFrameworks Condition="'$(ExecutableFrameworks)' == ''">net8.0</ExecutableFrameworks>
<LibraryFrameworks Condition="'$(LibraryFrameworks)' == ''">netstandard2.1;net6.0;net7.0;$(ExecutableFrameworks)</LibraryFrameworks>
<LibraryFrameworks Condition="'$(LibraryFrameworks)' == ''">net6.0;net7.0;$(ExecutableFrameworks)</LibraryFrameworks>
<TargetNetStandard Condition="'$(TargetNetStandard)' == ''">true</TargetNetStandard>
</PropertyGroup>

<!-- Default common properties -->
Expand Down
3 changes: 3 additions & 0 deletions Remora.Sdk/Sdk/Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
<!--suppress MsbuildTargetFrameworkTagInspection -->
<TargetFrameworks>$(LibraryFrameworks)</TargetFrameworks>

<!--suppress MsbuildTargetFrameworkTagInspection -->
<TargetFrameworks Condition="'$(TargetNetStandard)' == true">netstandard2.1;$(LibraryFrameworks)</TargetFrameworks>

<!--suppress MsbuildTargetFrameworkTagInspection -->
<TargetFrameworks Condition="'$(OutputType)' == 'Exe'">$(ExecutableFrameworks)</TargetFrameworks>
</PropertyGroup>
Expand Down