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

Removed projects moved to dotnet/sdk #5079

Merged
merged 4 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
137 changes: 0 additions & 137 deletions Microsoft.TemplateEngine.sln

Large diffs are not rendered by default.

50 changes: 8 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,20 @@

# Overview

This repository is the home for the .NET Core Template Engine. It contains the brains for `dotnet new`.
This repository is the home for the .NET Core Template Engine. It contains the brains for `dotnet new` and template instantiation in Visual Studio.
When `dotnet new` is invoked, it will call the Template Engine to create the artifacts on disk.
Template Engine is a library for manipulating streams, including operations to replace values, include/exclude
regions and process `if`, `else if`, `else` and `end if` style statements.

# Template Content Repositories

[.NET default templates](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-new-sdk-templates) are located in several repositories.
This repository only contains the following templates:
- Console Application (console)
- Class Library (classlib)
- Common item templates (gitignore, globaljson, nugetconfig, sln, etc.)

Other templates are located in the following repositories:
The templates are located in the following repositories:

| Templates | Repository |
|---|---|
|Common project and item templates|[dotnet/sdk](https://github.com/dotnet/sdk)|
|ASP.NET and Blazor templates|[dotnet/aspnetcore](https://github.com/dotnet/aspnetcore)|
|ASP.NET Single Page Application templates| [dotnet/spa-templates](https://github.com/dotnet/spa-templates)|
|WPF templates|[dotnet/wpf](https://github.com/dotnet/wpf)|
Expand All @@ -33,7 +30,9 @@ Issues for the template content should be opened in the corresponding repository
We have created a [dotnet template samples repo](https://github.com/dotnet/dotnet-template-samples), which shows how you can use
the Template Engine to create new templates. The samples are setup to be stand alone for specific examples.

# Info for `dotnet new` users
# `dotnet new`

`dotnet new` CLI is now located in [dotnet/sdk](https://github.com/dotnet/sdk/tree/main/src/Cli/Microsoft.TemplateEngine.Cli) repo.

You can create new projects with `dotnet new`, this section will briefly describe that. For more info take a look at
[Announcing .NET Core Tools Updates in VS 2017 RC](https://blogs.msdn.microsoft.com/dotnet/2017/02/07/announcing-net-core-tools-updates-in-vs-2017-rc/).
Expand Down Expand Up @@ -88,45 +87,12 @@ To search for the templates available on NuGet.org, use [`dotnet new --search`](

# What to expect when working with this repo

The instructions below enable a new command at the `dotnet` CLI, `dotnet new3`, that uses the bits and templates contained in this repo. Think of it as a "preview" version of `dotnet new` for trying out new switches, interactions and display styles before rolling them in to the product.

Commands executed against `dotnet new3` won't impact the behavior of `dotnet new`, Visual Studio for Mac, Visual Studio, nor any other environment.
This repo only contains libraries and packages that are used by `dotnet new` and Visual Studio to instantiate the template. There is no UI for this libraries.
To build, run and debug `dotnet new`, see the [instuctions in dotnet/sdk repo](https://github.com/dotnet/sdk#how-do-i-build-the-sdk).

# How to build, run & debug

Check out our [contributing](docs/Contributing.md) page to learn how you can build, run and debug.

# Installing templates

Templates can be installed from packages in any NuGet feed, directories on the file system or ZIP type archives (zip, nupkg, vsix, etc.)
To install a new template use the command:

dotnet .\dotnet-new3.dll --install {the path to the folder containing the template or *.nupkg file or nuget package name}
dotnet .\dotnet-new3.dll --install "Boxed.Templates::*"
dotnet .\dotnet-new3.dll --install <your repo location>\artifacts\packages\Debug\Shipping\Microsoft.DotNet.Common.ProjectTemplates.3.1.6.0.0-dev.nupkg

# Basic Commands
## Showing help

dotnet .\dotnet-new3.dll --help
dotnet .\dotnet-new3.dll -h
dotnet .\dotnet-new3.dll

## Listing templates

dotnet .\dotnet-new3.dll --list
dotnet .\dotnet-new3.dll -l
dotnet .\dotnet-new3.dll mvc -l Lists all templates containing the text "mvc"

## Template parameter help

dotnet .\dotnet-new3.dll mvc --help
dotnet .\dotnet-new3.dll mvc -h

## Template creation

dotnet .\dotnet-new3.dll MvcWebTemplate --name MyProject --output src --ParameterName1 Value1 --ParameterName2 Value2 ... --ParameterNameN ValueN
dotnet .\dotnet-new3.dll MvcWebTemplate -n MyProject -o src --ParameterName1 Value1 --ParameterName2 Value2 ... --ParameterNameN ValueN

# Trademarks
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft’s Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.
65 changes: 3 additions & 62 deletions docs/Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,71 +28,12 @@ The steps required are outlined below.
- Run the build script appropriate for your environment.
- **Windows:** [build.cmd](https://github.com/dotnet/templating/blob/main/build.cmd)
- **Mac/Linux**: [build.sh](https://github.com/dotnet/templating/blob/main/build.sh)
- The changes you build will not change how `dotnet new` behaves. Instead, they will be available through `dotnet new3`. To run `dotnet new3`, run
```
dotnet <your repo location>\artifacts\bin\dotnet-new3\<configuration>\<target framework>\dotnet-new3.dll
```
Root path to `dotnet-new3.dll` is skipped in all the commands below.

For example, here is the result of running `dotnet .\dotnet-new3.dll --help` (_truncated to save space here_).

```bash
$ dotnet .\dotnet-new3.dll --help
Usage: new3 [options]

Options:
-h, --help Displays help for this command.
-l, --list Lists templates containing the specified template name. If no name is specified, lists all templates.
-n, --name The name for the output being created. If no name is specified, the name of the output directory is used.
...
```
After the first run, there are no templates installed. See [Installing templates](../README.md#Installing-templates) on how to install the templates and [Available templates](../README.md#Available-templates) for the list of available templates.

This repository features "Class Library" and "Console App" templates. After you build and run, the package containing these two templates will be available in the following location:
```
<local_repo_root>\artifacts\packages\Debug\Shipping\Microsoft.DotNet.Common.ProjectTemplates.*.nupkg
```

[Top](#top)

# Debugging
Debugging code requires your current `dotnet new3` session to have its active build session configured to DEBUG, and a debugger from your application of choice to be attached to the currently running `dotnet new3` process. The steps required to accomplish this are outlined below.

When working with the source inside Visual Studio, it is recommended you use the latest available version.

- Open the **Microsoft.TemplatingEngine.sln** solution in the application you will use to attach your debugger. This solution contains the projects needed to run, modify & debug the Template Engine.

- Run the following command:
```bash
dotnet .\dotnet-new3.dll --debug:attach {{additonal args}}
```
By supplying the `--debug:attach` argument, you are triggering a ` Console. ReadLine();` request which pauses the execution of the Template Engine at an early point in its execution.

Once the engine is "paused", you have the opportunity to attach a debugger to the running `dotnet new3` process.

- Switch to your debugger application.

- Open the **Microsoft.TemplateEngine.Cli.New3Command** class and locate the following function.
- `New3Command.Run()`
- Set a breakpoint at any point after the following block of code.

```csharp
if (args.Any(x => string.Equals(x, "--debug:attach", StringComparison.Ordinal)))
{
// This is the line that is executed when --debug:attach is passed as
// an argument.
Console.ReadLine();
}
```
- Attach the debugger to the current running 'dotnet new 3' process.
For example, if you are using **Visual Studio** you can perform the following.
- Execute the keyboard shortcut - `ctrl + alt + p`.
- This will open up a dialog that allows you to search for the **dotnet-new3.exe** process.
- Locate the desired process, select it and hit the **Attach** button.

- Now that you have a debug session attached to your properly configured `dotnet new3` process, head back to the command line and hit `enter`. This will trigger `Console.Readline()` to execute and your proceeding breakpoint to be hit inside the application you are using to debug.

[Top](#top)
This repo doesn't contain an executable application anymore. We recommend to do debugging using tests.
Add your test scenario to the [test project](https://github.com/dotnet/templating/tree/main/test/Microsoft.TemplateEngine.IDE.IntegrationTests) and debug it from IDE.
To build, run and debug `dotnet new`, see the [instuctions in dotnet/sdk repo](https://github.com/dotnet/sdk#how-do-i-build-the-sdk).

# Coding Style #

Expand Down
12 changes: 0 additions & 12 deletions src/Microsoft.TemplateEngine.Cli/Alias/AliasExpansionStatus.cs

This file was deleted.

This file was deleted.

This file was deleted.

39 changes: 0 additions & 39 deletions src/Microsoft.TemplateEngine.Cli/Alias/AliasModel.cs

This file was deleted.

Loading