Skip to content

Commit 0577926

Browse files
committed
Update project structure and move to csproj
1 parent 599786c commit 0577926

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+158
-244
lines changed

.editorconfig

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,42 @@
1-
# http://EditorConfig.org
2-
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
1+
# EditorConfig is awesome:http://EditorConfig.org
32

3+
# top-most EditorConfig file
44
root = true
55

6+
# Don't use tabs for indentation.
67
[*]
7-
charset = utf-8
8-
end_of_line = crlf
9-
indent_size = 2
108
indent_style = space
11-
insert_final_newline = true
12-
trim_trailing_whitespace = true
9+
# (Please don't specify an indent_size here; that has too many unintended consequences.)
1310

14-
[*.md]
11+
# Code files
12+
[*.{cs,csx,vb,vbx}]
1513
indent_size = 4
16-
trim_trailing_whitespace = false
1714

15+
# Xml project files
16+
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
17+
indent_size = 2
18+
19+
# Xml config files
20+
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
21+
indent_size = 2
22+
23+
# JSON files
24+
[*.json]
25+
indent_size = 2
1826

1927
# Dotnet code style settings:
2028
[*.{cs, vb}]
21-
indent_size = 4
22-
29+
# Sort using and Import directives with System.* appearing first
30+
dotnet_sort_system_directives_first = true
2331
# Avoid "this." and "Me." if not necessary
2432
dotnet_style_qualification_for_field = false:suggestion
2533
dotnet_style_qualification_for_property = false:suggestion
2634
dotnet_style_qualification_for_method = false:suggestion
2735
dotnet_style_qualification_for_event = false:suggestion
2836

2937
# Use language keywords instead of framework type names for type references
30-
dotnet_style_predefined_type_for_locals_parameters_members = true:error
31-
dotnet_style_predefined_type_for_member_access = false:error
38+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
39+
dotnet_style_predefined_type_for_member_access = false:suggestion
3240

3341
# Suggest more modern language features when available
3442
dotnet_style_object_initializer = true:suggestion
@@ -39,18 +47,15 @@ dotnet_style_explicit_tuple_names = true:suggestion
3947

4048
# CSharp code style settings:
4149
[*.cs]
42-
# K&R styling
43-
csharp_new_line_before_open_brace = none:error
44-
4550
# Prefer "var" everywhere
46-
csharp_style_var_for_built_in_types = false:error
51+
csharp_style_var_for_built_in_types = false:suggestion
4752
csharp_style_var_when_type_is_apparent = true:suggestion
4853
csharp_style_var_elsewhere = true:suggestion
4954

5055
# Prefer method-like constructs to have a block body
51-
csharp_style_expression_bodied_methods = true:none
52-
csharp_style_expression_bodied_constructors = true:none
53-
csharp_style_expression_bodied_operators = true:none
56+
csharp_style_expression_bodied_methods = false:none
57+
csharp_style_expression_bodied_constructors = false:none
58+
csharp_style_expression_bodied_operators = false:none
5459

5560
# Prefer property-like constructs to have an expression-body
5661
csharp_style_expression_bodied_properties = true:none
@@ -62,4 +67,12 @@ csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
6267
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
6368
csharp_style_inlined_variable_declaration = true:suggestion
6469
csharp_style_throw_expression = true:suggestion
65-
csharp_style_conditional_delegate_call = true:suggestion
70+
csharp_style_conditional_delegate_call = true:suggestion
71+
72+
# Newline settings
73+
csharp_new_line_before_open_brace = false:error
74+
csharp_new_line_before_else = false:error
75+
csharp_new_line_before_catch = false:error
76+
csharp_new_line_before_finally = false:error
77+
csharp_new_line_before_members_in_object_initializers = false:error
78+
csharp_new_line_before_members_in_anonymous_types = false:error

Exceptionless.DateTimeExtensions.sln

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.25420.1
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26228.9
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8F995DD3-2383-4DCF-AE0B-0583C47A7058}"
77
ProjectSection(SolutionItems) = preProject
88
appveyor.yml = appveyor.yml
9-
global.json = global.json
109
README.md = README.md
1110
EndProjectSection
1211
EndProject
13-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Exceptionless.DateTimeExtensions", "src\Exceptionless.DateTimeExtensions\Exceptionless.DateTimeExtensions.xproj", "{2734AB9C-28B7-47E2-96BE-580B48105F41}"
12+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Exceptionless.DateTimeExtensions", "src\Exceptionless.DateTimeExtensions\Exceptionless.DateTimeExtensions.csproj", "{2734AB9C-28B7-47E2-96BE-580B48105F41}"
1413
EndProject
15-
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Exceptionless.DateTimeExtensions.Tests", "tests\Exceptionless.DateTimeExtensions.Tests\Exceptionless.DateTimeExtensions.Tests.xproj", "{C5573F21-192A-43F5-9AA1-C90534D381AC}"
14+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Exceptionless.DateTimeExtensions.Tests", "test\Exceptionless.DateTimeExtensions.Tests\Exceptionless.DateTimeExtensions.Tests.csproj", "{54BC6486-752C-4B9F-864A-FFCB7568A8E4}"
1615
EndProject
1716
Global
1817
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -24,10 +23,10 @@ Global
2423
{2734AB9C-28B7-47E2-96BE-580B48105F41}.Debug|Any CPU.Build.0 = Debug|Any CPU
2524
{2734AB9C-28B7-47E2-96BE-580B48105F41}.Release|Any CPU.ActiveCfg = Release|Any CPU
2625
{2734AB9C-28B7-47E2-96BE-580B48105F41}.Release|Any CPU.Build.0 = Release|Any CPU
27-
{C5573F21-192A-43F5-9AA1-C90534D381AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
28-
{C5573F21-192A-43F5-9AA1-C90534D381AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
29-
{C5573F21-192A-43F5-9AA1-C90534D381AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
30-
{C5573F21-192A-43F5-9AA1-C90534D381AC}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{54BC6486-752C-4B9F-864A-FFCB7568A8E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{54BC6486-752C-4B9F-864A-FFCB7568A8E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{54BC6486-752C-4B9F-864A-FFCB7568A8E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{54BC6486-752C-4B9F-864A-FFCB7568A8E4}.Release|Any CPU.Build.0 = Release|Any CPU
3130
EndGlobalSection
3231
GlobalSection(SolutionProperties) = preSolution
3332
HideSolutionNode = FALSE

License.txt

Lines changed: 0 additions & 9 deletions
This file was deleted.

appveyor.yml

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,43 @@
11
version: 3.2.{build}
2-
os: Visual Studio 2015
3-
2+
os: Visual Studio 2017
3+
clone_depth: 2
44
configuration: Release
55

66
pull_requests:
77
do_not_increment_build_number: true
88

99
init:
10-
- git config --global core.autocrlf true
10+
- git config --global core.autocrlf input
1111
- ps: $env:GIT_HASH=$env:APPVEYOR_REPO_COMMIT.Substring(0, 10)
12-
13-
assembly_info:
14-
patch: true
15-
file: AssemblyInfo.*
16-
assembly_version: "{version}.0"
17-
assembly_file_version: "{version}.0"
18-
assembly_informational_version: "{version}.0 $(GIT_HASH)"
12+
- ps: If ("$env:APPVEYOR_REPO_BRANCH" -ne "master") { $env:VERSION_SUFFIX="pre" }
13+
- ps: 'Write-Output "Version: $($env:APPVEYOR_BUILD_VERSION)-$($env:VERSION_SUFFIX)"'
1914

2015
before_build:
21-
- ps: >-
22-
Get-ChildItem -Path .\ -Filter project.json -Recurse -Name |
23-
ForEach {
24-
$content = Get-Content "$_"
25-
$content = $content.Replace("99.99.99-dev", "$($env:APPVEYOR_BUILD_VERSION)")
26-
Set-Content "$_" $content -Encoding UTF8
27-
}
28-
- dotnet restore -v Minimal
16+
- ps: .\build\Set-BuildVersion -Version $env:APPVEYOR_BUILD_VERSION -Suffix $env:VERSION_SUFFIX
17+
- appveyor-retry dotnet restore -v Minimal
2918

3019
build_script:
31-
- dotnet pack "src\Exceptionless.DateTimeExtensions" -c Release -o artifacts
32-
33-
test_script:
34-
- dotnet test "tests\Exceptionless.DateTimeExtensions.Tests"
20+
- dotnet build -c Release
21+
- dotnet pack -c Release
3522

3623
artifacts:
3724
- path: artifacts\*.nupkg
3825
name: ReleaseArtifacts
26+
27+
nuget:
28+
project_feed: true
29+
disable_publish_on_pr: true
3930

4031
deploy:
4132
- provider: Environment
4233
name: NuGet
4334
on:
44-
branch: master
35+
appveyor_repo_tag: true
4536
- provider: GitHub
4637
auth_token:
4738
secure: 0s81q7bweVLTFSOKxnIhan7el6bIFiN8HJ1kYJzOkeFXX7wgGSq9bs/rV53X9qpf
4839
draft: true
4940
on:
50-
branch: master
5141
appveyor_repo_tag: true
5242

5343
notifications:

build/Set-BuildVersion.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Param(
2+
[string]$Version,
3+
[string]$Suffix
4+
)
5+
6+
Push-Location $PSScriptRoot
7+
8+
[xml]$versionXml = Get-Content .\version.props
9+
$versionXml.Project.PropertyGroup.VersionPrefix = $Version
10+
$versionXml.Project.PropertyGroup.VersionSuffix = $Suffix
11+
$versionXml.Save("$PSScriptRoot\version.props")
12+
13+
Pop-Location

build/common.props

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<Project ToolsVersion="15.0">
2+
<Import Project="version.props" />
3+
4+
<PropertyGroup>
5+
<ProjectParentDirectory>$([System.IO.Path]::GetDirectoryName('$(MSBuildProjectDirectory)'))</ProjectParentDirectory>
6+
<ProjectParentDirectoryName>$([System.IO.Path]::GetFileName('$(ProjectParentDirectory)'))</ProjectParentDirectoryName>
7+
</PropertyGroup>
8+
9+
<Import Project="sourcelink.props" Condition="'$(ProjectParentDirectoryName)' == 'src'" />
10+
11+
<PropertyGroup>
12+
<Product>Exceptionless DateTime Extensions</Product>
13+
<Description>DateTimeRange and various DateTime and TimeSpan extension methods.</Description>
14+
<Copyright>Copyright (c) 2017 Exceptionless. All rights reserved.</Copyright>
15+
<Authors>bniemyjski;ejsmith</Authors>
16+
<NoWarn>$(NoWarn);CS1591</NoWarn>
17+
<WarningsAsErrors>true</WarningsAsErrors>
18+
<DebugType>portable</DebugType>
19+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
20+
<PackageOutputPath>$(SolutionDir)\artifacts\</PackageOutputPath>
21+
22+
<PackageReleaseNotes>https://github.com/exceptionless/Exceptionless.DateTimeExtensions/releases</PackageReleaseNotes>
23+
<PackageIconUrl>https://be.exceptionless.io/img/exceptionless-32.png</PackageIconUrl>
24+
<PackageProjectUrl>https://github.com/exceptionless/Exceptionless.DateTimeExtensions</PackageProjectUrl>
25+
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
26+
<RepositoryType>git</RepositoryType>
27+
<RepositoryUrl>https://github.com/exceptionless/Exceptionless.DateTimeExtensions</RepositoryUrl>
28+
<VersionSuffix Condition="'$(VersionSuffix)'!='' AND '$(BuildNumber)' != ''">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
29+
</PropertyGroup>
30+
</Project>

build/sourcelink.props

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<DebugType>embedded</DebugType>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageReference Include="SourceLink.Create.GitHub" Version="2.0.1" PrivateAssets="all" />
9+
<DotNetCliToolReference Include="dotnet-sourcelink-git" Version="2.0.1" />
10+
<DotNetCliToolReference Include="dotnet-sourcelink" Version="2.0.1" />
11+
</ItemGroup>
12+
13+
</Project>

build/test.props

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project ToolsVersion="15.0">
2+
<PropertyGroup>
3+
<IsPackable>False</IsPackable>
4+
</PropertyGroup>
5+
6+
<PropertyGroup Condition="$(TargetFramework.StartsWith('netcoreapp'))">
7+
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Foundatio.Logging.Xunit" Version="5.0.1331" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
13+
<PackageReference Include="xunit" Version="2.2.0" />
14+
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
15+
</ItemGroup>
16+
</Project>

build/version.props

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!-- This file may be overwritten by automation. Only values allowed here are VersionPrefix and VersionSuffix. -->
2+
<Project>
3+
<PropertyGroup>
4+
<VersionPrefix>1.0.0</VersionPrefix>
5+
<VersionSuffix>dev</VersionSuffix>
6+
</PropertyGroup>
7+
</Project>

global.json

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<Import Project="..\..\build\common.props" />
3+
<PropertyGroup>
4+
<TargetFrameworks>netstandard1.5;net461</TargetFrameworks>
5+
</PropertyGroup>
6+
</Project>

src/Exceptionless.DateTimeExtensions/Exceptionless.DateTimeExtensions.xproj

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
using System.Resources;
2-
using System.Reflection;
3-
using System.Runtime.CompilerServices;
4-
5-
[assembly: AssemblyTitle("Exceptionless.DateTimeExtensions")]
6-
[assembly: AssemblyDescription("DateTimeRange and various DateTime and TimeSpan extension methods.")]
7-
[assembly: AssemblyConfiguration("")]
8-
[assembly: AssemblyCompany("Exceptionless")]
9-
[assembly: AssemblyProduct("Exceptionless")]
10-
[assembly: AssemblyCopyright("Copyright (c) 2014 Exceptionless. All rights reserved.")]
11-
[assembly: AssemblyTrademark("")]
12-
[assembly: AssemblyCulture("")]
13-
[assembly: NeutralResourcesLanguage("en")]
14-
15-
[assembly: AssemblyVersion("3.0.0.0")]
16-
[assembly: AssemblyFileVersion("3.0.0.0")]
1+
using System.Runtime.CompilerServices;
172

183
[assembly: InternalsVisibleTo("Exceptionless.DateTimeExtensions.Tests")]

0 commit comments

Comments
 (0)