Skip to content

Commit

Permalink
Worked on a bunch of scrips to prepare for action
Browse files Browse the repository at this point in the history
  • Loading branch information
frankhaugen committed Dec 14, 2023
1 parent cbf9857 commit 629ce37
Show file tree
Hide file tree
Showing 15 changed files with 162 additions and 45 deletions.
20 changes: 0 additions & 20 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,27 +1,7 @@
<Project>
<!-- See https://aka.ms/dotnet/msbuild/customize for more details on customizing your build -->
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>

<Authors>Frank R. Haugen</Authors>
<PublisherName>Frank R. Haugen</PublisherName>
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>Frank.PulseFlow</PackageId>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>www.github.com/frankhaugen/Frank.PulseFlow</PackageProjectUrl>
<PackageTags>Frank.PulseFlow</PackageTags>
<RepositoryUrl>www.github.com/frankhaugen/Frank.PulseFlow</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.11"/>
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.11"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Frank.PulseFlow\Frank.PulseFlow.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Flow\" />
</ItemGroup>
</Project>
6 changes: 6 additions & 0 deletions Frank.PulseFlow.Tests.Benchmarks/Shared/PersistenceService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Frank.PulseFlow.Tests.Benchmarks.Shared;

public class PersistenceService
{

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Frank.PulseFlow.Tests.Benchmarks.Traditional;

public class MyTraditionalService
{

}
11 changes: 8 additions & 3 deletions Frank.PulseFlow.Tests/Frank.PulseFlow.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0"/>
<PackageReference Include="xunit" Version="2.4.2"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand All @@ -17,4 +18,8 @@
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Frank.PulseFlow\Frank.PulseFlow.csproj" />
</ItemGroup>

</Project>
28 changes: 27 additions & 1 deletion Frank.PulseFlow.Tests/UnitTest1.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,35 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace Frank.PulseFlow.Tests;

public class UnitTest1
public class PulseFlowTests
{
[Fact]
public void Test1()
{
var host = CreateHostBuilder().Build();
var pulseFlow = host.Services.GetRequiredService<IConduit>();



}

private class MyClass : BasePulse
{
public string Text { get; set; }
}

private IHostBuilder CreateHostBuilder()
{
return Host.CreateDefaultBuilder()
.ConfigureServices((context, services) =>
{
services.AddPulseFlow(builder =>
{
// builder.AddFlow<Flow1>();
// builder.AddFlow<Flow2>();
});
});
}
}
4 changes: 3 additions & 1 deletion Frank.PulseFlow.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Directory.Build.props = Directory.Build.props
LICENSE = LICENSE
publish.ps1 = publish.ps1
README.md = README.md
restore.ps1 = restore.ps1
test.ps1 = test.ps1
pack.ps1 = pack.ps1
EndProjectSection
EndProject
Global
Expand Down
31 changes: 31 additions & 0 deletions Frank.PulseFlow/Frank.PulseFlow.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,45 @@

<PropertyGroup>
<IsPackable>true</IsPackable>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<OutputType>Library</OutputType>

<Description>PulseFlow uses Channel -mechanism for internal messaging</Description>
<PackageTags>Pulse,Flow,PulseFlow</PackageTags>

<PackageReleaseNotes>Initial release</PackageReleaseNotes>

<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>

<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>

<Authors>Frank R. Haugen</Authors>
<PublisherName>Frank R. Haugen</PublisherName>
<Copyright>Copyright (c) 2023 Frank R. Haugen</Copyright>
<PackageReadmeFile>readme.md</PackageReadmeFile>
<PackageIcon>icon.png</PackageIcon>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://www.github.com/frankhaugen/Frank.PulseFlow</PackageProjectUrl>

<RepositoryUrl>https://www.github.com/frankhaugen/Frank.PulseFlow</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0"/>
</ItemGroup>

<ItemGroup>
<None Include="readme.md" Pack="true" PackagePath="\"/>
<None Include="icon.png" Pack="true" PackagePath="\"/>
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="$(AssemblyName).Tests"/>
<InternalsVisibleTo Include="LINQPadQuery"/>
</ItemGroup>
</Project>
File renamed without changes.
Binary file added Frank.PulseFlow/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
param (
[Parameter(Mandatory=$false)]
[string]$version = (Get-Date -Format 'yyyy.MM.dd')
)

# Get directory of the script
$scriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.Definition

# Get path to the project file
$projectFile = "$scriptDirectory/Frank.PulseFlow/Frank.PulseFlow.csproj"

# Build the solution in the specified mode
Write-Host "Building solution in Release mode..." -ForegroundColor DarkCyan
dotnet build $projectFile --configuration Release --no-restore /p:Version=$version | Out-Null

# Exit with a success code
exit 0
30 changes: 30 additions & 0 deletions pack.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
param (
[Parameter(Mandatory=$false)]
[string]$version = (Get-Date -Format 'yyyy.MM.dd')
)

# Get directory of the script
$scriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.Definition

# Get path to the output directory
$outputDirectory = "$scriptDirectory/.artifacts"

# Get path to the publish directory
$publishDirectory = "$outputDirectory/publish"

# Get path to the package directory
$packageDirectory = "$outputDirectory/packages"

# Get path to the project file
$projectFile = "$scriptDirectory/Frank.PulseFlow/Frank.PulseFlow.csproj"

# Clean output directories
if (Test-Path $publishDirectory) { Remove-Item "$publishDirectory/*" -Recurse }
if (Test-Path $packageDirectory) { Remove-Item "$packageDirectory/*" -Recurse }

# Pack NuGet packages
Write-Host "Packing NuGet packages..." -ForegroundColor DarkCyan
dotnet pack $projectFile --configuration Release --output $packageDirectory --no-build /p:Version=$version /p:PackageVersion=$version | Out-Null

# Exit with a success code
exit 0
24 changes: 4 additions & 20 deletions publish.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,13 @@ $outputDirectory = "$scriptDirectory/.artifacts"
# Get path to the publish directory
$publishDirectory = "$outputDirectory/publish"

# Get path to the package directory
$packageDirectory = "$outputDirectory/packages"

# Get path to the project file
$projectFile = "$scriptDirectory/Frank.PulseFlow/Frank.PulseFlow.csproj"

# Restore NuGet packages
Write-Host "Restoring NuGet packages..." -ForegroundColor DarkCyan
dotnet restore $projectFile | Out-Null

# Clean output directories
if (Test-Path $publishDirectory) { Remove-Item "$publishDirectory/*" -Recurse }
if (Test-Path $packageDirectory) { Remove-Item "$packageDirectory/*" -Recurse }

# Build the solution in the specified mode
Write-Host "Building solution in Release mode..." -ForegroundColor DarkCyan
dotnet build $projectFile --configuration Release --no-restore /p:Version=$version | Out-Null

# Pack NuGet packages
Write-Host "Packing NuGet packages..." -ForegroundColor DarkCyan
dotnet pack $projectFile --configuration Release --output $packageDirectory --no-build /p:Version=$version /p:PackageVersion=$version | Out-Null

# Publish the solution and pack NuGet packages
Write-Host "Publishing the project..." -ForegroundColor DarkCyan
dotnet publish $projectFile --configuration Release --output $publishDirectory --no-build /p:Version=$version /p:PackageVersion=$version | Out-Null
Write-Host "Project has been published." -ForegroundColor Green
Write-Host "Project has been published." -ForegroundColor Green

# Exit with a success code
exit 0
12 changes: 12 additions & 0 deletions restore.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Get directory of the script
$scriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.Definition

# Get path to the project file
$projectFile = "$scriptDirectory/Frank.PulseFlow/Frank.PulseFlow.csproj"

# Restore NuGet packages
Write-Host "Restoring NuGet packages..." -ForegroundColor Cyan
dotnet restore $projectFile | Out-Null

# Exit with a success code
exit 0
12 changes: 12 additions & 0 deletions test.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Get the script directory
$scriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.Definition

# Get the project file for the test project
$projectFile = "$scriptDirectory/Frank.PulseFlow.Tests/Frank.PulseFlow.Tests.csproj"

# Test the project
Write-Host "Running unit tests..." -ForegroundColor DarkCyan
dotnet test $projectFile --configuration Release

# Exit with a success code
exit 0

0 comments on commit 629ce37

Please sign in to comment.