Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dailydevops/dotnet-engineering
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 84ba88e00013feed82025fbd10a0f5f361c5f486
Choose a base ref
...
head repository: dailydevops/dotnet-engineering
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6c4b9ddb5ea9df3549224fefbed3b2df7060c4c1
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Nov 17, 2024

  1. Copy the full SHA
    6c4b9dd View commit details
Showing with 10 additions and 9 deletions.
  1. +10 −9 scripts/new-project.ps1
19 changes: 10 additions & 9 deletions scripts/new-project.ps1
Original file line number Diff line number Diff line change
@@ -88,11 +88,15 @@ function New-Project {
$projectGroupName = ""
)

dotnet new xunit -n $projectName -o $folder -f $framework --no-restore --force | Out-Null
dotnet new classlib -n $projectName -o $folder -f $framework --no-restore --force | Out-Null
# Add Project reference
dotnet add $folder reference $sourceProject | Out-Null
# Add additional packages
dotnet add $folder package --no-restore coverlet.msbuild | Out-Null
$additionalPackages = @('coverlet.msbuild', 'coverlet.collector', 'Microsoft.NET.Test.Sdk', 'xunit', 'xunit.runner.visualstudio', 'xunit.analyzers', 'NetEvolve.Extensions.XUnit')
foreach ($additionalPackage in $additionalPackages) {
$createPackageParameters = 'add', $folder, 'package', $additionalPackage
& dotnet $createPackageParameters | Out-Null
}

$targetFolder = 'tests'
if ($projectGroupName -ne "") {
@@ -151,25 +155,22 @@ function New-Project {
$additionalCreateParameters += '--support-pages-and-views', '--no-restore'
}
'xUnit' {
$projectSdk = 'xunit'
$DisableTests = $true
$targetFolder = 'tests'
$additionalCreateParameters += '--no-restore'
$additionalPackages += 'coverlet.msbuild', 'Verify.Xunit'
$additionalPackages += 'coverlet.collector', 'coverlet.msbuild', 'Verify.Xunit', 'Microsoft.NET.Test.Sdk', 'xunit', 'xunit.runner.visualstudio', 'xunit.analyzers', 'NetEvolve.Extensions.XUnit'
}
'NUnit' {
$projectSdk = 'nunit'
$DisableTests = $true
$targetFolder = 'tests'
$additionalCreateParameters += '--no-restore'
$additionalPackages += 'coverlet.msbuild', 'Verify.Nunit'
$additionalPackages += 'coverlet.collector', 'coverlet.msbuild', 'Verify.Nunit', 'Microsoft.NET.Test.Sdk', 'NUnit', 'NUnit3TestAdapter', 'NUnit.Analyzers', 'NetEvolve.Extensions.NUnit'
}
'MSTest' {
$projectSdk = 'mstest'
$DisableTests = $true
$targetFolder = 'tests'
$additionalCreateParameters += '--no-restore'
$additionalPackages += 'coverlet.msbuild', 'Verify.MSTest'
$additionalPackages += 'coverlet.collector', 'coverlet.msbuild', 'Verify.MSTest', 'Microsoft.NET.Test.Sdk', 'MSTest', 'NetEvolve.Extensions.MSTest'
}
'Benchmarks' {
$projectSdk = 'console'
@@ -209,7 +210,7 @@ function New-Project {
& dotnet $createParameters $additionalCreateParameters | Out-Null

foreach ($additionalPackage in $additionalPackages) {
$createPackageParameters = 'add', $ProjectFolder, 'package', $additionalPackage, '--no-restore'
$createPackageParameters = 'add', $ProjectFolder, 'package', $additionalPackage
& dotnet $createPackageParameters | Out-Null
}