Skip to content

Commit d383862

Browse files
authored
Convert SignalR projects to build with ProjectReference (#6457)
Part of #4246 Changes: * Update source code layout to follow the new conventions for this repo * Update project files to use `<Reference>` * Update targets to build NPM packages * Update BuildTools to support custom 'restore' and 'test' targets
1 parent 5d16f97 commit d383862

File tree

434 files changed

+1192
-1183
lines changed

Some content is hidden

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

434 files changed

+1192
-1183
lines changed

.azure/pipelines/jobs/default-build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ jobs:
103103
steps:
104104
- checkout: self
105105
clean: true
106+
- task: NodeTool@0
107+
displayName: Install Node 10.x
108+
inputs:
109+
versionSpec: 10.x
106110
- ${{ if and(eq(parameters.agentOs, 'Windows'), eq(parameters.codeSign, 'true')) }}:
107111
- task: MicroBuildSigningPlugin@1
108112
displayName: Install MicroBuild Signing plugin

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ scripts/tmp/
2828
launchSettings.json
2929
korebuild-lock.txt
3030
.gradle/
31+
src/SignalR/clients/**/dist/

Directory.Build.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
<RepoRelativeProjectDir>$([MSBuild]::MakeRelative($(RepositoryRoot), $(MSBuildProjectDirectory)))</RepoRelativeProjectDir>
2525

26-
<IsBenchmarkProject Condition="$(MSBuildProjectName.EndsWith('.Performance'))">true</IsBenchmarkProject>
26+
<IsBenchmarkProject Condition="$(MSBuildProjectName.EndsWith('.Performance')) OR $(RepoRelativeProjectDir.Contains('perf'))">true</IsBenchmarkProject>
2727
<IsTestProject Condition="$(MSBuildProjectName.EndsWith('Tests')) OR $(MSBuildProjectName.EndsWith('.Test'))">true</IsTestProject>
2828
<IsTestAssetProject Condition="$(RepoRelativeProjectDir.Contains('testassets'))">true</IsTestAssetProject>
2929
<IsSampleProject Condition="$(RepoRelativeProjectDir.Contains('sample'))">true</IsSampleProject>
@@ -48,5 +48,6 @@
4848
<Import Project="eng\targets\Wix.Common.props" Condition="'$(MSBuildProjectExtension)' == '.wixproj'" />
4949
<Import Project="eng\targets\CSharp.Common.props" Condition="'$(MSBuildProjectExtension)' == '.csproj'" />
5050
<Import Project="eng\targets\Cpp.Common.props" Condition="'$(MSBuildProjectExtension)' == '.vcxproj'" />
51+
<Import Project="eng\targets\Npm.Common.props" Condition="'$(MSBuildProjectExtension)' == '.npmproj'" />
5152

5253
</Project>

Directory.Build.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,6 @@
5757
<Import Project="eng\targets\CSharp.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.csproj'" />
5858
<Import Project="eng\targets\FSharp.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.fsproj'" />
5959
<Import Project="eng\targets\Cpp.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.vcxproj'" />
60+
<Import Project="eng\targets\Npm.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.npmproj'" />
6061
<Import Project="eng\targets\ResolveIisReferences.targets" Condition=" '$(MSBuildProjectExtension)' != '.vcxproj' " />
6162
</Project>

build/buildorder.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<RepositoryBuildOrder Include="EntityFrameworkCore" Order="8" />
1111
<RepositoryBuildOrder Include="MvcPrecompilation" Order="15" RootPath="$(RepositoryRoot)src\MvcPrecompilation\" />
1212
<RepositoryBuildOrder Include="Scaffolding" Order="15" />
13-
<RepositoryBuildOrder Include="SignalR" Order="16" RootPath="$(RepositoryRoot)src\SignalR\" />
1413
<RepositoryBuildOrder Include="AuthSamples" Order="16" RootPath="$(RepositoryRoot)src\AuthSamples\" />
1514
<RepositoryBuildOrder Include="Templating" Order="17" RootPath="$(RepositoryRoot)src\Templating\" />
1615
</ItemGroup>

build/dependencies.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<!-- Determined by build tools -->
2121
<InternalAspNetCoreSdkPackageVersion>$(KoreBuildVersion)</InternalAspNetCoreSdkPackageVersion>
2222
<InternalAspNetCoreSiteExtensionSdkPackageVersion>$(KoreBuildVersion)</InternalAspNetCoreSiteExtensionSdkPackageVersion>
23-
<InternalAspNetCoreSdkPackageVersion Condition=" '$(KoreBuildVersion)' == '' ">2.1.7-build-20190104.1</InternalAspNetCoreSdkPackageVersion>
23+
<InternalAspNetCoreSdkPackageVersion Condition=" '$(KoreBuildVersion)' == '' ">2.1.7-build-20190109.2</InternalAspNetCoreSdkPackageVersion>
2424
</PropertyGroup>
2525

2626
<!-- These are package versions that should not be overridden or updated by automation. -->
@@ -137,7 +137,7 @@
137137
<MicrosoftNETCoreApp11PackageVersion>1.1.8</MicrosoftNETCoreApp11PackageVersion>
138138
<MicrosoftNETCoreApp20PackageVersion>2.0.7</MicrosoftNETCoreApp20PackageVersion>
139139
<MicrosoftNETCoreWindowsApiSetsPackageVersion>1.0.1</MicrosoftNETCoreWindowsApiSetsPackageVersion>
140-
<MicrosoftNETTestSdkPackageVersion>15.6.1</MicrosoftNETTestSdkPackageVersion>
140+
<MicrosoftNETTestSdkPackageVersion>15.9.0</MicrosoftNETTestSdkPackageVersion>
141141
<MicrosoftOwinSecurityCookiesPackageVersion>3.0.1</MicrosoftOwinSecurityCookiesPackageVersion>
142142
<MicrosoftOwinSecurityPackageVersion>3.0.1</MicrosoftOwinSecurityPackageVersion>
143143
<MicrosoftOwinTestingPackageVersion>3.0.1</MicrosoftOwinTestingPackageVersion>
@@ -224,7 +224,7 @@
224224
<XunitCorePackageVersion>2.3.1</XunitCorePackageVersion>
225225
<XunitExtensibilityCorePackageVersion>2.3.1</XunitExtensibilityCorePackageVersion>
226226
<XunitExtensibilityExecutionPackageVersion>2.3.1</XunitExtensibilityExecutionPackageVersion>
227-
<XunitPackageVersion>2.3.1</XunitPackageVersion>
227+
<XunitPackageVersion>2.4.0</XunitPackageVersion>
228228
<XunitRunnerVisualStudioPackageVersion>2.4.0</XunitRunnerVisualStudioPackageVersion>
229229
</PropertyGroup>
230230
</Project>

build/repo.props

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,26 @@
4646
<SharedFrameworkName Include="Microsoft.AspNetCore.App" />
4747
</ItemGroup>
4848

49+
<ItemGroup>
50+
<!-- These projects use 'legacy' csproj, which is not supported by dotnet-msbuild. -->
51+
<ProjectToExclude Include="
52+
$(RepositoryRoot)src\Servers\HttpSys\samples\TestClient\TestClient.csproj;
53+
$(RepositoryRoot)src\Middleware\WebSockets\samples\TestServer\TestServer.csproj;
54+
$(RepositoryRoot)src\Identity\samples\NativeWPFClient\NativeWPFClient.csproj;
55+
"
56+
Condition=" '$(MSBuildRuntimeType)' == 'Core' " />
57+
58+
<!-- Exclude the websockets samples for now because they use classic .csproj, which is not yet supported in our build. -->
59+
<ProjectToExclude Include="
60+
$(RepositoryRoot)src\Middleware\WebSockets\samples\**\*.csproj;
61+
$(RepositoryRoot)src\Middleware\NodeServices.Sockets\**\*.csproj;
62+
$(RepositoryRoot)src\Tools\dotnet-watch\test\TestProjects\**\*.csproj;
63+
$(RepositoryRoot)src\Razor\Razor.Design\test\testassets\**\*.*proj;
64+
$(RepositoryRoot)src\SignalR\clients\cpp\**\*.*proj;
65+
$(RepositoryRoot)src\SignalR\clients\ts\**\node_modules\**\*.*proj;
66+
" />
67+
</ItemGroup>
68+
4969
<Choose>
5070
<!-- Project selection can be overridden on the command line by passing in -projects -->
5171
<When Condition="'$(Projects)' != ''">
@@ -59,23 +79,10 @@
5979

6080
<ProjectToExclude Include="@(SamplesProject)" Condition="'$(BuildSamples)' == 'false' "/>
6181

62-
<!-- These projects use 'legacy' csproj, which is not supported by dotnet-msbuild. -->
63-
<ProjectToExclude Include="
64-
$(RepositoryRoot)src\Servers\HttpSys\samples\TestClient\TestClient.csproj;
65-
$(RepositoryRoot)src\Middleware\WebSockets\samples\TestServer\TestServer.csproj;
66-
$(RepositoryRoot)src\Identity\samples\NativeWPFClient\NativeWPFClient.csproj;
67-
"
68-
Condition=" '$(MSBuildRuntimeType)' == 'Core' " />
69-
70-
<!-- Exclude the websockets samples for now because they use classic .csproj, which is not yet supported in our build. -->
71-
<ProjectToExclude Include="
72-
$(RepositoryRoot)src\Middleware\WebSockets\samples\**\*.csproj;
73-
$(RepositoryRoot)src\Middleware\NodeServices.Sockets\**\*.csproj;
74-
$(RepositoryRoot)src\Tools\dotnet-watch\test\TestProjects\**\*.csproj;
75-
$(RepositoryRoot)src\Razor\Razor.Design\test\testassets\**\*.*proj
76-
" />
82+
<ProjectToBuild Condition="'$(SkipSignalRTypescriptClient)' != 'true'"
83+
Include="$(RepositoryRoot)src\SignalR\**\*.npmproj"
84+
Exclude="@(ProjectToExclude)" />
7785

78-
<ProjectToBuild Include="@(NativeProjects)" Condition="'$(OS)' == 'Windows_NT'"/>
7986
<ProjectToBuild Include="
8087
$(RepositoryRoot)src\DefaultBuilder\**\*.*proj;
8188
$(RepositoryRoot)src\Features\JsonPatch\**\*.*proj;
@@ -95,9 +102,11 @@
95102
$(RepositoryRoot)src\Mvc\**\*.*proj;
96103
$(RepositoryRoot)src\Azure\**\*.*proj;
97104
$(RepositoryRoot)src\MusicStore\**\*.*proj;
105+
$(RepositoryRoot)src\SignalR\**\*.csproj;
98106
"
99107
Exclude="
100108
@(ProjectToExclude);
109+
$(RepositoryRoot)**\node_modules\**\*;
101110
$(RepositoryRoot)**\bin\**\*;
102111
$(RepositoryRoot)**\obj\**\*;" />
103112
</ItemGroup>

build/repo.targets

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,6 @@
2727
<GetArtifactInfoDependsOn Condition="'$(_ProjectsOnly)' != 'true'">$(GetArtifactInfoDependsOn);ResolveRepoInfo</GetArtifactInfoDependsOn>
2828
</PropertyGroup>
2929

30-
<PropertyGroup>
31-
<RestoreDependsOn Condition=" '$(SkipNpm)' != 'true' ">$(RestoreDependsOn);RestoreNpm</RestoreDependsOn>
32-
</PropertyGroup>
33-
34-
<Target Name="RestoreNpm" Condition="@(NpmProjectDirectory->Count()) != 0">
35-
<Message Text="Restoring NPM modules" Importance="high" />
36-
37-
<PropertyGroup>
38-
<NpmInstallCommand Condition=" '$(CI)' != 'true' ">install --no-optional</NpmInstallCommand>
39-
<NpmInstallCommand Condition=" '$(CI)' == 'true' ">ci</NpmInstallCommand>
40-
</PropertyGroup>
41-
42-
<Exec Command="npm $(NpmInstallCommand)" WorkingDirectory="%(NpmProjectDirectory.Identity)" Condition=" '%(NpmProjectDirectory.Identity)' != '' " />
43-
</Target>
44-
4530
<Target Name="PrepareOutputPaths">
4631
<MakeDir Directories="$(ArtifactsDir);$(BuildDir)" />
4732
</Target>

build/submodules.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,5 @@
4646
<ItemGroup>
4747
<ShippedRepository Include="EntityFrameworkCore" />
4848
<ShippedRepository Include="MvcPrecompilation" RootPath="$(RepositoryRoot)src\MvcPrecompilation\"/>
49-
<ShippedRepository Include="SignalR" RootPath="$(RepositoryRoot)src\SignalR\" />
5049
</ItemGroup>
5150
</Project>

docs/BuildFromSource.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ Build ASP.NET Core from Source
33

44
Building ASP.NET Core from source allows you tweak and customize ASP.NET Core, and to contribute your improvements back to the project.
55

6-
:warning: We are currently in the middle of restructing our source code. These instructions will likely change rapidly during November and December 2018.
7-
86
See https://github.com/aspnet/AspNetCore/labels/area-infrastructure for known issues and to track ongoing work.
97

108
## Install pre-requistes

0 commit comments

Comments
 (0)