|
1 | 1 | # Templates
|
2 | 2 |
|
3 |
| -## Getting Started |
4 | 3 | These are project templates which are used in .NET Core for creating ASP.NET Core applications.
|
5 | 4 |
|
6 |
| -## Prerequisites |
| 5 | +## Description |
| 6 | + |
| 7 | +The following contains a description of each sub-directory in the `ProjectTemplates` directory. |
| 8 | + |
| 9 | +- `BlazorTemplates.Tests`: Contains the source files for the Blazor template tests, these are currently split out due to not being Helix ready yet. |
| 10 | +- `Shared`: Contains a collection of shared constants and helper methods/classes including the infrastructure for managing dotnet processes to create, build, run template tests. |
| 11 | +- `Web.Client.ItemTemplates`: Contains the Web Client-Side File templates, includes things like less, scss, and typescript |
| 12 | +- `Web.ItemTemplates`: Contains the Web File templates, includes things like: protobuf, razor component, razor page, view import and start pages |
| 13 | +- `Web.ProjectTemplates`: Contains the ASP.NET Core Web Template pack, including Blazor Server, WASM, Empty, Grpc, Razor Class Library, RazorPages, MVC, WebApi. |
| 14 | +- `Web.Spa.ProjectTemplates`: Contains the Single Page Application templates for ASP.NET Core, including Anuglar, React, ReactRedux. |
| 15 | +- `migrations`: Contains migration related scripts. |
| 16 | +- `scripts`: Contains a collection of scripts that help running tests locally that avoid having to install the templates to the machine. |
| 17 | +- `test`: Contains the end to end template tests. |
| 18 | +- `testassets`: Contains assets used by the tests, like a dotnet tools installer |
| 19 | + |
| 20 | +### Build |
| 21 | + |
7 | 22 | Some projects in this repository (like SignalR Java Client) require JDK installation and configuration of `JAVA_HOME` environment variable.
|
8 | 23 | 1. If you don't have the JDK installed, you can find it from https://www.oracle.com/technetwork/java/javase/downloads/index.html
|
9 | 24 | 1. After installation define a new environment variable named `JAVA_HOME` pointing to the root of the latest JDK installation (for Windows it will be something like `c:\Program Files\Java\jdk-12`).
|
10 | 25 | 1. Add the `%JAVA_HOME%\bin` directory to the `PATH` environment variable
|
11 | 26 |
|
12 |
| -## Building Templates |
13 |
| -1. Run `. .\activate.ps1` if you haven't already. |
| 27 | +To build the ProjectTemplates: |
14 | 28 |
|
15 |
| -1. Run `git submodule update --init --recursive` if you haven't already. |
16 |
| -1. Run `git submodule update` to update submodules. |
17 | 29 | 1. Run `build.cmd -all -pack -configuration Release` in the repository root to build all of the dependencies.
|
18 |
| -1. Run `build.cmd -pack -NoRestore -NoBuilddeps -configuration Release` in this directory will produce NuGet packages for each class of template in the artifacts directory. |
| 30 | +1. Run `build.cmd -pack -NoRestore -NoBuilddeps -configuration Release` in src/ProjectTemplates directory to produce NuGet packages for each class of template in the artifacts directory. |
| 31 | + |
| 32 | +### Test |
| 33 | + |
| 34 | +To run the ProjectTemplate tests: |
| 35 | + |
19 | 36 | 1. Because the templates build against the version of `Microsoft.AspNetCore.App` that was built during the previous step, it is NOT advised that you install templates created on your local machine via `dotnet new -i [nupkgPath]`. Instead, use the `Run-[Template]-Locally.ps1` scripts in the script folder. These scripts do `dotnet new -i` with your packages, but also apply a series of fixes and tweaks to the created template which keep the fact that you don't have a production `Microsoft.AspNetCore.App` from interfering.
|
20 | 37 | 1. The ASP.NET localhost development certificate must also be installed and trusted or else you'll get a test error "Certificate error: Navigation blocked".
|
21 | 38 | 1. Run `.\build.cmd -test -NoRestore -NoBuild -NoBuilddeps -configuration Release "/p:RunTemplateTests=true"` to run template tests.
|
22 | 39 |
|
23 |
| -** Note** Templating tests require Visual Studio unless a full build (CI) is performed. |
| 40 | +** Note** ProjectTemplates tests require Visual Studio unless a full build (CI) is performed. |
| 41 | + |
| 42 | +## More Information |
| 43 | + |
| 44 | +For more information, see the [ASP.NET Core README](../../README.md). |
| 45 | + |
0 commit comments