Skip to content

Commit

Permalink
modernized repo build system (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronontheweb authored Feb 27, 2023
1 parent c9b490c commit b4339ae
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 253 deletions.
16 changes: 16 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>

<packageSources>
<clear/>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>

<packageSourceMapping>
<!-- key value for <packageSource> should match key values from <packageSources> element -->
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
</packageSourceMapping>

</configuration>
5 changes: 2 additions & 3 deletions build-system/azure-pipeline.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ jobs:
submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
persistCredentials: true
- task: UseDotNet@2
displayName: 'Use .NET Core Runtime 3.1.10'
displayName: 'Use .NET 6'
inputs:
packageType: runtime
version: 3.1.10
version: '7.x'
# Linux or macOS
- task: Bash@3
displayName: Linux / OSX Build
Expand Down
4 changes: 2 additions & 2 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ Target "RestorePackages" (fun _ ->
//--------------------------------------------------------------------------------

Target "AssemblyInfo" (fun _ ->
XmlPokeInnerText "./src/common.props" "//Project/PropertyGroup/VersionPrefix" releaseNotes.AssemblyVersion
XmlPokeInnerText "./src/common.props" "//Project/PropertyGroup/PackageReleaseNotes" (releaseNotes.Notes |> String.concat "\n")
XmlPokeInnerText "./src/Directory.Build.props" "//Project/PropertyGroup/VersionPrefix" releaseNotes.AssemblyVersion
XmlPokeInnerText "./src/Directory.Build.props" "//Project/PropertyGroup/PackageReleaseNotes" (releaseNotes.Notes |> String.concat "\n")
)

//--------------------------------------------------------------------------------
Expand Down
43 changes: 0 additions & 43 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,49 +47,6 @@ if (!(Test-Path $ToolPath)) {
New-Item -Path $ToolPath -Type directory | out-null
}

###########################################################################
# INSTALL .NET CORE CLI
###########################################################################

Function Remove-PathVariable([string]$VariableToRemove)
{
$path = [Environment]::GetEnvironmentVariable("PATH", "User")
if ($path -ne $null)
{
$newItems = $path.Split(';', [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove }
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "User")
}

$path = [Environment]::GetEnvironmentVariable("PATH", "Process")
if ($path -ne $null)
{
$newItems = $path.Split(';', [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove }
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "Process")
}
}

# Get .NET Core CLI path if installed.
$FoundDotNetCliVersion = $null;
if (Get-Command dotnet -ErrorAction SilentlyContinue) {
$FoundDotNetCliVersion = dotnet --version;
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
$env:DOTNET_CLI_TELEMETRY_OPTOUT=1
}

if($FoundDotNetCliVersion -ne $DotNetVersion) {
$InstallPath = Join-Path $PSScriptRoot ".dotnet"
if (!(Test-Path $InstallPath)) {
mkdir -Force $InstallPath | Out-Null;
}
(New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, "$InstallPath\dotnet-install.ps1");
& $InstallPath\dotnet-install.ps1 -Channel $DotNetChannel -Version $DotNetVersion -InstallDir $InstallPath -Architecture x64;

Remove-PathVariable "$InstallPath"
$env:PATH = "$InstallPath;$env:PATH"
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
$env:DOTNET_CLI_TELEMETRY_OPTOUT=1
}

###########################################################################
# INSTALL NUGET
###########################################################################
Expand Down
9 changes: 0 additions & 9 deletions src/.nuget/NuGet.Config

This file was deleted.

10 changes: 0 additions & 10 deletions src/.nuget/NuGet.Dev.Config

This file was deleted.

Binary file removed src/.nuget/NuGet.exe
Binary file not shown.
144 changes: 0 additions & 144 deletions src/.nuget/NuGet.targets

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,35 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\common.props" />
<PropertyGroup>
<TargetFrameworks>$(NetFrameworkTestVersion);$(NetCoreTestVersion)</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Docker.DotNet" Version="3.125.12" />
<PackageReference Include="Akka.Persistence.Sql.TestKit" Version="$(AkkaVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
<PackageReference Include="xunit" Version="$(XunitVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitRunnerVersion)" />

<!--
Use environment variable POSTGRE_LOW=true to build against the _LOWEST_ ranged version of Npgsql package
Make sure that POSTGRE_VERSION variable is _NOT_ set or this flag would not take effect
-->
<PackageReference Condition="'$(POSTGRE_VERSION)' == '' And '$(POSTGRE_LOW)' == 'true'" Include="Npgsql" Version="$(PostgresLowVersion)" />

<!--
Use environment variable POSTGRE_HIGH=true to build against the _HIGHEST_ ranged version of Npgsql package
Make sure that POSTGRE_VERSION variable is _NOT_ set or this flag would not take effect
-->
<PackageReference Condition="'$(POSTGRE_VERSION)' == '' And '$(POSTGRE_HIGH)' == 'true'" Include="Npgsql" Version="$(PostgresHighVersion)" />

<!--
Use environment variable POSTGRE_VERSION={version} to build against a _SPECIFIC_ version of Npgsql package
This environment variable trumps over all other version variables
-->
<PackageReference Condition="'$(POSTGRE_VERSION)' != ''" Include="Npgsql" Version="$(POSTGRE_VERSION)" />
<PackageReference Include="Docker.DotNet"/>
<PackageReference Include="Akka.Persistence.Sql.TestKit" />
<PackageReference Include="Microsoft.NET.Test.Sdk"/>
<PackageReference Include="xunit"/>
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="Npgsql" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\common.props" />
<PropertyGroup>
<AssemblyTitle>Akka.Persistence.PostgreSql</AssemblyTitle>
<Description>Akka Persistence journal and snapshot store backed by PostgreSql database.</Description>
<TargetFrameworks>$(NetStandardLibVersion)</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup>
<None Remove="postgresql.conf" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="postgresql.conf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Npgsql" Version="$(PostgresVersion)" />
<PackageReference Include="Akka.Persistence.Sql.Common" Version="$(AkkaVersion)" />
<PackageReference Include="Npgsql" />
<PackageReference Include="Akka.Persistence.Sql.Common" />
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
Expand Down
16 changes: 7 additions & 9 deletions src/common.props → src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>
<PropertyGroup>
<Copyright>Copyright © 2013-2017 Akka.NET Team</Copyright>
<Copyright>Copyright © 2013-2023 Akka.NET Team</Copyright>
<Authors>Akka.NET Team</Authors>
<VersionPrefix>1.3.9</VersionPrefix>
<VersionPrefix>1.4.46</VersionPrefix>
<PackageIconUrl>http://getakka.net/images/akkalogo.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/akkadotnet/Akka.Persistence.PostgreSql</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/akkadotnet/Akka.Persistence.PostgreSql/blob/dev/LICENSE.md</PackageLicenseUrl>
Expand All @@ -19,14 +19,12 @@
<PostgresHighVersion>6.0.7</PostgresHighVersion>
<PostgresVersion>[$(PostgresLowVersion), $(PostgresHighVersion)]</PostgresVersion>
<NetStandardLibVersion>netstandard2.0</NetStandardLibVersion>
<NetFrameworkVersion>net45</NetFrameworkVersion>
<TestSdkVersion>17.4.1</TestSdkVersion>
<NetCoreTestVersion>netcoreapp3.1</NetCoreTestVersion>
<NetFrameworkTestVersion>net471</NetFrameworkTestVersion>
<NetCoreTestVersion>net7.0</NetCoreTestVersion>
<NetFrameworkTestVersion>net48</NetFrameworkTestVersion>
</PropertyGroup>
<PropertyGroup>
<PackageReleaseNotes>Upgraded for Akka.NET v1.3.9.
Other Fixes and Improvements**
[Bugfix: Loading shapshot error](https://github.com/AkkaNetContrib/Akka.Persistence.PostgreSql/issues/57)</PackageReleaseNotes>
<PackageReleaseNotes>[Update Akka.NET to v1.4.46](https://github.com/akkadotnet/akka.net/releases/tag/1.4.46)
[Add `tag-column-size` HOCON setting to modify journal table Tags column size](https://github.com/akkadotnet/Akka.Persistence.PostgreSql/pull/167)</PackageReleaseNotes>
</PropertyGroup>
</Project>
</Project>
27 changes: 27 additions & 0 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<!-- App dependencies -->
<ItemGroup>
<PackageVersion Include="Akka.Persistence.Sql.Common" Version="$(AkkaVersion)"/>
<PackageVersion Include="Npgsql" Version="$(PostgresVersion)" />
</ItemGroup>

<!-- Test dependencies -->
<ItemGroup>
<PackageVersion Include="FluentAssertions" Version="6.10.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageVersion Include="xunit" Version="$(XunitVersion)" />
<PackageVersion Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
<PackageVersion Include="Akka.TestKit.Xunit2" Version="$(AkkaVersion)" />
<PackageVersion Include="Akka.Persistence.Sql.TestKit" Version="$(AkkaVersion)"/>
<PackageVersion Include="Docker.DotNet" Version="3.125.12"/>
</ItemGroup>

<!-- SourceLink support for all Akka.NET projects -->
<ItemGroup>
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
</ItemGroup>

</Project>

0 comments on commit b4339ae

Please sign in to comment.