Skip to content

Commit

Permalink
Merge pull request #6 from softawaregmbh/netstandard2
Browse files Browse the repository at this point in the history
netstandard2 upgrade
  • Loading branch information
doerrD authored Nov 27, 2024
2 parents ea107ef + feb6a21 commit e6139a4
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 113 deletions.
Binary file added Assets/package-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
@@ -1,15 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.0" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
</ItemGroup>

Expand Down
90 changes: 45 additions & 45 deletions softaware.Holidays.Austria/Generator.cs
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
using System;
using System.Collections.Generic;
using softaware.Holidays.Model;

namespace softaware.Holidays.Austria
{
/// <summary>
/// Static class to extend the <see cref="softaware.Holidays.Generator"/> with a method specific for Austrian holidays.
/// </summary>
public static class Generator
{
/// <summary>
/// Generates Austrian holidays for a given year.
/// </summary>
/// <param name="generator">The generated that gets extended.</param>
/// <param name="year">The year for which the holidays should be generated.</param>
/// <returns>An <code>IEnumerable</code> of the generated holidays.</returns>
public static IEnumerable<Holiday> ForAustria(this Holidays.Generator generator, int year)
{
var holiday = generator.Create(year);

yield return holiday.WithDate("Neujahr", month: 1, day: 1);
yield return holiday.WithDate("Heilige Drei Könige", month: 1, day: 6);
yield return holiday.WithDate("Valentinstag", month: 2, day: 14, workingDay: true);
yield return holiday.BeforeEaster("Karfreitag", days: 2, workingDay: true);
yield return holiday.AfterEaster("Ostersonntag", days: 0);
yield return holiday.AfterEaster("Ostermontag", days: 1);
yield return holiday.WithDate("Staatsfeiertag", month: 5, day: 1);
yield return holiday.NthDayInMonth("Muttertag", 2, DayOfWeek.Sunday, 5, workingDay: true);
yield return holiday.AfterEaster("Christi Himmelfahrt", days: 39);
yield return holiday.AfterEaster("Pfingstsonntag", days: 49);
yield return holiday.AfterEaster("Pfingstmontag", days: 50);
yield return holiday.AfterEaster("Fronleichnam", days: 60);
yield return holiday.NthDayInMonth("Vatertag", 2, DayOfWeek.Sunday, 6, workingDay: true);
yield return holiday.WithDate("Mariä Himmelfahrt", month: 8, day: 15);
yield return holiday.WithDate("Nationalfeiertag", month: 10, day: 26);
yield return holiday.WithDate("Halloween", month: 10, day: 31, workingDay: true);
yield return holiday.WithDate("Allerheiligen", month: 11, day: 1);
yield return holiday.WithDate("Mariä Empfängnis", month: 12, day: 8);
yield return holiday.WithDate("Heiligabend", month: 12, day: 24, workingDay: true);
yield return holiday.WithDate("Christtag", month: 12, day: 25);
yield return holiday.WithDate("Stefanitag", month: 12, day: 26);
}
}
}
using System;
using System.Collections.Generic;
using softaware.Holidays.Model;

namespace softaware.Holidays.Austria
{
/// <summary>
/// Static class to extend the <see cref="softaware.Holidays.Generator"/> with a method specific for Austrian holidays.
/// </summary>
public static class Generator
{
/// <summary>
/// Generates Austrian holidays for a given year.
/// </summary>
/// <param name="generator">The generated that gets extended.</param>
/// <param name="year">The year for which the holidays should be generated.</param>
/// <returns>An <code>IEnumerable</code> of the generated holidays.</returns>
public static IEnumerable<Holiday> ForAustria(this Holidays.Generator generator, int year)
{
var holiday = generator.Create(year);

yield return holiday.WithDate("Neujahr", month: 1, day: 1);
yield return holiday.WithDate("Heilige Drei Könige", month: 1, day: 6);
yield return holiday.WithDate("Valentinstag", month: 2, day: 14, workingDay: true);
yield return holiday.BeforeEaster("Karfreitag", days: 2, workingDay: true);
yield return holiday.AfterEaster("Ostersonntag", days: 0);
yield return holiday.AfterEaster("Ostermontag", days: 1);
yield return holiday.WithDate("Staatsfeiertag", month: 5, day: 1);
yield return holiday.NthDayInMonth("Muttertag", 2, DayOfWeek.Sunday, 5, workingDay: true);
yield return holiday.AfterEaster("Christi Himmelfahrt", days: 39);
yield return holiday.AfterEaster("Pfingstsonntag", days: 49);
yield return holiday.AfterEaster("Pfingstmontag", days: 50);
yield return holiday.AfterEaster("Fronleichnam", days: 60);
yield return holiday.NthDayInMonth("Vatertag", 2, DayOfWeek.Sunday, 6, workingDay: true);
yield return holiday.WithDate("Mariä Himmelfahrt", month: 8, day: 15);
yield return holiday.WithDate("Nationalfeiertag", month: 10, day: 26);
yield return holiday.WithDate("Halloween", month: 10, day: 31, workingDay: true);
yield return holiday.WithDate("Allerheiligen", month: 11, day: 1);
yield return holiday.WithDate("Mariä Empfängnis", month: 12, day: 8);
yield return holiday.WithDate("Heiligabend", month: 12, day: 24, workingDay: true);
yield return holiday.WithDate("Christtag", month: 12, day: 25);
yield return holiday.WithDate("Stefanitag", month: 12, day: 26);
}
}
}
68 changes: 36 additions & 32 deletions softaware.Holidays.Austria/softaware.Holidays.Austria.csproj
Original file line number Diff line number Diff line change
@@ -1,32 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.0</TargetFramework>
<Version>1.0.4</Version>
<PackageProjectUrl>https://github.com/softawaregmbh/library-holidays</PackageProjectUrl>
<RepositoryUrl>https://github.com/softawaregmbh/library-holidays</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>softaware, Holiday</PackageTags>
<Company>softaware gmbh</Company>
<Authors>softaware gmbh</Authors>
<PackageLicenseUrl>https://github.com/softawaregmbh/library-holidays/blob/master/LICENSE</PackageLicenseUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageIconUrl>https://secure.gravatar.com/avatar/d441f5a5514d2afce7da518a89f028d0?s=512&amp;r=g&amp;d=retro</PackageIconUrl>
<Description>A simple .netstandard library for automatically generating holidays.
This is the library for Austrian holidays.</Description>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\netstandard1.0\softaware.Holidays.Austria.xml</DocumentationFile>
<WarningsAsErrors>NU1605;CS1591</WarningsAsErrors>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard1.0\softaware.Holidays.Austria.xml</DocumentationFile>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\softaware.Holidays.Core\softaware.Holidays.Core.csproj" />
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>2.0.0</Version>
<PackageProjectUrl>https://github.com/softawaregmbh/library-holidays</PackageProjectUrl>
<RepositoryUrl>https://github.com/softawaregmbh/library-holidays</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>softaware, Holiday</PackageTags>
<Company>softaware gmbh</Company>
<Authors>softaware gmbh</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageIcon>package-icon.png</PackageIcon>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Description>A simple .netstandard library for automatically generating holidays. This is the library for Austrian holidays.</Description>
<PackageReleaseNotes>Update to netstandard2.0</PackageReleaseNotes>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\netstandard1.0\softaware.Holidays.Austria.xml</DocumentationFile>
<WarningsAsErrors>NU1605;CS1591</WarningsAsErrors>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard1.0\softaware.Holidays.Austria.xml</DocumentationFile>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\softaware.Holidays.Core\softaware.Holidays.Core.csproj" />
</ItemGroup>

<ItemGroup>
<Content Include="..\Assets\package-icon.png" Link="package-icon.png" Pack="true" PackagePath="/" />
</ItemGroup>

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

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
</ItemGroup>

Expand Down
60 changes: 32 additions & 28 deletions softaware.Holidays.Core/softaware.Holidays.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.0</TargetFramework>
<Version>1.0.3</Version>
<PackageProjectUrl>https://github.com/softawaregmbh/library-holidays</PackageProjectUrl>
<RepositoryUrl>https://github.com/softawaregmbh/library-holidays</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>softaware, Holiday</PackageTags>
<Company>softaware gmbh</Company>
<Authors>softaware gmbh</Authors>
<PackageLicenseUrl>https://github.com/softawaregmbh/library-holidays/blob/master/LICENSE</PackageLicenseUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageIconUrl>https://secure.gravatar.com/avatar/d441f5a5514d2afce7da518a89f028d0?s=512&amp;r=g&amp;d=retro</PackageIconUrl>
<Description>A simple .netstandard library for automatically generating holidays.
This is the core library.</Description>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\netstandard1.0\softaware.Holidays.Core.xml</DocumentationFile>
<WarningsAsErrors>NU1605;CS1591</WarningsAsErrors>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard1.0\softaware.Holidays.Core.xml</DocumentationFile>
</PropertyGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>2.0.0</Version>
<PackageProjectUrl>https://github.com/softawaregmbh/library-holidays</PackageProjectUrl>
<RepositoryUrl>https://github.com/softawaregmbh/library-holidays</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>softaware, Holiday</PackageTags>
<Company>softaware gmbh</Company>
<Authors>softaware gmbh</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageIcon>package-icon.png</PackageIcon>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Description>A simple .netstandard library for automatically generating holidays. This is the core library.</Description>
<PackageReleaseNotes>Update to netstandard2.0</PackageReleaseNotes>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\netstandard1.0\softaware.Holidays.Core.xml</DocumentationFile>
<WarningsAsErrors>NU1605;CS1591</WarningsAsErrors>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard1.0\softaware.Holidays.Core.xml</DocumentationFile>
</PropertyGroup>

<ItemGroup>
<Content Include="..\Assets\package-icon.png" Link="package-icon.png" Pack="true" PackagePath="/" />
</ItemGroup>

</Project>

0 comments on commit e6139a4

Please sign in to comment.