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

Non-csproj based examples #8

Open
tig opened this issue Apr 28, 2022 · 0 comments
Open

Non-csproj based examples #8

tig opened this issue Apr 28, 2022 · 0 comments

Comments

@tig
Copy link

tig commented Apr 28, 2022

My project (https://github.com/migueldeicaza/gui.cs) has an example app called UI Catalog. The main UI Catalog app uses reflection to enumerate and display all of the examples; they all derive from the class Scenario:

image

image

The Scenarios are all in the ./Scenarios dir; each as an individual .cs file. The filename (e.g. Generic.cs DOES NOT need to match the name of the Scenario (the real name is metadata on the Sceanario class).

UI Catalog accepts the name of a Scenario on the command line; if provided it will directly launch that Scenario.

I'd like to enable dotnet example <Scenario>.

I do not want to force each Scenario to have a .csproj file or to be in a distinct dir.

I do not want to have to modify the existing Scenarios.

I do not want to have Scenario writers have to modify anything but their .cs file (e.g. adding each Scenario to .examples is no bueno).

I'm happy to contribute to this project to enhance it to support what I'm trying to do.

What would be your suggestion on the best way to do this?

My initial thought was to enhance .examples such that this will work:

# Sample .examples file for UICatalog Scenarios
./UICatalog --list

dotnet example --list would then build UICatalog/UICatalog.csproj and run it with --list. It would capture stdout to capture the resulting list of examples ("Name", "Description" pairs).

dotnet example <Scenario> would build UICatalog/UICatalog.csproj and run it with <Scenario>.

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

No branches or pull requests

1 participant