Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

Commit

Permalink
#2 adding source link support, adding directory build props and proje…
Browse files Browse the repository at this point in the history
…ct file clean up
  • Loading branch information
alhardy committed Apr 13, 2018
1 parent 10e2de5 commit a9c51d9
Show file tree
Hide file tree
Showing 16 changed files with 93 additions and 57 deletions.
6 changes: 6 additions & 0 deletions Concurrency.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ Microsoft Visual Studio Solution File, Format Version 12.00
VisualStudioVersion = 15.0.26730.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{4EF3D96F-D5C4-4E07-B9BD-34A029C1DFD1}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{34F7982C-486D-480A-BAC8-FC76144C1364}"
ProjectSection(SolutionItems) = preProject
test\Directory.Build.props = test\Directory.Build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3C63709F-CC84-430F-A5DB-B5B4EA4EAD15}"
ProjectSection(SolutionItems) = preProject
Expand Down
9 changes: 9 additions & 0 deletions Concurrency.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_USING_BRACES_STYLE/@EntryValue">ALWAYS_ADD</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_WHILE_BRACES_STYLE/@EntryValue">ALWAYS_ADD</s:String>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_CODE/@EntryValue">1</s:Int64>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSOR_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSORHOLDER_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_ACCESSOR_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_EMBEDDED_STATEMENT_ON_SAME_LINE/@EntryValue">NEVER</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_METHOD_ON_SINGLE_LINE/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_TYPE_CONSTRAINTS_ON_SAME_LINE/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_WHILE_ON_NEW_LINE/@EntryValue">True</s:Boolean>
Expand Down Expand Up @@ -531,9 +535,14 @@
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=NAMESPACE_005FALIAS/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FFIELD/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FRESOURCE/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpAttributeForSingleLineMethodUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpFileLayoutPatternsUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpRenamePlacementToArrangementMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAlwaysTreatStructAsNotReorderableMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002ECSharpPlaceAttributeOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean>
<s:String x:Key="/Default/FilterSettingsManager/AttributeFilterXml/@EntryValue">&lt;data&gt;&lt;AttributeFilter ClassMask="App.Metrics.Core.Internal.AppMetricsExcludeFromCodeCoverage" IsEnabled="True" /&gt;&lt;AttributeFilter ClassMask="App.Metrics.Core.Internal.AppMetricsExcludeFromCodeCoverageAttribute" IsEnabled="True" /&gt;&lt;/data&gt;</s:String>
Expand Down
6 changes: 4 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
version: 1.0.{build}
image: Visual Studio 2017
init:
- git config --global core.autocrlf input
environment:
COVERALLS_REPO_TOKEN:
secure: e5tnQd9sHusBT5ynpURpuJmLboWx6S3S5nE1fAQds4H1mlOTHYfc1dtDrsI8xPel
Expand Down Expand Up @@ -31,8 +33,8 @@ deploy:
skip_symbols: true
symbol_server: https://www.myget.org/F/appmetrics/symbol
install:
- cmd: curl -O https://download.microsoft.com/download/0/F/D/0FD852A4-7EA1-4E2A-983A-0484AC19B92C/dotnet-sdk-2.0.0-win-x64.exe
- cmd: dotnet-sdk-2.0.0-win-x64.exe /install /quiet /norestart /log install.log
- cmd: curl -O https://download.microsoft.com/download/D/7/8/D788D3CD-44C4-487D-829B-413E914FB1C3/dotnet-sdk-2.1.300-preview1-008174-win-x64.exe
- cmd: dotnet-sdk-2.1.300-preview1-008174-win-x64.exe /install /quiet /norestart /log install.log
skip_commits:
files:
- '**/*.md'
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<Import Project="..\..\build\common.props" />

<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.1</TargetFrameworks>
<OutputType>Exe</OutputType>
<ServerGarbageCollection>true</ServerGarbageCollection>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<Import Project="..\..\build\common.props" />

<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.1</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
17 changes: 9 additions & 8 deletions build/common.props
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<Project>
<Import Project="dependencies.props" />
<Import Project="..\version.props" />
<Import Project="dependencies.props" />
<Import Project="..\version.props" />
<PropertyGroup>
<Copyright>Allan Hardy 2016</Copyright>
<Authors>Allan Hardy</Authors>
<NoWarn>$(NoWarn);1701;1702;1705;CS1591;CS1570</NoWarn>
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageIconUrl>https://app-metrics.io/images/logo.png</PackageIconUrl>
Expand All @@ -18,9 +19,9 @@
<GenerateNeutralResourcesLanguageAttribute>false</GenerateNeutralResourcesLanguageAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<CodeAnalysisRuleSet>..\..\AppMetrics.ruleset</CodeAnalysisRuleSet>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)Key.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)Key.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
</PropertyGroup>

<ItemGroup>
Expand All @@ -29,8 +30,8 @@

<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.0.0">
<PrivateAssets>All</PrivateAssets>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"projects": [ "src", "test", "benchmarks" ],
"sdk": {
"version": "2.0.0"
"version": "2.1.300-preview1"
}
}
12 changes: 2 additions & 10 deletions src/App.Metrics.Concurrency/App.Metrics.Concurrency.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\build\common.props" />

<PropertyGroup>
<Description>Provides useful structures for performing efficient concurrent operations. Original Project: https://github.com/etishor/ConcurrencyUtilities, including a port of Java's LongAdder and Striped64 classes</Description>
<AssemblyTitle>App.Metrics.Concurrency</AssemblyTitle>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">netstandard1.1;net45</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">netstandard1.1</TargetFrameworks>
<AssemblyName>App.Metrics.Concurrency</AssemblyName>
<PackageId>App.Metrics.Concurrency</PackageId>
<PackageTags>Concurrency;Atomic</PackageTags>
<!--Required for OpenCover-->
<DebugType>full</DebugType>
<TargetFrameworks>$(AppMetricsBuild)</TargetFrameworks>
<PackageTags>concurrency;atomic</PackageTags>
</PropertyGroup>

</Project>
13 changes: 13 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project>

<Import Project="..\build\common.props" />

<PropertyGroup>
<AppMetricsBuild>netstandard1.1</AppMetricsBuild>
<AppMetricsBuild Condition=" '$(OS)' == 'Windows_NT' ">$(AppMetricsBuild);net45</AppMetricsBuild>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.8.0" PrivateAssets="All" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\build\common.props" />

<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>$(StandardTest)</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand All @@ -15,24 +12,4 @@
<ProjectReference Include="..\..\src\App.Metrics.Concurrency\App.Metrics.Concurrency.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsVersion)" />
<PackageReference Include="xunit" Version="$(XunitVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
<PackageReference Include="System.Threading.Thread" Version="4.3.0" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
<DefineConstants>$(DefineConstants);CLASSIC</DefineConstants>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions test/App.Metrics.Concurrency.Facts/AtomicIntegerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,12 @@ public void Defaults_to_zero()
_num.GetValue().Should().Be(0);
}

#if !NET45
[Fact]
public void Should_have_correct_size()
{
AtomicInteger.SizeInBytes.Should().Be(Marshal.SizeOf<AtomicInteger>());
}
#endif
}
}
14 changes: 6 additions & 8 deletions test/App.Metrics.Concurrency.Facts/AtomicLongTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
// Copyright (c) Allan Hardy. All rights reserved.
// </copyright>

#if !NET45
using System.Runtime.InteropServices;
#endif
using FluentAssertions;
using Xunit;

Expand Down Expand Up @@ -36,10 +38,7 @@ public void Can_get_without_volatile_read_fence_and_ordering()
}

[Fact]
public void Can_be_created_with_value()
{
new AtomicLong(5L).GetValue().Should().Be(5L);
}
public void Can_be_created_with_value() { new AtomicLong(5L).GetValue().Should().Be(5L); }

[Fact]
public void Can_be_decremented()
Expand Down Expand Up @@ -146,15 +145,14 @@ public void Can_set_and_read_value()
}

[Fact]
public void Defaults_to_zero()
{
_num.GetValue().Should().Be(0L);
}
public void Defaults_to_zero() { _num.GetValue().Should().Be(0L); }

#if !NET45
[Fact]
public void Shoul_have_correct_size()
{
AtomicLong.SizeInBytes.Should().Be(Marshal.SizeOf<AtomicLong>());
}
#endif
}
}
2 changes: 2 additions & 0 deletions test/App.Metrics.Concurrency.Facts/PaddedAtomicLongTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,12 @@ public void Defaults_to_zero()
_num.GetValue().Should().Be(0L);
}

#if !NET45
[Fact]
public void Should_have_correct_size()
{
PaddedAtomicLong.SizeInBytes.Should().Be(Marshal.SizeOf<PaddedAtomicLong>());
}
#endif
}
}
4 changes: 4 additions & 0 deletions test/App.Metrics.Concurrency.Facts/VolatileTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
// Copyright (c) Allan Hardy. All rights reserved.
// </copyright>

#if !NET45
using System.Runtime.InteropServices;
#endif
using FluentAssertions;
using Xunit;

Expand All @@ -20,11 +22,13 @@ public void Can_get_and_set_value()
value.GetValue().Should().Be(2.3);
}

#if !NET45
[Fact]
public void Has_correct_size()
{
VolatileDouble.SizeInBytes.Should().Be(Marshal.SizeOf<VolatileDouble>());
}
#endif

[Fact]
public void Can_get_and_set_value_non_volatile()
Expand Down
28 changes: 28 additions & 0 deletions test/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project>
<Import Project="..\build\common.props" />

<PropertyGroup>
<DeveloperBuildTest>netcoreapp2.1</DeveloperBuildTest>
<StandardTest>$(DeveloperBuildTest)</StandardTest>
<StandardTest Condition=" '$(DeveloperBuild)' != 'true' ">$(StandardTest);netcoreapp2.0</StandardTest>
<StandardTest Condition=" '$(DeveloperBuild)' != 'true' AND '$(OS)' == 'Windows_NT' ">$(StandardTest);net461</StandardTest>
</PropertyGroup>

<ItemGroup>
<Content Include="..\xunit.runner.json" Link="xunit.runner.json" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
<PackageReference Include="Moq" Version="$(MoqVersion)" />
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsVersion)" />
<PackageReference Include="FluentAssertions.Json" Version="$(FluentAssertionsJsonVersion)" />
<PackageReference Include="xunit" Version="$(XunitVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions xunit.runner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}

0 comments on commit a9c51d9

Please sign in to comment.