open-feature / dotnet-sdk

.NET implementation of the OpenFeature SDK
https://openfeature.dev
Apache License 2.0
62 stars 17 forks source link

chore: Fix props to support more than one project #177

Closed austindrenski closed 8 months ago

austindrenski commented 8 months ago

Ran across this while working on open-feature/dotnet-sdk#264, and tldr; if there's more than one project under src/, having the <PackageId> hard-coded in build/Common.prod.props causes MSBuild to panic.

There are two options to fix this:

  1. - <PackageId>OpenFeature</PackageId>
    + <PackageId>$(MSBuildProjectName)</PackageId>
  2. - <PackageId>OpenFeature</PackageId>

Since NuGet defaults PackageId to the assembly name, I'm opting for (2), but if I've overlooked some nuance/custom build steps that require setting PackageId explicitly, then we could just as well fallback to (1).

Example

$ dotnet restore
  Determining projects to restore...
dotnet/sdk/7.0.404/NuGet.targets(158,5): error : Ambiguous project name 'OpenFeature'. [~/rider/open-feature/dotnet-sdk/OpenFeature.sln]

Related

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (f2b9b03) 0.00% compared to head (71230e8) 93.86%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main open-feature/dotnet-sdk-contrib#177 +/- ## ========================================= + Coverage 0 93.86% +93.86% ========================================= Files 0 23 +23 Lines 0 946 +946 Branches 0 105 +105 ========================================= + Hits 0 888 +888 - Misses 0 34 +34 - Partials 0 24 +24 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

toddbaert commented 8 months ago

Built this locally and everything looks sane to me!