Skip to content

Commit

Permalink
MAINTENANCE: drop net50, introduce net70
Browse files Browse the repository at this point in the history
Signed-off-by: Jiri Slachta <jiri@slachta.eu>
  • Loading branch information
jslachta committed Dec 5, 2022
1 parent b78208a commit 233a7fd
Show file tree
Hide file tree
Showing 15 changed files with 340 additions and 1,464 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fetch-depth: 0

- name: sonarscan-dotnet
uses: highbyte/sonarscan-dotnet@v2.1.3
uses: highbyte/sonarscan-dotnet@v2.2.1
with:
# The key of the SonarQube project
sonarProjectKey: jslachta_LocaleNames
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
dotnet-version: 7.0.x

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: 7.0.x

- name: Restore dependencies
run: dotnet restore src/LocaleNames.sln
Expand All @@ -26,10 +26,10 @@ jobs:
run: dotnet build --no-restore src/LocaleNames.sln

- name: Test
run: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=./lcov.info src/LocaleNames.Test/LocaleNames.Test.csproj
run: dotnet test src/LocaleNames.Test/LocaleNames.Test.csproj /p:CollectCoverage=true

- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: ${{ github.workspace }}/src/LocaleNames.Test/lcov.info
path-to-lcov: ${{ github.workspace }}/Coverage/lcov.info
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
mono_crash.*

# Build results
Coverage/
NuGet/
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
Expand Down
26 changes: 26 additions & 0 deletions src/Configuration.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Import Project="Version.targets" />

<!-- Common -->
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Platforms>AnyCPU</Platforms>
<RepoRoot>$([System.IO.Path]::GetDirectoryName($([MSBuild]::GetPathOfFileAbove('.gitignore', '$(MSBuildThisFileDirectory)'))))</RepoRoot>
<!--<CodeAnalysisRuleSet>$(RepoRoot)\Configuration\CodeAnalysis.ruleset</CodeAnalysisRuleSet>-->
</PropertyGroup>

<PropertyGroup Condition="$(Configuration.Contains('Debug'))">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="$(Configuration.Contains('Release'))">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>

</Project>
5 changes: 5 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<!-- This target is replaced by GitInfo when restored. Allows Versions.targets to rely on it before restore. -->
<Target Name="GitVersion" />
<Target Name="GitInfo" />
</Project>
1 change: 0 additions & 1 deletion src/LocaleNames.Test/ExtensionsTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using LocaleNames.Extensions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Globalization;

namespace LocaleTranslations.Test
{
Expand Down
36 changes: 18 additions & 18 deletions src/LocaleNames.Test/LocaleNames.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\Configuration.targets" />
<PropertyGroup>
<TargetFramework>net60</TargetFramework>

<TargetFramework>net70</TargetFramework>
<IsPackable>false</IsPackable>
<CollectCoverage>true</CollectCoverage>
<ExcludeByAttribute>GeneratedCodeAttribute</ExcludeByAttribute>
<CoverletOutputFormat>lcov</CoverletOutputFormat>
<CoverletOutput>$(RepoRoot)\Coverage\lcov.info</CoverletOutput>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="3.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.3" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.3" />
<PackageReference Include="coverlet.collector" Version="3.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<ProjectReference Include="..\LocaleNames\LocaleNames.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\LocaleNames\LocaleNames.csproj" />
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
6 changes: 4 additions & 2 deletions src/LocaleNames.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30711.63
# Visual Studio Version 17
VisualStudioVersion = 17.4.33122.133
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LocaleNames", "LocaleNames\LocaleNames.csproj", "{37660C7C-9E95-4B3F-8AC1-C691E3414E9C}"
EndProject
Expand All @@ -11,8 +11,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PrepareLocaleData", "Prepar
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CE53DF98-DC29-4708-9737-2D6F42A76CD7}"
ProjectSection(SolutionItems) = preProject
Configuration.targets = Configuration.targets
..\LICENSE = ..\LICENSE
..\README.md = ..\README.md
Version.targets = Version.targets
EndProjectSection
EndProject
Global
Expand Down
117 changes: 37 additions & 80 deletions src/LocaleNames/LocaleNames.csproj
Original file line number Diff line number Diff line change
@@ -1,83 +1,40 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net50;net60</TargetFrameworks>

<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Authors>Jiri Slachta</Authors>
<PackageTags>locale, translations</PackageTags>
<PackageProjectUrl>https://github.com/jslachta/LocaleNames</PackageProjectUrl>

<RepositoryUrl>https://github.com/jslachta/LocaleNames</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>

<PackageLicenseExpression>Unlicense</PackageLicenseExpression>
<Description>The LocaleNames library provides language and country names translation to almost any language.</Description>
<Copyright>Copyright © Jiri Slachta</Copyright>
<PackageReleaseNotes>Check: https://github.com/jslachta/LocaleNames/releases </PackageReleaseNotes>
<GitTagRegex Condition="'$(GitTagRegex)' == ''">v*</GitTagRegex>
<GenerateNuspecDependsOn>ReadPackageVersionFromOutputAssembly;$(GenerateNuspecDependsOn)</GenerateNuspecDependsOn>

<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<Target Name="ReadPackageVersionFromOutputAssembly" DependsOnTargets="Build">
<GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
<Output TaskParameter="Assemblies" ItemName="PackAssembly" />
</GetAssemblyIdentity>
<PropertyGroup>
<PackageVersion>%(PackAssembly.Version)</PackageVersion>
</PropertyGroup>
</Target>

<Target Name="ReadPackageVersionFromOutputAssemblySingleTfm" Returns="@(PackAssembly)" Condition="'$(IsCrossTargetingBuild)' != 'true'">
<GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
<Output TaskParameter="Assemblies" ItemName="PackAssembly" />
</GetAssemblyIdentity>
<PropertyGroup>
<PackageVersion>%(PackAssembly.Version)</PackageVersion>
</PropertyGroup>
</Target>

<Target Name="ReadPackageVersionFromOutputAssemblyMultipleTfms" Condition="'$(IsCrossTargetingBuild)' == 'true'">
<PropertyGroup>
<FirstTargetFramework>$([System.String]::Copy($(TargetFrameworks)).Split(';').GetValue(0))</FirstTargetFramework>
</PropertyGroup>
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ReadPackageVersionFromOutputAssemblySingleTfm" Properties="TargetFramework=$(FirstTargetFramework)">
<Output TaskParameter="TargetOutputs" ItemName="PackAssembly" />
</MSBuild>
<PropertyGroup>
<PackageVersion>%(PackAssembly.Version)</PackageVersion>
</PropertyGroup>
</Target>

<Target Name="ReadPackageVersionFromOutputAssembly" DependsOnTargets="Build;ReadPackageVersionFromOutputAssemblySingleTfm;ReadPackageVersionFromOutputAssemblyMultipleTfms" />

<ItemGroup>
<PackageReference Include="GitInfo" Version="2.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard2.0'))">
<PackageReference Include="System.Text.Json" Version="[4.6.0,)" />
</ItemGroup>

<Import Project="Resources.include" />
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net60;net70</TargetFrameworks>

<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Authors>Jiri Slachta</Authors>
<PackageTags>locale, translations</PackageTags>
<PackageProjectUrl>https://github.com/jslachta/LocaleNames</PackageProjectUrl>

<RepositoryUrl>https://github.com/jslachta/LocaleNames</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>

<PackageLicenseExpression>Unlicense</PackageLicenseExpression>
<Description>The LocaleNames library provides language and country names translation to almost any language.</Description>
<Copyright>Copyright © Jiri Slachta</Copyright>
<PackageReleaseNotes>Check: https://github.com/jslachta/LocaleNames/releases </PackageReleaseNotes>

<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<Import Project="..\Configuration.targets" />

<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard2.0'))">
<PackageReference Include="System.Text.Json" Version="[4.6.0,)" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Resources\language.*.json.gz" />
</ItemGroup>
</Project>
39 changes: 0 additions & 39 deletions src/LocaleNames/Properties/AssemblyInfo.cs

This file was deleted.

Loading

0 comments on commit 233a7fd

Please sign in to comment.