Skip to content

Commit dd2b5ad

Browse files
committed
Re-organize project structure
* Tests now contained in their own directory. * Directory.Build.props files added to easier control settings.
1 parent e522b79 commit dd2b5ad

Some content is hidden

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

60 files changed

+45
-38
lines changed
File renamed without changes.

src/Colore.sln renamed to Colore.sln

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
88
Colore.ruleset = Colore.ruleset
99
EndProjectSection
1010
EndProject
11-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Colore", "Colore\Colore.csproj", "{EA352740-5C39-4964-AFB4-749333FFB509}"
11+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Colore", "src\Colore\Colore.csproj", "{EA352740-5C39-4964-AFB4-749333FFB509}"
1212
EndProject
13-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Colore.Tests", "Colore.Tests\Colore.Tests.csproj", "{D9D36C7F-F9F4-4A0D-808E-B1699D51B532}"
13+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Colore.Tests", "tests\Colore.Tests\Colore.Tests.csproj", "{D9D36C7F-F9F4-4A0D-808E-B1699D51B532}"
1414
EndProject
1515
Global
1616
GlobalSection(SolutionConfigurationPlatforms) = preSolution
File renamed without changes.

Directory.Build.props

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project>
2+
<PropertyGroup>
3+
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
4+
<LangVersion>latest</LangVersion>
5+
<!-- <Nullable>enable</Nullable> -->
6+
<Authors>Sharparam</Authors>
7+
<Copyright>Copyright (c) 2015-2020 by Adam Hellberg and Brandon Scott.</Copyright>
8+
<RepositoryUrl>https://github.com/chroma-sdk/Colore</RepositoryUrl>
9+
<RepositoryType>git</RepositoryType>
10+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
11+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
12+
</PropertyGroup>
13+
14+
<PropertyGroup>
15+
<!-- <WarningsAsErrors>8600,8602,8603,8604,8614,8618,8619,8625,8632</WarningsAsErrors> -->
16+
</PropertyGroup>
17+
</Project>

build.cake

+9-14
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,13 @@ IEnumerable<string> ReadCoverageFilters(string path)
4545
return System.IO.File.ReadLines(path).Where(l => !string.IsNullOrWhiteSpace(l) && !l.StartsWith("#"));
4646
}
4747

48-
if (isTravis)
49-
{
50-
Information("OpenCover does not work on Travis CI, disabling coverage generation");
51-
cover = false;
52-
}
53-
5448
///////////////////////////////////////////////////////////////////////////////
5549
// SETUP / TEARDOWN
5650
///////////////////////////////////////////////////////////////////////////////
5751

52+
var solution = "./Colore.sln";
5853
var mainProject = "./src/Colore/Colore.csproj";
59-
var testProject = "./src/Colore.Tests/Colore.Tests.csproj";
54+
var testProject = "./tests/Colore.Tests/Colore.Tests.csproj";
6055
var frameworks = new List<string>();
6156

6257
GitVersion version = null;
@@ -102,8 +97,8 @@ Setup(ctx =>
10297

10398
Teardown(ctx =>
10499
{
105-
// Executed AFTER the last task.
106-
Information("Finished running tasks.");
100+
// Executed AFTER the last task.
101+
Information("Finished running tasks.");
107102
});
108103

109104
///////////////////////////////////////////////////////////////////////////////
@@ -154,7 +149,7 @@ Task("Clean")
154149
Information("Cleaning output directories");
155150
CleanDirectory("./artifacts");
156151
CleanDirectory("./publish");
157-
DotNetCoreClean("src/");
152+
DotNetCoreClean(solution);
158153
CleanDirectory("./src/Colore.Tests/TestResults");
159154
CreateDirectory("./artifacts/nuget");
160155
});
@@ -163,7 +158,7 @@ Task("Restore")
163158
.IsDependentOn("Clean")
164159
.Does(() =>
165160
{
166-
DotNetCoreRestore("src/");
161+
DotNetCoreRestore(solution);
167162
});
168163

169164
Task("Build")
@@ -192,14 +187,14 @@ Task("Test")
192187
.IsDependentOn("Build")
193188
.Does(() =>
194189
{
195-
var filters = ReadCoverageFilters("./src/coverage-filters.txt");
190+
var filters = ReadCoverageFilters("./tests/coverage-filters.txt");
196191

197192
var settings = new DotNetCoreTestSettings
198193
{
199194
Configuration = configuration,
200195
NoBuild = true,
201196
NoRestore = true,
202-
Settings = "src/coverlet.runsettings",
197+
Settings = "tests/coverlet.runsettings",
203198
ArgumentCustomization = args => args.Append("--collect:\"XPlat Code Coverage\"")
204199
};
205200

@@ -214,7 +209,7 @@ Task("Test")
214209

215210
DotNetCoreTest(testProject, settings);
216211

217-
var testResults = GetFiles("src/Colore.Tests/TestResults/*/coverage.cobertura.xml");
212+
var testResults = GetFiles("tests/Colore.Tests/TestResults/*/coverage.cobertura.xml");
218213
CopyFiles(testResults, "./artifacts");
219214
MoveFile("./artifacts/coverage.cobertura.xml", "./artifacts/coverage.xml");
220215

src/Colore/Colore.csproj

+4-18
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
<DebugSymbols>true</DebugSymbols>
99
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
1010
<GenerateDocumentationFile>True</GenerateDocumentationFile>
11-
<CodeAnalysisRuleset>../Colore.ruleset</CodeAnalysisRuleset>
12-
<Features>IOperation</Features>
13-
<LangVersion>latest</LangVersion>
11+
<CodeAnalysisRuleset>../../Colore.ruleset</CodeAnalysisRuleset>
1412
</PropertyGroup>
1513

1614
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -31,31 +29,23 @@
3129
<PackageVersion>$(NuGetVersion)</PackageVersion>
3230
<PackageId>Colore</PackageId>
3331
<Title>Colore</Title>
34-
<Authors>Sharparam</Authors>
3532
<Description>A C#/.NET library for interacting with Razer's Chroma SDK.</Description>
36-
<Copyright>Copyright (c) 2015-2020 by Adam Hellberg and Brandon Scott.</Copyright>
3733
<PackageLicenseExpression>MIT</PackageLicenseExpression>
3834
<PackageProjectUrl>https://github.com/CoraleStudios/Colore</PackageProjectUrl>
3935
<PackageIcon>icon.png</PackageIcon>
4036
<PackageIconUrl>https://files.sharparam.com/2017/10/31/colore.png</PackageIconUrl>
4137
<PackageTags>razer;chroma;corale;led;light;peripheral;gaming;rgb;wrapper</PackageTags>
4238
<IncludeSymbols>true</IncludeSymbols>
43-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
4439
<IncludeSource>true</IncludeSource>
45-
<RepositoryUrl>https://github.com/chroma-sdk/Colore</RepositoryUrl>
46-
<PublishRepositoryUrl>true</PublishRepositoryUrl>
47-
<RepositoryType>git</RepositoryType>
48-
<PublishRepositoryUrl>true</PublishRepositoryUrl>
4940
<EmbedUntrackedSources>true</EmbedUntrackedSources>
50-
<!-- <AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder> -->
5141
</PropertyGroup>
5242

5343
<ItemGroup>
5444
<None Include="../../images/icon.png" Pack="true" PackagePath="/" />
5545
</ItemGroup>
5646

5747
<ItemGroup>
58-
<AdditionalFiles Include="../stylecop.json">
48+
<AdditionalFiles Include="../../stylecop.json">
5949
<Link>stylecop.json</Link>
6050
</AdditionalFiles>
6151
</ItemGroup>
@@ -80,9 +70,7 @@
8070
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3' Or '$(TargetFramework)' == 'netstandard2.1'">
8171
<PackageReference Include="System.Reflection" Version="4.3.0" />
8272
<PackageReference Include="System.Reflection.Extensions" Version="4.3.0" />
83-
<PackageReference Include="System.Reflection.TypeExtensions">
84-
<Version>4.7.0</Version>
85-
</PackageReference>
73+
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.7.0" />
8674
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
8775
</ItemGroup>
8876

@@ -92,8 +80,6 @@
9280

9381
<ItemGroup Condition="'$(TargetFramework)' == 'net452'">
9482
<Reference Include="Microsoft.CSharp" />
95-
<PackageReference Include="Microsoft.Net.Http">
96-
<Version>2.2.29</Version>
97-
</PackageReference>
83+
<PackageReference Include="Microsoft.Net.Http" Version="2.2.29" />
9884
</ItemGroup>
9985
</Project>

src/Directory.Build.props

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<Project>
2+
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
3+
</Project>
File renamed without changes.

src/Colore.Tests/Colore.Tests.csproj renamed to tests/Colore.Tests/Colore.Tests.csproj

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.1</TargetFramework>
55
<Platforms>AnyCPU;x64;x86</Platforms>
6-
<CodeAnalysisRuleset>../Colore.ruleset</CodeAnalysisRuleset>
7-
<Features>IOperation</Features>
6+
<CodeAnalysisRuleset>../../Colore.ruleset</CodeAnalysisRuleset>
87
<LangVersion>latest</LangVersion>
98
</PropertyGroup>
109

1110
<ItemGroup>
12-
<AdditionalFiles Include="../stylecop.json">
11+
<AdditionalFiles Include="../../stylecop.json">
1312
<Link>stylecop.json</Link>
1413
</AdditionalFiles>
1514
</ItemGroup>
@@ -29,7 +28,7 @@
2928
</ItemGroup>
3029

3130
<ItemGroup>
32-
<ProjectReference Include="..\Colore\Colore.csproj" />
31+
<ProjectReference Include="..\..\src\Colore\Colore.csproj" />
3332
</ItemGroup>
3433

3534
</Project>

tests/Directory.Build.props

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<Project>
2+
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
3+
4+
<PropertyGroup>
5+
<IsPackable>false</IsPackable>
6+
</PropertyGroup>
7+
</Project>
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)