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

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

Conversation

austindrenski
Copy link
Member

@austindrenski austindrenski commented Jan 16, 2024

Ran across this while working on #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

@austindrenski austindrenski requested a review from a team as a code owner January 16, 2024 18:56
Copy link

codecov bot commented Jan 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@toddbaert
Copy link
Member

Built this locally and everything looks sane to me!

@beeme1mr beeme1mr requested a review from a team January 16, 2024 20:25
@austindrenski austindrenski force-pushed the update-packaging-config-to-support-multiple-projects branch from 90407e8 to 37f7d10 Compare January 16, 2024 21:14
@austindrenski austindrenski self-assigned this Jan 18, 2024
@austindrenski austindrenski force-pushed the update-packaging-config-to-support-multiple-projects branch from 37f7d10 to cbd22d9 Compare January 19, 2024 19:11
Ran across this while working on open-feature/dotnet-sdk-contrib#127,
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. ```diff
   - <PackageId>OpenFeature</PackageId>
   + <PackageId>$(MSBuildProjectName)</PackageId>
   ```
2. ```diff
   - <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).

Signed-off-by: Austin Drenski <[email protected]>
@toddbaert toddbaert force-pushed the update-packaging-config-to-support-multiple-projects branch from cbd22d9 to 71230e8 Compare January 19, 2024 22:03
@toddbaert toddbaert merged commit f47cf07 into open-feature:main Jan 19, 2024
10 checks passed
@austindrenski austindrenski deleted the update-packaging-config-to-support-multiple-projects branch January 19, 2024 22:46
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

Successfully merging this pull request may close these issues.

3 participants