-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore:updated build scripts and nuspec files
- Loading branch information
Showing
17 changed files
with
108 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1 @@ | ||
export NUGET_API_KEY= | ||
|
||
declare -a PROJECTS=( | ||
"ServiceBase" | ||
"ServiceBase.Mvc" | ||
"ServiceBase.PayPal" | ||
"ServiceBase.Events.RabbitMQ" | ||
"ServiceBase.Notification.SendGrid" | ||
"ServiceBase.Notification.Smtp" | ||
"ServiceBase.Notification.Twilio" | ||
) | ||
NUGET_API_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Set version | ||
$VERSION = "6.0.2" | ||
|
||
# Restore dependencies | ||
dotnet restore ./ServiceBase.sln | ||
|
||
# Build | ||
dotnet build ./ServiceBase.sln --no-restore --configuration Release /property:Version=$VERSION | ||
|
||
# Pack all the nugets | ||
$csprojFiles = Get-ChildItem -Path .\src -Filter *.csproj -Recurse | ||
foreach ($csprojFile in $csprojFiles) { | ||
$projectName = $csprojFile.BaseName | ||
nuget pack ./src/$projectName/$projectName.nuspec -OutputDirectory ./artifacts/packages -Properties Configuration=Release -version $VERSION -IncludeReferencedProjects | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Get-ChildItem -Path . -Include bin,obj,artifacts -Recurse -Directory | Remove-Item -Recurse -Force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Stop script execution on error | ||
$ErrorActionPreference = "Stop" | ||
|
||
# Install report generator | ||
Write-Host "Installing ReportGenerator..." | ||
nuget install -Verbosity quiet -OutputDirectory ./packages -Version 5.1.10 ReportGenerator | ||
|
||
# Run all tests | ||
$testProjects = Get-ChildItem -Path ./test -Filter *.csproj -Recurse | ||
foreach ($testProject in $testProjects) { | ||
Write-Host "Running tests on project $testProject..." | ||
dotnet test $testProject.FullName --no-build --collect:"XPlat Code Coverage" | ||
} | ||
|
||
# Generate report | ||
Write-Host "Generating report..." | ||
dotnet ./packages/ReportGenerator.5.1.10/tools/net6.0/ReportGenerator.dll ` | ||
-reports:./test/*/TestResults/*/*.xml ` | ||
-targetdir:./TestReport ` | ||
-historydir:./TestReport/history | ||
|
||
# Remove all test reports | ||
Write-Host "Removing test reports..." | ||
Get-ChildItem -Path ./test -Filter TestResults -Recurse -Directory | Remove-Item -Recurse -Force | ||
Write-Host "Done." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
$directory = Get-Location | ||
$csprojFiles = Get-ChildItem -Path $directory -Filter *.csproj -Recurse | ||
|
||
foreach ($csprojPath in $csprojFiles) { | ||
|
||
|
||
$nuspecPath = $csprojPath.FullName -replace '\.csproj$', '.nuspec' | ||
if (-not (Test-Path -Path $nuspecPath)) { | ||
Write-Host "No nuspec file found for $csprojPath, skipping..." | ||
continue | ||
} | ||
|
||
Write-Host "Updating nuspec file for: $csprojPath" | ||
|
||
[xml]$csprojFile = Get-Content -Path $csprojPath.FullName | ||
[xml]$nuspecFile = Get-Content -Path $nuspecPath | ||
|
||
$packageReferences = $csprojFile.Project.ItemGroup.PackageReference | ||
|
||
foreach ($packageReference in $packageReferences) { | ||
$id = $packageReference.Include | ||
$version = $packageReference.Version | ||
$nuspecDependency = $nuspecFile.package.metadata.dependencies.group.dependency | Where-Object { $_.id -eq $id } | ||
if ($null -ne $nuspecDependency) { | ||
$nuspecDependency.version = $version | ||
} | ||
} | ||
|
||
$nuspecFile.Save($nuspecPath) | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 22 additions & 22 deletions
44
src/ServiceBase.Notification.Plivo/ServiceBase.Notification.Plivo.nuspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd"> | ||
<metadata> | ||
<id>ServiceBase.Notification.Plivo</id> | ||
<version>$version$</version> | ||
<authors>Russlan Akiev</authors> | ||
<owners>Russlan Akiev</owners> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<projectUrl>https://github.com/aruss/ServiceBase</projectUrl> | ||
<description>Plivo SMS sender for ServiceBase.Notification.Sms</description> | ||
<copyright>Copyright (c) Russlan Akiev. All rights reserved.</copyright> | ||
<license type="expression">MIT</license> | ||
<tags>servicebase plivo sms</tags> | ||
<dependencies> | ||
<group targetFramework="net6.0"> | ||
<dependency id="ServiceBase" version="5.0.1" exclude="Build,Analyzers" /> | ||
</group> | ||
</dependencies> | ||
</metadata> | ||
<files> | ||
<file src="bin\Release\net6.0\ServiceBase.Notification.Plivo.dll" target="lib\net6.0\ServiceBase.Notification.Plivo.dll" /> | ||
</files> | ||
</package> | ||
<metadata> | ||
<id>ServiceBase.Notification.Plivo</id> | ||
<version>$version$</version> | ||
<authors>Russlan Akiev</authors> | ||
<owners>Russlan Akiev</owners> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<projectUrl>https://github.com/aruss/ServiceBase</projectUrl> | ||
<description>Plivo SMS sender for ServiceBase.Notification.Sms</description> | ||
<copyright>Copyright (c) Russlan Akiev. All rights reserved.</copyright> | ||
<license type="expression">MIT</license> | ||
<tags>servicebase plivo sms</tags> | ||
<dependencies> | ||
<group targetFramework="net6.0"> | ||
<dependency id="ServiceBase" version="5.0.1" exclude="Build,Analyzers" /> | ||
</group> | ||
</dependencies> | ||
</metadata> | ||
<files> | ||
<file src="bin\Release\net6.0\ServiceBase.Notification.Plivo.dll" target="lib\net6.0\ServiceBase.Notification.Plivo.dll" /> | ||
</files> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters