You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 20, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: Documentation/project-docs/developer-guide.md
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ Developer Guide
3
3
4
4
## Prerequisites
5
5
6
-
In order to build .NET Command Line Interface, you need the following installed on you machine.
6
+
In order to build .NET Command-line Interface (CLI), you need the following installed on you machine:
7
7
8
8
### For Windows
9
9
@@ -27,7 +27,9 @@ In order to build .NET Command Line Interface, you need the following installed
27
27
## Building/Running
28
28
29
29
1. Run `build.cmd` or `build.sh` from the root depending on your OS. If you don't want to execute tests, run `build.cmd /t:Compile` or `./build.sh /t:Compile`.
30
-
2. The CLI that is built (we call it stage 2) will be laid out in the `bin\2\{RID}\dotnet` folder. You can run `dotnet.exe` or `dotnet` from that folder to try out the `dotnet` command.
30
+
2. The CLI that is built (we call it stage 2) is laid out in the `bin\2\{RID}\dotnet` folder. You can run `dotnet.exe` or `dotnet` from that folder to try out the `dotnet` command.
31
+
32
+
> If you need to update localizable strings in resource (*.resx*) files, run `build.cmd /p:UpdateXlfOnBuild=true` or `./build.sh /p:UpdateXlfOnBuild=true` to update the XLIFF (*.xlf*) files as well.
31
33
32
34
## A simple test
33
35
Using the `dotnet` built in the previous step:
@@ -56,12 +58,15 @@ The dotnet CLI supports several models for adding new commands:
56
58
4. Via the user's `PATH`
57
59
58
60
### Commands in dotnet.dll
61
+
59
62
Developers are generally encouraged to avoid adding commands to `dotnet.dll` or the CLI installer directly. This is appropriate for very general commands such as restore, build, publish, test, and clean, but is generally too broad of a distribution mechanism for new commands. Please create an issue and engage the team if you feel there is a missing core command that you would like to add.
60
63
61
64
### Tools NuGet packages
65
+
62
66
Many existing extensions, including those for ASP.NET Web applications, extend the CLI using Tools NuGet packages. For an example of a working packaged command look at `TestAssets/TestPackages/dotnet-hello/v1/`.
63
67
64
68
### MSBuild tasks & targets
69
+
65
70
NuGet allows adding tasks and targets to a project through a NuGet package. This mechanism, in fact, is how all .NET Core projects pull in the .NET SDK. Extending the CLI through this model has several advantages:
66
71
67
72
1. Targets have access to the MSBuild Project Context, allowing them to reason about the files and properties being used to build a particular project.
@@ -71,7 +76,9 @@ Commands added as targets can be invoked once the target project adds a referenc
71
76
Targets are invoked by calling `dotnet msbuild /t:{TargetName}`
72
77
73
78
### Commands on the PATH
79
+
74
80
The dotnet CLI considers any executable on the path named `dotnet-{commandName}` to be a command it can call out to.
75
81
76
82
## Things to Know
83
+
77
84
- Any added commands are usually invoked through `dotnet {command}`. As a result of this, stdout and stderr are redirected through the driver (`dotnet`) and buffered by line. As a result of this, child commands should use Console.WriteLine in any cases where they expect output to be written immediately. Any uses of Console.Write should be followed by Console.WriteLine to ensure the output is written.
0 commit comments