Skip to content

Commit

Permalink
🚚 Reorganize workspace (#4)
Browse files Browse the repository at this point in the history
Reorganizes the workspace in advance of adding `.esproj` projects.
  • Loading branch information
connorjs authored Jul 28, 2024
1 parent b78fb7c commit 1d86ea9
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 22 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@ Example repository with C# and JS/TS with build orchestration via `dotnet` (`.cs

[![codecov](https://codecov.io/gh/connorjs/dotnet-with-esproj-example/graph/badge.svg?token=QFRYKH8OOY)](https://codecov.io/gh/connorjs/dotnet-with-esproj-example)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=connorjs_dotnet-with-esproj-example&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=connorjs_dotnet-with-esproj-example)

## Directory structure

The workspace (solution) has `client` and `server` directories separated to simplify the build process.
Specifically, they each have their own `Directory.*` files.
Most other configuration files live in the root directory.

The solution view offers an alternative display of the workspace.
It reorganizes the root configuration files into `client`, `server`, and `shared` under the `files` solution folder.
It groups all projects together under the `projects` solution folder (no `client` and `server` separation).
9 changes: 9 additions & 0 deletions Workspace.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project>
<PropertyGroup Condition="'$(CI)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<PropertyGroup>
<WorkspaceRoot>$(MSBuildThisFileDirectory)</WorkspaceRoot>
</PropertyGroup>
</Project>
40 changes: 25 additions & 15 deletions dotnet-with-esproj-example.sln
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
VisualStudioVersion = 17.2.32505.173
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "hello-cs", "libs\hello-cs\hello-cs.csproj", "{CA70F551-74BE-49DB-B5CC-D64C0D321478}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "files", "files", "{7592EEA2-3C6C-4ED0-9EB7-5EC6DBB51DE5}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "root", "root", "{7592EEA2-3C6C-4ED0-9EB7-5EC6DBB51DE5}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "server", "server", "{8CE9A197-C77E-40CB-B19E-97DC0AA5D36E}"
ProjectSection(SolutionItems) = preProject
coverage.runsettings = coverage.runsettings
server\Directory.Build.props = server\Directory.Build.props
server\Directory.Packages.props = server\Directory.Packages.props
global.json = global.json
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "shared", "shared", "{1617285C-95A0-4AF2-9C07-CE02BC254905}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitattributes = .gitattributes
.gitignore = .gitignore
.github\workflows\pipeline.yaml = .github\workflows\pipeline.yaml
ci-build.ps1 = ci-build.ps1
coverage.runsettings = coverage.runsettings
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
global.json = global.json
LICENSE = LICENSE
README.md = README.md
sonar-project.properties = sonar-project.properties
Workspace.props = Workspace.props
LICENSE = LICENSE
ci-build.ps1 = ci-build.ps1
.github\workflows\pipeline.yaml = .github\workflows\pipeline.yaml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libs", "libs", "{2E75741F-092F-4C2C-A182-AAF9F38CEC58}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "projects", "projects", "{2E75741F-092F-4C2C-A182-AAF9F38CEC58}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "hello-cs", "server\hello-cs\hello-cs.csproj", "{CA70F551-74BE-49DB-B5CC-D64C0D321478}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "hello-cs-test", "libs\hello-cs-test\hello-cs-test.csproj", "{2652DC61-0D21-423D-BF0E-FA67ED4A68F7}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "hello-cs-test", "server\hello-cs-test\hello-cs-test.csproj", "{2652DC61-0D21-423D-BF0E-FA67ED4A68F7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -46,5 +54,7 @@ Global
GlobalSection(NestedProjects) = preSolution
{CA70F551-74BE-49DB-B5CC-D64C0D321478} = {2E75741F-092F-4C2C-A182-AAF9F38CEC58}
{2652DC61-0D21-423D-BF0E-FA67ED4A68F7} = {2E75741F-092F-4C2C-A182-AAF9F38CEC58}
{8CE9A197-C77E-40CB-B19E-97DC0AA5D36E} = {7592EEA2-3C6C-4ED0-9EB7-5EC6DBB51DE5}
{1617285C-95A0-4AF2-9C07-CE02BC254905} = {7592EEA2-3C6C-4ED0-9EB7-5EC6DBB51DE5}
EndGlobalSection
EndGlobal
8 changes: 3 additions & 5 deletions Directory.Build.props → server/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<Project>
<PropertyGroup Condition="'$(CI)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)../Workspace.props" />

<!-- MSBuild properties (general) -->
<!-- https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-properties -->
<PropertyGroup>
<!-- Artifacts -->
<UseArtifactsOutput>true</UseArtifactsOutput>
<ArtifactsPath>$(WorkspaceRoot)artifacts</ArtifactsPath>
</PropertyGroup>

<!-- MSBuild properties (for .NET) -->
Expand Down Expand Up @@ -38,7 +36,7 @@

<!-- Unit test properties -->
<PropertyGroup Condition="$(MSBuildProjectName.EndsWith('test'))">
<TestingPlatformCommandLineArguments>--coverage --coverage-output $(MSBuildProjectName).cobertura.xml --coverage-settings $(MSBuildThisFileDirectory)coverage.runsettings --results-directory $(MSBuildThisFileDirectory)coverage</TestingPlatformCommandLineArguments>
<TestingPlatformCommandLineArguments>--coverage --coverage-output $(MSBuildProjectName).cobertura.xml --coverage-settings $(WorkspaceRoot)coverage.runsettings --results-directory $(WorkspaceRoot)coverage</TestingPlatformCommandLineArguments>
</PropertyGroup>

<!-- Unit test usings -->
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ sonar.organization=connorjs
## Analysis scope - https://docs.sonarsource.com/sonarcloud/advanced-setup/analysis-scope/

# Define the same root directory for sources and tests
sonar.sources=libs
sonar.tests=libs
sonar.sources=server
sonar.tests=server

# Include test subdirectories and file patterns in test scope
sonar.test.inclusions=**/-test/**/*,**/*.test.*
Expand Down

0 comments on commit 1d86ea9

Please sign in to comment.