@@ -110,6 +110,14 @@ The created project contains 2 entry points:
110110| CSharpInteractive.Templates | [ ![ NuGet] ( https://img.shields.io/nuget/v/CSharpInteractive.Templates )] ( https://www.nuget.org/packages/CSharpInteractive.Templates ) | .NET build project template | dotnet new install CSharpInteractive.Templates |
111111| CSharpInteractive | [ ![ NuGet] ( https://img.shields.io/nuget/v/CSharpInteractive )] ( https://www.nuget.org/packages/CSharpInteractive ) | A library for use in .NET build projects | dotnet add package CSharpInteractive |
112112
113+ ## Usage examples
114+
115+ - [ Build project example] ( https://github.com/DevTeam/csharp-interactive/tree/master/Samples/MySampleLib )
116+ - [ CSharp Interactive build project] ( https://github.com/DevTeam/csharp-interactive/tree/master/Build )
117+ - [ Pure.DI build project] ( https://github.com/DevTeam/Pure.DI/tree/master/build )
118+ - [ Immutype build project] ( https://github.com/DevTeam/Immutype/tree/master/Build )
119+ - [ Comparison with Cake and Nuke] ( https://github.com/DevTeam/ci-cd )
120+
113121## API
114122
115123- Output, logging and tracing
@@ -293,10 +301,10 @@ Besides that, it is possible to get an instance of [System.IServiceProvider](htt
293301``` CSharp
294302public void Run ()
295303{
296- var serviceProvider =
304+ var serviceProvider =
297305 GetService <IServiceCollection >()
298- .AddTransient <MyTask >()
299- .BuildServiceProvider ();
306+ .AddTransient <MyTask >()
307+ .BuildServiceProvider ();
300308
301309 var myTask = serviceProvider .GetRequiredService <MyTask >();
302310 var exitCode = myTask .Run ();
@@ -562,7 +570,7 @@ var result = dockerRun
562570result .Errors .Any (message => message .State == BuildMessageState .StdError ).ShouldBeFalse ();
563571result .ExitCode .ShouldBe (0 );
564572
565- string ToAbsoluteLinuxPath (string path ) =>
573+ string ToAbsoluteLinuxPath (string path ) =>
566574 " /" + path .Replace (" :" , " " ).Replace ('\\ ' , '/' );
567575```
568576
@@ -725,10 +733,10 @@ result.ExitCode.ShouldBe(0);
725733
726734// Creates a NuGet package of version 1.2.3 for the project, running a command like: "dotnet pack /p:version=1.2.3" from the directory "MyLib"
727735result = new DotNetPack ()
728- .WithWorkingDirectory (" MyLib" )
729- .AddProps ((" version" , " 1.2.3" ))
730- .Build ()
731- .EnsureSuccess ();
736+ .WithWorkingDirectory (" MyLib" )
737+ .AddProps ((" version" , " 1.2.3" ))
738+ .Build ()
739+ .EnsureSuccess ();
732740
733741result .ExitCode .ShouldBe (0 );
734742```
@@ -886,7 +894,7 @@ var testUnderDotCover = test.Customize(cmd =>
886894 + $" --dcOutput={dotCoverSnapshot }"
887895 + " --dcFilters=+:module=TeamCity.CSharpInteractive.HostApi;+:module=dotnet-csi"
888896 + " --dcAttributeFilters=System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage" );
889-
897+
890898// Runs tests under dotCover via a command like: "dotnet dotcover test ..."
891899var result = testUnderDotCover
892900 .Build ()
@@ -916,7 +924,7 @@ using HostApi;
916924
917925var projectDir = Path .Combine (Path .GetTempPath (), Guid .NewGuid ().ToString ()[.. 4 ]);
918926Directory .CreateDirectory (projectDir );
919-
927+
920928// Creates a local tool manifest
921929new DotNetNew (" tool-manifest" )
922930 .WithWorkingDirectory (projectDir )
0 commit comments