Skip to content

Commit

Permalink
Build and test now runs on Windows to specifically target classic .NE…
Browse files Browse the repository at this point in the history
…T as well.
  • Loading branch information
aloneguid committed Aug 3, 2022
1 parent ca6019b commit 7078250
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- PLEASE NOTE THIS IS AN OPEN-SOURCE PROJECT. AUTHOR DOES NOT OWE YOU ANYTHING ;) -->

<!-- DONATING TO THE PROJECT MAY GREATLY SPEED THINGS UP - WORKING ON OSS IS EXPENSIVE AND REQUIRES FOOD/ELECTRICITY/WATER/TIME TOO. -->
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Release

env:
v: '5.1.1'
v: '5.1.2'
av: '5.0.0'
pv: '5.1.1'
pv: '5.1.2'

on:
push:
Expand All @@ -15,7 +15,7 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 2 additions & 1 deletion src/Config.Net.Tests/AbstractTestFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ protected DirectoryInfo BuildDir
{
get
{
return new DirectoryInfo(Path.GetDirectoryName(ThisAssembly.Location));
string dllPath = new Uri(ThisAssembly.CodeBase).LocalPath;
return new FileInfo(dllPath).Directory;
}
}

Expand Down
17 changes: 15 additions & 2 deletions src/Config.Net.Tests/Config.Net.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<VersionPrefix>3.0.0</VersionPrefix>
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>

<Choose>
<When Condition="'$(OS)' == 'Windows_NT'">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net6.0;net461</TargetFrameworks>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>

<ItemGroup>
<None Update="TestData\sample.Debug.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<DependentUpon>TestData\sample.json</DependentUpon>
Expand Down
25 changes: 23 additions & 2 deletions src/Config.Net.Yaml/Config.Net.Yaml.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<AssemblyOriginatorKeyFile>../config.snk</AssemblyOriginatorKeyFile>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<FileVersion>4.7.3.0</FileVersion>
Expand All @@ -13,29 +12,51 @@
<PackageProjectUrl>https://github.com/aloneguid/config</PackageProjectUrl>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageIcon>icon.png</PackageIcon>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<Description>Adds YAML support to Config.Net</Description>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<Choose>
<When Condition="'$(OS)' == 'Windows_NT'">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0;net6.0;net461</TargetFrameworks>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>


<ItemGroup>
<PackageReference Include="YamlDotNet" Version="11.2.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Config.Net\Config.Net.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\icon.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Update="DotNet.ReproducibleBuilds" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions src/Config.Net.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F2107671-5DC0-48C0-ABE8-D80ACDC5D7D2}"
ProjectSection(SolutionItems) = preProject
..\.editorconfig = ..\.editorconfig
..\.github\ISSUE_TEMPLATE.md = ..\.github\ISSUE_TEMPLATE.md
..\docs\README.md = ..\docs\README.md
..\.github\workflows\release.yml = ..\.github\workflows\release.yml
EndProjectSection
Expand Down
25 changes: 22 additions & 3 deletions src/Config.Net/Config.Net.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="Log">
<PropertyGroup>
<Copyright>Copyright (c) 2015-2022 by Ivan Gavryliuk</Copyright>
<AssemblyTitle>Config.Net</AssemblyTitle>
<Authors>Ivan Gavryliuk (@aloneguid)</Authors>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<AssemblyName>Config.Net</AssemblyName>
<PackageId>Config.Net</PackageId>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
Expand All @@ -12,7 +11,6 @@
<Description>Super simple configuration framework for .NET focused on developer ergonomics and strong typing. Supports multiple configuration sources such as .ini, .json, .xml files, as well as external providers pluggable by other NuGet packages.</Description>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageIcon>icon.png</PackageIcon>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageIconUrl />
Expand All @@ -23,6 +21,27 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<Choose>
<When Condition="'$(OS)' == 'Windows_NT'">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0;net6.0;net461</TargetFrameworks>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<Target Name="Log">
<Message Text="HELLO $(OS)" Importance="high"/>
</Target>

<ItemGroup>
<PackageReference Include="Castle.Core" Version="5.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
Expand Down

0 comments on commit 7078250

Please sign in to comment.