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

NiceIO as a source-only package :D #21

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

scottbilas
Copy link
Contributor

NiceIO as a source-only package gives two great tastes that taste great together:

  1. It's a package! Add to any project with nuget commands/ui, do easy version upgrades.
  2. It's still source! There's no DLL, it's directly compiled into whatever project references it.

A user would do this:

  • dotnet add package NiceIO or do the search+add thing in the UI.
  • Decide whether or not to republish by setting NICEIO_PUBLIC (same behavior as now).
  • Set the namespace to put NPath in by adding to the .csproj in an ItemGroup:
    <PreprocessorValue Include="NICEIO_NAMESPACE" Value="YourNamespaceHere" Visible="false" />
  • Make a new partial class NPath file and add statics or whatever, if they want.

Some implementation notes:

  • I don't love the required PreprocessorValue thing. There's probably some nuget package magic that can add a PreprocessorValue automatically..I have seen nuget packages modify the csproj they become a part of, but didn't look into it.
  • Another option for the .cs.pp is $rootnamespace$, which requires no configuration, but is more limited in that it depends on the csproj root namespace setting. Nuget's substitution stuff is really limited. Tradeoffs..
  • README should probably say something about the package and give the "use" instructions above. I can do an update there too in this PR if you want.
  • I have very little experience with nuget packages so the .nuspec is probably needing some attention.

What do you think?

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.

1 participant