Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,28 @@ insert_final_newline = true
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = true

[*.{xml,json,js,ts,jsx,tsx,vue,css,styl,*proj,targets,html,props,yml,nim,nimble,nim.cfg,wsdl,wadl,cmake}]
[*.{xml,wsdl,wadl}]
indent_size = 2

[*.{json,yml,yaml}]
indent_size = 2

[*.{js,jsx,ts,tsx,vue,css,styl,html}]
indent_size = 2

[*.{*proj,targets,props}]
indent_size = 2

[{{packages,nuget}.config,*.nuspec}]
indent_size = 2

[*.{nim,nimble,nim.cfg}]
indent_size = 2

[*.rb]
indent_size = 2

[*.cmake]
indent_size = 2

[CMakeLists.txt]
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ _TeamCity*
!.axoCover/settings.json

# Coverlet is a free, cross platform Code Coverage Tool
coverage*[.json, .xml, .info]
coverage*.json
coverage*.xml
coverage*.info

# Visual Studio code coverage results
*.coverage
Expand Down
8 changes: 0 additions & 8 deletions AllRules.ruleset

This file was deleted.

56 changes: 21 additions & 35 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,51 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<Import Condition="Exists('$(MSBuildThisFileDirectory)\Directory.Meta.props')" Project="$(MSBuildThisFileDirectory)\Directory.Meta.props" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DebugType>portable</DebugType>
<PropertyGroup Label="BasePath">
<BaseOutputPath>$(MSBuildThisFileDirectory)bin\$(MSBuildProjectName)\</BaseOutputPath>
<BaseIntermediateOutputPath>$(MSBuildThisFileDirectory)obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
</PropertyGroup>

<PropertyGroup>
<TargetFramework Condition="'$(BuildDefaultTargetFramework)'!=''">netstandard2.0</TargetFramework>
<LangVersion>8</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DebugType Condition=" '$(DebugType)' == '' ">portable</DebugType>
</PropertyGroup>

<PropertyGroup>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
<PropertyGroup Label="BasePath">
<BaseOutputPath>$(MSBuildThisFileDirectory)bin\</BaseOutputPath>
<BaseIntermediateOutputPath>$(MSBuildThisFileDirectory)obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
<PublishDir>$(MSBuildThisFileDirectory)publish\$(MSBuildProjectName)\</PublishDir>
</PropertyGroup>
<PropertyGroup>
<Features>IOperation</Features>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<Import Label="Version"
Condition="
'$(VersionPrefix)'=='' and
Exists('$(MSBuildThisFileDirectory)Directory.Version.props')
"
Project="$(MSBuildThisFileDirectory)Directory.Version.props"/>
<PropertyGroup Label="Version" Condition="'$(VersionPrefix)'!=''">
<FileVersion>$(VersionPrefix)</FileVersion>
<AssemblyVersion>$(FileVersion)</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Label="CI Build" Condition="'$(BuildId)'!='' and !('$(Configuration)'=='Release' and ($(BuildSourceBranch.StartsWith('refs/heads/rel/')) or $(BuildSourceBranch.StartsWith('rel/'))))">
<VersionSuffix Condition="'$(VersionSuffix)'!=''">$(VersionSuffix)-build$(BuildId)</VersionSuffix>
<VersionSuffix Condition="'$(VersionSuffix)'==''">build$(BuildId)</VersionSuffix>
</PropertyGroup>
<PropertyGroup Label="CI Build" Condition="'$(BuildId)'!=''">
<AssemblyVersion Condition="'$(FileVersion)'!=''">$(FileVersion).$(BuildId)</AssemblyVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.DotNet.Analyzers.Compatibility" Version="0.2.12-alpha" PrivateAssets="All" />
</ItemGroup>
<ItemGroup Label="SourceLink">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Nullable" Version="1.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
<PrivateAssets>All</PrivateAssets>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
123 changes: 97 additions & 26 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,30 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<!--
Usage of the TargetFrameworkIdentifier and _TargetFrameworkVersionWithoutV
require the .NET Core SDK props files to have been included.
Therefore, the following Nullable Reference Type settings are moved to
the .targets file instead.
-->
<PropertyGroup Label="Nullable Reference Types">
<LangVersion>8</LangVersion>
<Nullable Condition="
('$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(_TargetFrameworkVersionWithoutV)' &gt;= '3.0') OR
('$(TargetFrameworkIdentifier)' == '.NETStandard' AND '$(_TargetFrameworkVersionWithoutV)' &gt;= '2.1')
">enable</Nullable>
<Nullable Condition="!(
('$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(_TargetFrameworkVersionWithoutV)' &gt;= '3.0') OR
('$(TargetFrameworkIdentifier)' == '.NETStandard' AND '$(_TargetFrameworkVersionWithoutV)' &gt;= '2.1')
)">annotations</Nullable>
<Target Name="InitializePublishDirFromSourceControlManager"
DependsOnTargets="InitializeSourceControlInformation"
BeforeTargets="PrepareForPublish">
<ItemGroup>
<_SourceRootReverseOrder Include="@(SourceRoot->HasMetadata('SourceControl')->Reverse())" />
</ItemGroup>

<PropertyGroup>
<PublishDir>%(_SourceRootReverseOrder.Identity)publish\$(MSBuildProjectName)\</PublishDir>
</PropertyGroup>

<PropertyGroup>
<PublishDir>$(PublishDir)$(Configuration)\</PublishDir>
<PublishDir Condition=" '$(PlatformName)' != '' and '$(PlatformName)' != 'AnyCPU' "
>$(PublishDir)$(PlatformName)\</PublishDir>
<PublishDir Condition=" '$(TargetFramework)' != '' "
>$(PublishDir)$(TargetFramework)\</PublishDir>
<PublishDir Condition=" '$(RuntimeIdentifier)' != '' "
>$(PublishDir)$(RuntimeIdentifier)\</PublishDir>
</PropertyGroup>
</Target>

<Target Name="AddBuildIdToInformationalVersion"
Condition=" '$(BuildId)' != ''"
DependsOnTargets="GetAssemblyVersion"
BeforeTargets="AddSourceRevisionToInformationalVersion"
>
<PropertyGroup Condition="!(
'$(Configuration)' == 'Release' AND (
$(BuildSourceBranch.StartsWith('refs/heads/releases/')) OR
$(BuildSourceBranch.StartsWith('releases/'))
))">
<!-- Follow SemVer 2.0 rules -->
<_InformationalVersionContainsHyphen>false</_InformationalVersionContainsHyphen>
<_InformationalVersionContainsHyphen Condition="$(InformationalVersion.Contains('-'))">true</_InformationalVersionContainsHyphen>

<InformationalVersion Condition="!$(_InformationalVersionContainsHyphen)">$(InformationalVersion)-build$(BuildId)</InformationalVersion>
<InformationalVersion Condition="$(_InformationalVersionContainsHyphen)">$(InformationalVersion).build$(BuildId)</InformationalVersion>
</PropertyGroup>
</Target>

<Target Name="SetPackageVersionToInformationalVersion"
Condition=" '$(BuildId)' != ''"
DependsOnTargets="AddBuildIdToInformationalVersion"
BeforeTargets="AddSourceRevisionToInformationalVersion"
>
<PropertyGroup>
<PackageVersion>$(InformationalVersion)</PackageVersion>
</PropertyGroup>
</Target>

<Target Name="AddBuildIdPropertyToAssemblyVersionAndTruncateFileVersion"
Condition=" '$(BuildId)' != ''"
DependsOnTargets="GetAssemblyVersion"
BeforeTargets="GetAssemblyAttributes"
>
<PropertyGroup>
<FileVersion>$([System.Version]::Parse('$(AssemblyVersion)').ToString(3))</FileVersion>
<AssemblyVersion>$([System.Version]::Parse('$(AssemblyVersion)').ToString(3)).$(BuildId)</AssemblyVersion>
</PropertyGroup>
</Target>

<Target Name="AddSourceRootLicenseFileToNugetPackageOutput"
DependsOnTargets="InitializeSourceControlInformation"
BeforeTargets="_GetPackageFiles;GenerateNuspec"
>
<ItemGroup>
<_SourceRootReverseOrder Include="@(SourceRoot->HasMetadata('SourceControl')->Reverse())" />
</ItemGroup>

<PropertyGroup>
<_SourceRootLicenseFilePath>%(_SourceRootReverseOrder.Identity)LICENSE</_SourceRootLicenseFilePath>
</PropertyGroup>
<PropertyGroup Condition="Exists('$(_SourceRootLicenseFilePath)')">
<PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>
<ItemGroup Condition="Exists('$(_SourceRootLicenseFilePath)')">
<None Include="$(_SourceRootLicenseFilePath)" Pack="true">
<PackagePath></PackagePath>
</None>
</ItemGroup>
</Target>

<PropertyGroup>
<GenerateNuspecDependsOn>InferProjectUrlFromGitHubRepositoryUrl;$(GenerateNuspecDependsOn)</GenerateNuspecDependsOn>
</PropertyGroup>
<ItemGroup Label="Nullable helper library for Pre-.NET Standard 2.1"
Condition="!(
('$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(_TargetFrameworkVersionWithoutV)' &gt;= '3.0') OR
('$(TargetFrameworkIdentifier)' == '.NETStandard' AND '$(_TargetFrameworkVersionWithoutV)' &gt;= '2.1')
)">
<PackageReference Include="Nullable" Version="1.2.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<Target Name="InferProjectUrlFromGitHubRepositoryUrl"
DependsOnTargets="InitializeSourceControlInformation"
Condition="'$(SourceControlInformationFeatureSupported)' == 'true'">
<PropertyGroup Condition="
'$(RepositoryUrl)' == '' and
'$(PublishRepositoryUrl)' == 'true'
">
<PackageProjectUrl Condition=" $(PrivateRepositoryUrl.EndsWith('.git'))">$(PrivateRepositoryUrl.Substring(0, $(PrivateRepositoryUrl.LastIndexOf('.git'))))</PackageProjectUrl>
<PackageProjectUrl Condition="!$(PrivateRepositoryUrl.EndsWith('.git'))">$(PrivateRepositoryUrl)</PackageProjectUrl>
</PropertyGroup>
</Target>
</Project>
13 changes: 0 additions & 13 deletions Directory.Meta.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,5 @@
<Product>TH-NETII .NET Common libraries and extensions</Product>
<Company>TH-NETII Rasch Solutions</Company>
<Copyright>Written by Fredrik Høisæther Rasch, $([System.DateTime]::Now.Year)</Copyright>
<PackageProjectUrl>https://github.com/thnetii/dotnet-common</PackageProjectUrl>
</PropertyGroup>
<PropertyGroup Label="Repository Metadata">
<RepositoryType>git</RepositoryType>
<RepositoryUrl>$(PackageProjectUrl).git</RepositoryUrl>
</PropertyGroup>
<PropertyGroup Label="License">
<PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>
<ItemGroup Label="License">
<None Include="$(MSBuildThisFileDirectory)LICENSE" Pack="true">
<PackagePath></PackagePath>
</None>
</ItemGroup>
</Project>
13 changes: 0 additions & 13 deletions Directory.Version.props

This file was deleted.

7 changes: 2 additions & 5 deletions TH-NETII .NET Common.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28714.193
Expand All @@ -8,13 +8,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.editorconfig = .editorconfig
.gitattributes = .gitattributes
.gitignore = .gitignore
AllRules.ruleset = AllRules.ruleset
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
Directory.Meta.props = Directory.Meta.props
Directory.Nullable.props = Directory.Nullable.props
Directory.Version.props = Directory.Version.props
LICENSE = LICENSE
nuget.config = nuget.config
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{A1768F41-219C-424C-92B8-695477251F6A}"
Expand Down
21 changes: 0 additions & 21 deletions azure-pipelines.yml

This file was deleted.

6 changes: 0 additions & 6 deletions nuget.config

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"commandLineArgs": "[config:Environment=Development]"
}
}
}
}