Skip to content

Commit 17dc254

Browse files
authored
Merge branch 'master' into 12872-work
2 parents c53e177 + 8c02467 commit 17dc254

File tree

385 files changed

+9282
-3373
lines changed

Some content is hidden

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

385 files changed

+9282
-3373
lines changed

.azure/pipelines/ci.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ variables:
2929
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
3030
- name: _BuildArgs
3131
value: ''
32+
3233
jobs:
34+
# Code check
3335
- template: jobs/default-build.yml
3436
parameters:
3537
jobName: Code_check
@@ -38,6 +40,10 @@ jobs:
3840
steps:
3941
- powershell: ./eng/scripts/CodeCheck.ps1 -ci
4042
displayName: Run eng/scripts/CodeCheck.ps1
43+
artifacts:
44+
- name: Code_Check_Logs
45+
path: artifacts/log/
46+
publishOnError: true
4147

4248
# Build Windows (x64/x86)
4349
- template: jobs/default-build.yml
@@ -171,6 +177,7 @@ jobs:
171177
-bl:artifacts/log/build.macos.binlog
172178
$(_BuildArgs)
173179
installNodeJs: false
180+
installJdk: false
174181
artifacts:
175182
- name: MacOS_x64_Packages
176183
path: artifacts/packages/
@@ -191,7 +198,6 @@ jobs:
191198
jobName: Linux_x64_build
192199
jobDisplayName: "Build: Linux x64"
193200
agentOs: Linux
194-
installNodeJs: false
195201
steps:
196202
- script: ./build.sh
197203
--ci
@@ -211,6 +217,7 @@ jobs:
211217
--arch x64 \
212218
--build-installers \
213219
--no-build-deps \
220+
--no-build-nodejs \
214221
-p:OnlyPackPlatformSpecificPackages=true \
215222
-p:BuildRuntimeArchive=false \
216223
-p:LinuxInstallerType=deb \
@@ -224,12 +231,15 @@ jobs:
224231
--arch x64 \
225232
--build-installers \
226233
--no-build-deps \
234+
--no-build-nodejs \
227235
-p:OnlyPackPlatformSpecificPackages=true \
228236
-p:BuildRuntimeArchive=false \
229237
-p:LinuxInstallerType=rpm \
230238
-bl:artifacts/log/build.rpm.binlog \
231239
$(_BuildArgs)
232240
displayName: Build RPM installers
241+
installNodeJs: false
242+
installJdk: false
233243
artifacts:
234244
- name: Linux_x64_Packages
235245
path: artifacts/packages/
@@ -260,6 +270,7 @@ jobs:
260270
-bl:artifacts/log/build.linux-arm.binlog
261271
$(_BuildArgs)
262272
installNodeJs: false
273+
installJdk: false
263274
artifacts:
264275
- name: Linux_arm_Packages
265276
path: artifacts/packages/
@@ -290,6 +301,7 @@ jobs:
290301
-bl:artifacts/log/build.arm64.binlog
291302
$(_BuildArgs)
292303
installNodeJs: false
304+
installJdk: false
293305
artifacts:
294306
- name: Linux_arm64_Packages
295307
path: artifacts/packages/
@@ -323,6 +335,7 @@ jobs:
323335
-bl:artifacts/log/build.musl.binlog
324336
$(_BuildArgs)
325337
installNodeJs: false
338+
installJdk: false
326339
artifacts:
327340
- name: Linux_musl_x64_Packages
328341
path: artifacts/packages/
@@ -337,7 +350,7 @@ jobs:
337350
parameters:
338351
inputName: Linux_musl_x64
339352

340-
# Build Linux Musl arm64
353+
# Build Linux Musl ARM64
341354
- template: jobs/default-build.yml
342355
parameters:
343356
jobName: Linux_musl_arm64_build
@@ -356,6 +369,7 @@ jobs:
356369
-bl:artifacts/log/build.musl.binlog
357370
$(_BuildArgs)
358371
installNodeJs: false
372+
installJdk: false
359373
artifacts:
360374
- name: Linux_musl_arm64_Packages
361375
path: artifacts/packages/
@@ -499,7 +513,7 @@ jobs:
499513
version: 3.0.x
500514
installationPath: $(DotNetCoreSdkDir)
501515
includePreviewVersions: true
502-
- script: ./eng/scripts/ci-source-build.sh --ci --configuration Release /p:BuildManaged=true
516+
- script: ./eng/scripts/ci-source-build.sh --ci --configuration Release /p:BuildManaged=true /p:BuildNodeJs=false
503517
displayName: Run ci-source-build.sh
504518
- task: PublishBuildArtifacts@1
505519
displayName: Upload logs

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/src/Hosting/ @tratcher @anurse
1515
/src/Http/ @tratcher @jkotalik @anurse
1616
/src/Middleware/ @tratcher @anurse
17-
/src/ProjectTemplates/ @ryanbrandenburg
17+
# /src/ProjectTemplates/ @ryanbrandenburg
1818
/src/Security/ @tratcher @anurse
1919
/src/Servers/ @tratcher @jkotalik @anurse @halter73
2020
/src/Middleware/Rewrite @jkotalik @anurse

NuGet.config

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
<packageSources>
44
<clear />
55
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
6-
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
76
<add key="aspnet-blazor" value="https://dotnetfeed.blob.core.windows.net/aspnet-blazor/index.json" />
87
<add key="aspnet-extensions" value="https://dotnetfeed.blob.core.windows.net/aspnet-extensions/index.json" />
98
<add key="aspnet-entityframeworkcore" value="https://dotnetfeed.blob.core.windows.net/aspnet-entityframeworkcore/index.json" />
109
<add key="aspnet-aspnetcore-tooling" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore-tooling/index.json" />
1110
<add key="grpc-nuget-dev" value="https://grpc.jfrog.io/grpc/api/nuget/v3/grpc-nuget-dev" />
11+
<add key="roslyn" value="https://dotnet.myget.org/F/roslyn/api/v3/index.json" />
12+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
13+
<add key="aspnetcore-dev" value="https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json" />
14+
<add key="aspnetcore-tools" value="https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json" />
15+
<add key="roslyn-tools" value="https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json" />
1216
</packageSources>
1317
</configuration>

build.ps1

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,33 @@ elseif ($Projects) {
183183
}
184184
# When adding new sub-group build flags, add them to this check.
185185
elseif((-not $BuildNative) -and (-not $BuildManaged) -and (-not $BuildNodeJS) -and (-not $BuildInstallers) -and (-not $BuildJava)) {
186-
Write-Warning "No default group of projects was specified, so building the 'managed' subsets of projects. Run ``build.cmd -help`` for more details."
186+
Write-Warning "No default group of projects was specified, so building the 'managed' and its dependent subsets of projects. Run ``build.cmd -help`` for more details."
187187

188188
# This goal of this is to pick a sensible default for `build.cmd` with zero arguments.
189189
# Now that we support subfolder invokations of build.cmd, we will be pushing to have build.cmd build everything (-all) by default
190190

191191
$BuildManaged = $true
192192
}
193193

194+
if ($BuildManaged -or ($All -and (-not $NoBuildManaged))) {
195+
if ((-not $BuildNodeJS) -and (-not $NoBuildNodeJS)) {
196+
$node = Get-Command node -ErrorAction Ignore -CommandType Application
197+
198+
if ($node) {
199+
$nodeHome = Split-Path -Parent (Split-Path -Parent $node.Path)
200+
Write-Host -f Magenta "Building of C# project is enabled and has dependencies on NodeJS projects. Building of NodeJS projects is enabled since node is detected in $nodeHome."
201+
}
202+
else {
203+
Write-Host -f Magenta "Building of NodeJS projects is disabled since node is not detected on Path and no BuildNodeJs or NoBuildNodeJs setting is set explicitly."
204+
$NoBuildNodeJS = $true
205+
}
206+
}
207+
208+
if ($NoBuildNodeJS){
209+
Write-Warning "Some managed projects depend on NodeJS projects. Building NodeJS is disabled so the managed projects will fallback to using the output from previous builds. The output may not be correct or up to date."
210+
}
211+
}
212+
194213
if ($BuildInstallers) { $MSBuildArguments += "/p:BuildInstallers=true" }
195214
if ($BuildManaged) { $MSBuildArguments += "/p:BuildManaged=true" }
196215
if ($BuildNative) { $MSBuildArguments += "/p:BuildNative=true" }

build.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,29 @@ elif [ ! -z "$build_projects" ]; then
213213
elif [ -z "$build_managed" ] && [ -z "$build_nodejs" ] && [ -z "$build_java" ] && [ -z "$build_native" ] && [ -z "$build_installers" ]; then
214214
# This goal of this is to pick a sensible default for `build.sh` with zero arguments.
215215
# We believe the most common thing our contributors will work on is C#, so if no other build group was picked, build the C# projects.
216-
__warn "No default group of projects was specified, so building the 'managed' subset of projects. Run ``build.sh --help`` for more details."
216+
__warn "No default group of projects was specified, so building the 'managed' and its dependent subset of projects. Run ``build.sh --help`` for more details."
217217
build_managed=true
218218
fi
219219

220220
if [ "$build_deps" = false ]; then
221221
msbuild_args[${#msbuild_args[*]}]="-p:BuildProjectReferences=false"
222222
fi
223223

224+
if [ "$build_managed" = true ] || (["$build_all" = true ] && [ "$build_managed" != false ]); then
225+
if [ -z "$build_nodejs" ]; then
226+
if [ -x "$(command -v node)" ]; then
227+
__warn "Building of C# project is enabled and has dependencies on NodeJS projects. Building of NodeJS projects is enabled since node is detected on PATH."
228+
else
229+
__warn "Building of NodeJS projects is disabled since node is not detected on Path and no BuildNodeJs or NoBuildNodeJs setting is set explicitly."
230+
build_nodejs=false
231+
fi
232+
fi
233+
234+
if [ "$build_nodejs" = false ]; then
235+
__warn "Some managed projects depend on NodeJS projects. Building NodeJS is disabled so the managed projects will fallback to using the output from previous builds. The output may not be correct or up to date."
236+
fi
237+
fi
238+
224239
# Only set these MSBuild properties if they were explicitly set by build parameters.
225240
[ ! -z "$build_java" ] && msbuild_args[${#msbuild_args[*]}]="-p:BuildJava=$build_java"
226241
[ ! -z "$build_native" ] && msbuild_args[${#msbuild_args[*]}]="-p:BuildNative=$build_native"

docs/BuildFromSource.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ The cause of this problem is that the solution you are using does not include th
9797
```
9898
9999
### Common error: Unable to locate the .NET Core SDK
100-
100+
101101
Executing `.\restore.cmd` or `.\build.cmd` may produce these errors:
102102
103103
> error : Unable to locate the .NET Core SDK. Check that it is installed and that the version specified in global.json (if any) matches the installed version.
104104
> error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.
105105
106106
In most cases, this is because the option _Use previews of the .NET Core SDK_ in VS2019 is not checked. Start Visual Studio, go to _Tools > Options_ and check _Use previews of the .NET Core SDK_ under _Environment > Preview Features_.
107-
107+
108108
## Building with Visual Studio Code
109109
110110
Using Visual Studio Code with this repo requires setting environment variables on command line first.
@@ -138,6 +138,8 @@ On macOS/Linux:
138138
./build.sh
139139
```
140140

141+
By default, all of the C# projects are built. Some C# projects requires NodeJS to be installed to compile JavaScript assets which are then checked in as source. If NodeJS is detected on the path, the NodeJS projects will be compiled as part of building C# projects. If NodeJS is not detected on the path, the JavaScript assets checked in previously will be used instead. To disable building NodeJS projects, specify /p:BuildNodeJs=false on the command line.
142+
141143
### Using `dotnet` on command line in this repo
142144

143145
Because we are using pre-release versions of .NET Core, you have to set a handful of environment variables

eng/Build.props

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
</PropertyGroup>
55

66
<PropertyGroup Condition=" '$(BuildAllProjects)' == 'true' ">
7-
<BuildNative>true</BuildNative>
8-
<BuildManaged>true</BuildManaged>
9-
<BuildNodeJS>true</BuildNodeJS>
10-
<BuildJava>true</BuildJava>
7+
<BuildNative Condition="'$(BuildNative)' == ''">true</BuildNative>
8+
<BuildManaged Condition="'$(BuildManaged)' == ''">true</BuildManaged>
9+
<BuildNodeJS Condition="'$(BuildNodeJS)' == ''">true</BuildNodeJS>
10+
<BuildJava Condition="'$(BuildJava)' == ''">true</BuildJava>
1111
</PropertyGroup>
1212

1313
<!-- These projects are always excluded, even when -projects is specified on command line. -->
1414
<ItemGroup>
15+
<!-- Explicitly excluded projects -->
16+
<ProjectToExclude Include="$(ProjectToExclude)" />
1517

1618
<!-- These projects use 'legacy' csproj, which is not supported by dotnet-msbuild. -->
1719
<ProjectToExclude Include="
@@ -31,6 +33,7 @@
3133
$(RepoRoot)src\submodules\**\*.*proj;
3234
$(RepoRoot)src\Installers\**\*.*proj;
3335
$(RepoRoot)src\SignalR\clients\ts\**\node_modules\**\*.*proj;
36+
$(RepoRoot)src\Components\Web.JS\node_modules\**\*.*proj;
3437
$(RepoRoot)src\Components\Blazor\Templates\src\content\**\*.*proj;
3538
$(RepoRoot)src\ProjectTemplates\Web.ProjectTemplates\content\**\*.csproj;
3639
$(RepoRoot)src\ProjectTemplates\Web.ProjectTemplates\content\**\*.fsproj;
@@ -43,7 +46,6 @@
4346
$(RepoRoot)src\Servers\Kestrel\perf\PlatformBenchmarks\**\*.csproj;
4447
$(RepoRoot)src\SignalR\perf\benchmarkapps\**\*.csproj;
4548
" />
46-
4749
</ItemGroup>
4850

4951
<Choose>
@@ -102,6 +104,7 @@
102104
<ProjectToExclude Condition=" '$(BuildNative)' != 'true'" Include="@(NativeProjects)" />
103105

104106
<NodeJsProjects Include="
107+
$(RepoRoot)src\Components\Web.JS\Microsoft.AspNetCore.Components.Web.JS.npmproj;
105108
$(RepoRoot)src\SignalR\**\*.npmproj;
106109
$(RepoRoot)src\Middleware\**\*.npmproj;
107110
"

eng/PatchConfig.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Later on, this will be checked using this condition:
6565
</PropertyGroup>
6666
<PropertyGroup Condition=" '$(VersionPrefix)' == '2.2.7' ">
6767
<PackagesInPatch>
68+
Microsoft.AspNetCore.Hosting;
6869
</PackagesInPatch>
6970
</PropertyGroup>
7071
</Project>

0 commit comments

Comments
 (0)