8000 Update test scripts by david-acm · Pull Request #42 · ardalis/modulith · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update test scripts #42

8000
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

Merged
merged 2 commits into from
Sep 12, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,17 @@ The templates in this project follow the solution structure as taught by [Ardali

# 🛃 Custom templates

No template fits all needs. If you want to customize the template you can change it in the `working/content` directory and running:
No template fits all needs. If you want to customize the template you can [clone this repository as a template](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template).

Once you have cloned the repo locally you can make your custom changes in the `working/content` directory. This directory contains the project templates used for every instatiation. Then you can install the template locally running:

*⚠️ Make sure to uninstall the original template*
```pwsh
dotnet new install .
```

You can find more information about building ```dotnet new``` templates, including how to add commands and parameters, at Microsoft docs page: [Custom templates for dotnet new](https://learn.microsoft.com/en-us/dotnet/core/tools/custom-templates)

# 🗑️ Uninstall Modulith

```pwsh
Expand Down
26 changes: 15 additions & 11 deletions Test-UiWithDotnetCli.ps1
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
cd /Users/davidchaparro/RiderProjects/modulith/test/
rm -rf /Users/davidchaparro/RiderProjects/modulith/test/**
dotnet new uninstall /Users/davidchaparro/RiderProjects/modulith/working/content/modulith
dotnet new install /Users/davidchaparro/RiderProjects/modulith/working/content/modulith
# dotnet new uninstall ardalis.modulith
# dotnet new install ardalis.modulith
# Clear the test directory before each run
#rm -rf test/**

# Reinstall latest version
dotnet new uninstall .
dotnet new install .


# Add an UI enabled solution with a first module
cd test/
dotnet new modulith -n eShop --with-module Payments --WithUi

# Add second and third module. Third module is DDD
cd eShop
dotnet new modulith --add basic-module --with-name Shipments --to eShop --WithUi
dotnet new modulith --add ddd-module --with-name Billing --to eShop

dotnet build

# Add project references. Needed before .Net 9
dotnet add eShop.Web/eShop.Web.csproj reference Shipments/eShop.Shipments/eShop.Shipments.csproj
dotnet add eShop.Web/eShop.Web.csproj reference Billing/eShop.Billing/eShop.Billing.csproj

dotnet build

dotnet run --project ./eShop.Web/eShop.Web.csproj
# Build and run
cd ../..
dotnet build test/eShop
dotnet run --project test/eShop/eShop.Web/eShop.Web.csproj
23 changes: 14 additions & 9 deletions Test-WithDotnetCli.ps1
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
cd /Users/davidchaparro/RiderProjects/modulith/test/
rm -rf /Users/davidchaparro/RiderProjects/modulith/test/**
dotnet new uninstall /Users/davidchaparro/RiderProjects/modulith/working/content/modulith
dotnet new install /Users/davidchaparro/RiderProjects/modulith/working/content/modulith
# Clear the test directory before each run
rm -rf test/**

# Reinstall latest version
dotnet new uninstall .
dotnet new install .

# Add solution with a first module
cd test/
dotnet new modulith -n eShop --with-module Payments

# Add second and third module. Third module is DDD
cd eShop
dotnet new modulith --add basic-module --with-name Shipments --to eShop
dotnet new modulith --add ddd-module --with-name Billing --to eShop

dotnet build

# Add project references. Needed before .Net 9
dotnet add eShop.Web/eShop.Web.csproj reference Shipments/eShop.Shipments/eShop.Shipments.csproj
dotnet add eShop.Web/eShop.Web.csproj reference Billing/eShop.Billing/eShop.Billing.csproj

dotnet build

dotnet run --project ./eShop.Web/eShop.Web.csproj
# Build and run
cd ../..
dotnet build test/eShop
dotnet run --project test/eShop/eShop.Web/eShop.Web.csproj
Loading
0