Giter VIP home page Giter VIP logo

dotnet-example's Introduction

๐Ÿ‘‹ I'm Patrik.

Website: https://patriksvensson.se
Twitter: @firstdrafthell
Mastodon: @[email protected]


I work on projects for the .NET and Rust ecosystem like Cake, Spectre.Console, Errata, Cupboard, Ghostly, Duck, Spectre.IO, Jarvis, and Snitch, amongst other things.


Sometimes, I also blog.


If you like what I do, you can always โ™ฅ sponsor me.

dotnet-example's People

Contributors

alexrp avatar angelmunoz avatar atifaziz avatar patriksvensson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dotnet-example's Issues

`-c` option for specifying Debug or Release configuration

Right now, running dotnet example in CI will always use the default build configuration (i.e. Debug). This is not great if you have CI jobs for both Debug and Release, since running examples in the Release job will cause the entire project to be rebuilt for Debug (after just building it for Release), and then run it in an unexpected configuration.

A -c option for specifying configuration could probably be the solution.

Non-csproj based examples

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?

Example list is sorted differently on Windows and Linux

Repro:

$ git clone [email protected]:alexrp/system-terminal.git
$ cd system-terminal
$ dotnet example

Windows output:

$ dotnet example

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Example      โ”‚ Description โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ attributes   โ”‚             โ”‚
โ”‚ cancellation โ”‚             โ”‚
โ”‚ cursor       โ”‚             โ”‚
โ”‚ extensions   โ”‚             โ”‚
โ”‚ hosting      โ”‚             โ”‚
โ”‚ processes    โ”‚             โ”‚
โ”‚ raw          โ”‚             โ”‚
โ”‚ resize       โ”‚             โ”‚
โ”‚ screens      โ”‚             โ”‚
โ”‚ scrolling    โ”‚             โ”‚
โ”‚ signals      โ”‚             โ”‚
โ”‚ width        โ”‚             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Type dotnet example --help for help

Linux output:

$ dotnet example

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ Example      โ”‚ Description โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ processes    โ”‚             โ”‚
โ”‚ cursor       โ”‚             โ”‚
โ”‚ extensions   โ”‚             โ”‚
โ”‚ screens      โ”‚             โ”‚
โ”‚ scrolling    โ”‚             โ”‚
โ”‚ width        โ”‚             โ”‚
โ”‚ attributes   โ”‚             โ”‚
โ”‚ resize       โ”‚             โ”‚
โ”‚ hosting      โ”‚             โ”‚
โ”‚ cancellation โ”‚             โ”‚
โ”‚ signals      โ”‚             โ”‚
โ”‚ raw          โ”‚             โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Type dotnet example --help for help

support for individual .fsx files for F# inside sample folders

for F# examples might be useful to have invidividual .fsx scripts as they are more compact than full fsproj, would it be possible to support it? for example

#r "nuget: FSharp.Data"
open FSharp.Data

type SomeJson = JsonProvider<"""{ "Hello" : "json"}""">
let myJsonSample = SomeJson.LoadSample()

`--no-build` option for skipping builds

In my projects, samples are built as part of the overall solution, so a lot of time is wasted running no-op dotnet build commands for each example in CI. It would be nice to have a --no-build option for scenarios like this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.