Skip to content

Commit

Permalink
Modernize solution (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkatufus authored Sep 28, 2023
1 parent 230dc4a commit 1b80ec2
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 41 deletions.
10 changes: 10 additions & 0 deletions Akka.Persistence.SqlServer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{D8BAD8E8
build.sh = build.sh
src\Directory.Build.props = src\Directory.Build.props
src\Directory.Packages.props = src\Directory.Packages.props
build.ps1 = build.ps1
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{85A25CFE-0B51-45FC-9C5E-271F9557F8D3}"
Expand All @@ -34,6 +35,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Akka.Hosting.CustomJournalI
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Akka.Hosting.SqlSharding", "src\Examples\Akka.Hosting.SqlSharding\Akka.Hosting.SqlSharding.csproj", "{06734F4B-5995-4A08-92CA-0177C0DFD512}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build-system", "build-system", "{7B559856-A130-4ABB-88C0-FBA72D5C209C}"
ProjectSection(SolutionItems) = preProject
build-system\azure-pipeline.template.yaml = build-system\azure-pipeline.template.yaml
build-system\linux-pr-validation.yaml = build-system\linux-pr-validation.yaml
build-system\README.md = build-system\README.md
build-system\windows-release.yaml = build-system\windows-release.yaml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -74,5 +83,6 @@ Global
GlobalSection(NestedProjects) = preSolution
{EE293645-8486-4D81-8387-DDD5F617FCE5} = {E5A4FE07-0354-472F-9DF0-458F68FDE2DE}
{06734F4B-5995-4A08-92CA-0177C0DFD512} = {E5A4FE07-0354-472F-9DF0-458F68FDE2DE}
{7B559856-A130-4ABB-88C0-FBA72D5C209C} = {D8BAD8E8-F881-4B23-8CCC-E5724CF9292B}
EndGlobalSection
EndGlobal
7 changes: 6 additions & 1 deletion build-system/windows-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@ variables:
- name: githubRepositoryName
value: akkadotnet/Akka.Persistence.SqlServer
steps:
- task: UseDotNet@2
displayName: 'Use .NET 7'
inputs:
version: '7.x'

- task: BatchScript@1
displayName: 'FAKE Build'
inputs:
filename: build.cmd
arguments: 'nuget nugetpublishurl=https://www.nuget.org/api/v2/package nugetkey=$(nugetKey)'
arguments: 'nuget nugetpublishurl=https://api.nuget.org/v3/index.json nugetkey=$(nugetKey)'

- task: GitHubRelease@0
displayName: 'GitHub release (create)'
Expand Down
50 changes: 26 additions & 24 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,30 +213,32 @@ Target "CreateNuget" (fun _ ->
)

Target "PublishNuget" (fun _ ->
let projects = !! "./bin/nuget/*.nupkg" -- "./bin/nuget/*.symbols.nupkg"
let apiKey = getBuildParamOrDefault "nugetkey" ""
let source = getBuildParamOrDefault "nugetpublishurl" ""
let symbolSource = getBuildParamOrDefault "symbolspublishurl" ""
let shouldPublishSymbolsPackages = not (symbolSource = "")

if (not (source = "") && not (apiKey = "") && shouldPublishSymbolsPackages) then
let runSingleProject project =
DotNetCli.RunCommand
(fun p ->
{ p with
TimeOut = TimeSpan.FromMinutes 10. })
(sprintf "nuget push %s --api-key %s --source %s --symbol-source %s" project apiKey source symbolSource)

projects |> Seq.iter (runSingleProject)
else if (not (source = "") && not (apiKey = "") && not shouldPublishSymbolsPackages) then
let runSingleProject project =
DotNetCli.RunCommand
(fun p ->
{ p with
TimeOut = TimeSpan.FromMinutes 10. })
(sprintf "nuget push %s --api-key %s --source %s" project apiKey source)

projects |> Seq.iter (runSingleProject)
let shouldPushNugetPackages = hasBuildParam "nugetkey"
if not shouldPushNugetPackages then ()
else
let apiKey = getBuildParam "nugetkey"
let sourceUrl = getBuildParamOrDefault "nugetpublishurl" "https://api.nuget.org/v3/index.json"

let rec publishPackage retryLeft packageFile =
tracefn "Pushing %s Attempts left: %d" (FullName packageFile) retryLeft
let tracing = ProcessHelper.enableProcessTracing
try
try
ProcessHelper.enableProcessTracing <- false
DotNetCli.RunCommand
(fun p ->
{ p with
TimeOut = TimeSpan.FromMinutes 10. })
(sprintf "nuget push %s --api-key %s --source %s --no-service-endpoint" packageFile apiKey sourceUrl)
with exn ->
if (retryLeft > 0) then (publishPackage (retryLeft-1) packageFile)
finally
ProcessHelper.enableProcessTracing <- tracing

printfn "Pushing nuget packages"
let normalPackages = !! (outputNuGet @@ "*.nupkg") |> Seq.sortBy(fun x -> x.ToLower())
for package in normalPackages do
publishPackage 3 package
)

//--------------------------------------------------------------------------------
Expand Down
3 changes: 0 additions & 3 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ Param(
)

$FakeVersion = "4.61.2"
$DotNetChannel = "LTS";
$DotNetVersion = "3.1.100";
$DotNetInstallerUri = "https://dot.net/v1/dotnet-install.ps1";
$NugetVersion = "4.1.0";
$NugetUrl = "https://dist.nuget.org/win-x86-commandline/v$NugetVersion/nuget.exe"
$ProtobufVersion = "3.4.0"
Expand Down
Binary file added docs/images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<TargetFramework>$(NetStandardLibVersion)</TargetFramework>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Description>Akka.Persistence.SqlServer Microsoft.Extensions.Hosting support.</Description>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -17,5 +19,6 @@

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
<None Include="../../docs/images/icon.png" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class = ""Akka.Persistence.SqlServer.Journal.SqlServerJournal, Akka.Persistence.
.WithFallback(SqlReadJournal.DefaultConfiguration());
}

protected override bool SupportsTagsInEventEnvelope => true;

protected void Dispose(bool disposing)
{
DbUtils.Clean();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class = ""Akka.Persistence.SqlServer.Journal.SqlServerJournal, Akka.Persistence.
.WithFallback(SqlReadJournal.DefaultConfiguration());
}

protected override bool SupportsTagsInEventEnvelope => true;

protected void Dispose(bool disposing)
{
DbUtils.Clean();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
</Description>
<TargetFramework>$(NetStandardLibVersion)</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -16,4 +18,8 @@
<PackageReference Include="Akka.Persistence.Sql.Common"/>
<PackageReference Include="Microsoft.Data.SqlClient"/>
</ItemGroup>
<ItemGroup>
<None Include="../../README.md" Pack="true" PackagePath="\" />
<None Include="../../docs/images/icon.png" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>
14 changes: 6 additions & 8 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,19 @@
<PropertyGroup>
<Copyright>Copyright © 2013-2023 Akka.NET Team</Copyright>
<Authors>Akka.NET Team</Authors>
<VersionPrefix>1.5.0</VersionPrefix>
<PackageIconUrl>http://getakka.net/images/akkalogo.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/akkadotnet/Akka.Persistence.SqlServer</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/akkadotnet/Akka.Persistence.SqlServer/blob/master/LICENSE</PackageLicenseUrl>
<PackageReleaseNotes>[Update Akka.NET to v1.5.0](https://github.com/akkadotnet/akka.net/releases/tag/1.5.0)</PackageReleaseNotes>
<VersionPrefix>1.5.4</VersionPrefix>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<LangVersion>11</LangVersion>
</PropertyGroup>
<PropertyGroup>
<XunitVersion>2.5.1</XunitVersion>
<AkkaVersion>1.5.12</AkkaVersion>
<TestSdkVersion>17.4.1</TestSdkVersion>
<NetCoreTestVersion>net6.0</NetCoreTestVersion>
<NetFrameworkTestVersion>net48</NetFrameworkTestVersion>
<NetStandardLibVersion>netstandard2.0</NetStandardLibVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
</PropertyGroup>
<!-- NuGet package properties -->
<PropertyGroup>
<!-- Optional: Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand All @@ -29,7 +23,11 @@
<!-- Optional: Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageProjectUrl>https://github.com/akkadotnet/Akka.Persistence.SqlServer</PackageProjectUrl>
<PackageReleaseNotes>[Update Akka.NET to v1.5.4](https://github.com/akkadotnet/akka.net/releases/tag/1.5.4)</PackageReleaseNotes>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
</PropertyGroup>
<!-- GitHub SourceLink -->
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
</ItemGroup>
Expand Down
15 changes: 10 additions & 5 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<AkkaVersion>1.5.12</AkkaVersion>
<AkkaHostingVersion>1.5.8.1</AkkaHostingVersion>
</PropertyGroup>
<!-- App dependencies -->
<ItemGroup>
<PackageVersion Include="Akka.Cluster.Hosting" Version="1.5.12.1" />
<PackageVersion Include="Akka.Cluster.Hosting" Version="$(AkkaHostingVersion)" />
<PackageVersion Include="Akka.Persistence.Sql.Common" Version="$(AkkaVersion)" />
<PackageVersion Include="Akka.Persistence.Query.Sql" Version="$(AkkaVersion)" />
<PackageVersion Include="Akka.Hosting" Version="$(AkkaVersion)" />
<PackageVersion Include="Akka.Persistence.Hosting" Version="$(AkkaVersion)" />
<PackageVersion Include="Akka.Hosting" Version="$(AkkaHostingVersion)" />
<PackageVersion Include="Akka.Persistence.Hosting" Version="$(AkkaHostingVersion)" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="3.0.1" />
</ItemGroup>
<!-- Test dependencies -->
<ItemGroup>
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.0" />
<PackageVersion Include="xunit" Version="$(XunitVersion)" />
<PackageVersion Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
<PackageVersion Include="FluentAssertions" Version="6.11.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageVersion Include="xunit" Version="2.5.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.1" />
<PackageVersion Include="Akka.TestKit.Xunit2" Version="$(AkkaVersion)" />
<PackageVersion Include="Akka.Persistence.Sql.TestKit" Version="$(AkkaVersion)" />
<PackageVersion Include="Akka.Persistence.TCK" Version="$(AkkaVersion)" />
<PackageVersion Include="Docker.DotNet" Version="3.125.14" />
</ItemGroup>
<!-- SourceLink support for all Akka.NET projects -->
Expand Down

0 comments on commit 1b80ec2

Please sign in to comment.