Skip to content

Commit 4034ec2

Browse files
author
John Luo
committed
Check in release JS artifacts
1 parent e8a1607 commit 4034ec2

File tree

9 files changed

+52
-124
lines changed

9 files changed

+52
-124
lines changed

.azure/pipelines/ci.yml

Lines changed: 0 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,6 @@ variables:
3131
value: ''
3232

3333
jobs:
34-
# Build Web.JS
35-
- template: jobs/default-build.yml
36-
parameters:
37-
codeSign: true
38-
jobName: WebJS_build
39-
jobDisplayName: "Build: Web.JS"
40-
agentOs: Linux
41-
steps:
42-
- script: ./build.sh
43-
--ci
44-
--projects $(Build.SourcesDirectory)/src/Components/Web.JS/Microsoft.AspNetCore.Components.Web.JS.npmproj
45-
-bl:artifacts/log/build.linux-x64.binlog
46-
$(_BuildArgs)
47-
displayName: Run build.sh
48-
- publish: src/Components/Web.JS/dist/
49-
artifact: WebJS_Javascript
50-
installJdk: false
51-
artifacts:
52-
- name: WebJS_Logs
53-
path: artifacts/log/
54-
publishOnError: true
55-
5634
# Code check
5735
- template: jobs/default-build.yml
5836
parameters:
@@ -70,8 +48,6 @@ jobs:
7048
# Build Windows (x64/x86)
7149
- template: jobs/default-build.yml
7250
parameters:
73-
dependsOn:
74-
- WebJS_build
7551
codeSign: true
7652
jobName: Windows_build
7753
jobDisplayName: "Build: Windows x64/x86"
@@ -83,10 +59,6 @@ jobs:
8359
- script: "echo ##vso[build.addbuildtag]release-candidate"
8460
condition: and(ne(variables['Build.Reason'], 'PullRequest'), in(variables['DotNetFinalVersionKind'], 'release', 'prerelease'))
8561
displayName: 'Set CI tags'
86-
- task: DownloadPipelineArtifact@2
87-
inputs:
88-
artifact: WebJS_Javascript
89-
path: $(Build.SourcesDirectory)/src/Components/Web.JS/dist/
9062
# !!! NOTE !!! Some of these steps have disabled code signing.
9163
# This is intentional to workaround https://github.com/dotnet/arcade/issues/1957 which always re-submits for code-signing, even
9264
# if they have already been signed. This results in slower builds due to re-submitting the same .nupkg many times for signing.
@@ -164,17 +136,10 @@ jobs:
164136
# Build Windows ARM
165137
- template: jobs/default-build.yml
166138
parameters:
167-
dependsOn:
168-
- WebJS_build
169139
codeSign: true
170140
jobName: Windows_arm_build
171141
jobDisplayName: "Build: Windows ARM"
172142
agentOs: Windows
173-
beforeBuild:
174-
- task: DownloadPipelineArtifact@2
175-
inputs:
176-
artifact: WebJS_Javascript
177-
path: $(Build.SourcesDirectory)/src/Components/Web.JS/dist/
178143
buildArgs:
179144
-arch arm
180145
-sign
@@ -200,16 +165,9 @@ jobs:
200165
# Build MacOS
201166
- template: jobs/default-build.yml
202167
parameters:
203-
dependsOn:
204-
- WebJS_build
205168
jobName: MacOs_x64_build
206169
jobDisplayName: "Build: macOS"
207170
agentOs: macOs
208-
beforeBuild:
209-
- task: DownloadPipelineArtifact@2
210-
inputs:
211-
artifact: WebJS_Javascript
212-
path: $(Build.SourcesDirectory)/src/Components/Web.JS/dist/
213171
buildArgs:
214172
--pack
215173
--all
@@ -237,16 +195,10 @@ jobs:
237195
# Build Linux x64
238196
- template: jobs/default-build.yml
239197
parameters:
240-
dependsOn:
241-
- WebJS_build
242198
jobName: Linux_x64_build
243199
jobDisplayName: "Build: Linux x64"
244200
agentOs: Linux
245201
steps:
246-
- task: DownloadPipelineArtifact@2
247-
inputs:
248-
artifact: WebJS_Javascript
249-
path: $(Build.SourcesDirectory)/src/Components/Web.JS/dist/
250202
- script: ./build.sh
251203
--ci
252204
--arch x64
@@ -305,16 +257,9 @@ jobs:
305257
# Build Linux ARM
306258
- template: jobs/default-build.yml
307259
parameters:
308-
dependsOn:
309-
- WebJS_build
310260
jobName: Linux_arm_build
311261
jobDisplayName: "Build: Linux ARM"
312262
agentOs: Linux
313-
beforeBuild:
314-
- task: DownloadPipelineArtifact@2
315-
inputs:
316-
artifact: WebJS_Javascript
317-
path: $(Build.SourcesDirectory)/src/Components/Web.JS/dist/
318263
buildArgs:
319264
--arch arm
320265
--pack
@@ -343,16 +288,9 @@ jobs:
343288
# Build Linux ARM64
344289
- template: jobs/default-build.yml
345290
parameters:
346-
dependsOn:
347-
- WebJS_build
348291
jobName: Linux_arm64_build
349292
jobDisplayName: "Build: Linux ARM64"
350293
agentOs: Linux
351-
beforeBuild:
352-
- task: DownloadPipelineArtifact@2
353-
inputs:
354-
artifact: WebJS_Javascript
355-
path: $(Build.SourcesDirectory)/src/Components/Web.JS/dist/
356294
buildArgs:
357295
--arch arm64
358296
--all
@@ -381,16 +319,9 @@ jobs:
381319
# Build Linux Musl x64
382320
- template: jobs/default-build.yml
383321
parameters:
384-
dependsOn:
385-
- WebJS_build
386322
jobName: Linux_musl_x64_build
387323
jobDisplayName: "Build: Linux Musl x64"
388324
agentOs: Linux
389-
beforeBuild:
390-
- task: DownloadPipelineArtifact@2
391-
inputs:
392-
artifact: WebJS_Javascript
393-
path: $(Build.SourcesDirectory)/src/Components/Web.JS/dist/
394325
buildScript: ./dockerbuild.sh alpine
395326
buildArgs:
396327
--ci
@@ -422,16 +353,9 @@ jobs:
422353
# Build Linux Musl ARM64
423354
- template: jobs/default-build.yml
424355
parameters:
425-
dependsOn:
426-
- WebJS_build
427356
jobName: Linux_musl_arm64_build
428357
jobDisplayName: "Build: Linux Musl ARM64"
429358
agentOs: Linux
430-
beforeBuild:
431-
- task: DownloadPipelineArtifact@2
432-
inputs:
433-
artifact: WebJS_Javascript
434-
path: $(Build.SourcesDirectory)/src/Components/Web.JS/dist/
435359
buildScript: ./dockerbuild.sh ubuntu-alpine37
436360
buildArgs:
437361
--ci
@@ -463,8 +387,6 @@ jobs:
463387
# Test jobs
464388
- template: jobs/default-build.yml
465389
parameters:
466-
dependsOn:
467-
- WebJS_build
468390
condition: ne(variables['SkipTests'], 'true')
469391
jobName: Windows_Test
470392
jobDisplayName: "Test: Windows Server 2016 x64"
@@ -474,10 +396,6 @@ jobs:
474396
beforeBuild:
475397
- powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1"
476398
displayName: Setup IISExpress test certificates and schema
477-
- task: DownloadPipelineArtifact@2
478-
inputs:
479-
artifact: WebJS_Javascript
480-
path: $(Build.SourcesDirectory)/src/Components/Web.JS/dist/
481399
afterBuild:
482400
- powershell: "& ./build.ps1 -CI -NoBuild -Test /p:RunFlakyTests=true"
483401
displayName: Run Flaky Tests
@@ -492,18 +410,12 @@ jobs:
492410

493411
- template: jobs/default-build.yml
494412
parameters:
495-
dependsOn:
496-
- WebJS_build
497413
condition: ne(variables['SkipTests'], 'true')
498414
jobName: Windows_Templates_Test
499415
jobDisplayName: "Test: Templates - Windows Server 2016 x64"
500416
agentOs: Windows
501417
isTestingJob: true
502418
steps:
503-
- task: DownloadPipelineArtifact@2
504-
inputs:
505-
artifact: WebJS_Javascript
506-
path: $(Build.SourcesDirectory)/src/Components/Web.JS/dist/
507419
- script: ./build.cmd -ci -all -pack
508420
displayName: Build Repo
509421
- script: ./src/ProjectTemplates/build.cmd -ci -pack -NoRestore -NoBuilddeps "/p:RunTemplateTests=true /bl:artifacts/log/template.pack.binlog"
@@ -520,8 +432,6 @@ jobs:
520432

521433
- template: jobs/default-build.yml
522434
parameters:
523-
dependsOn:
524-
- WebJS_build
525435
condition: ne(variables['SkipTests'], 'true')
526436
jobName: MacOs_Test
527437
jobDisplayName: "Test: macOS 10.13"
@@ -531,10 +441,6 @@ jobs:
531441
beforeBuild:
532442
- bash: "./eng/scripts/install-nginx-mac.sh"
533443
displayName: Installing Nginx
534-
- task: DownloadPipelineArtifact@2
535-
inputs:
536-
artifact: WebJS_Javascript
537-
path: $(Build.SourcesDirectory)/src/Components/Web.JS/dist/
538444
afterBuild:
539445
- bash: ./build.sh --ci --pack --no-build --no-restore --no-build-deps "/bl:artifacts/log/packages.pack.binlog"
540446
displayName: Pack Packages (for Template tests)
@@ -553,8 +459,6 @@ jobs:
553459

554460
- template: jobs/default-build.yml
555461
parameters:
556-
dependsOn:
557-
- WebJS_build
558462
condition: ne(variables['SkipTests'], 'true')
559463
jobName: Linux_Test
560464
jobDisplayName: "Test: Ubuntu 16.04 x64"
@@ -566,10 +470,6 @@ jobs:
566470
displayName: Installing Nginx
567471
- bash: "echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p"
568472
displayName: Increase inotify limit
569-
- task: DownloadPipelineArtifact@2
570-
inputs:
571-
artifact: WebJS_Javascript
572-
path: $(Build.SourcesDirectory)/src/Components/Web.JS/dist/
573473
afterBuild:
574474
- bash: ./build.sh --ci --pack --no-build --no-restore --no-build-deps "/bl:artifacts/log/packages.pack.binlog"
575475
displayName: Pack Packages (for Template tests)
@@ -603,10 +503,6 @@ jobs:
603503
chmod +x $HOME/bin/jq
604504
echo "##vso[task.prependpath]$HOME/bin"
605505
displayName: Install jq
606-
- task: NodeTool@0
607-
displayName: Install Node 10.x
608-
inputs:
609-
versionSpec: 10.x
610506
- task: UseDotNet@2
611507
displayName: 'Use .NET Core sdk'
612508
inputs:

.azure/pipelines/helix-test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ jobs:
3636
steps:
3737
- script: ./restore.sh -ci
3838
displayName: Restore
39-
- script: ./build.sh -ci --arch arm64 -test -projects $(Build.SourcesDirectory)/eng/helix/helix.proj /p:IsHelixJob=true /p:BuildAllProjects=true /p:BuildNative=true -bl
39+
- script: ./build.sh -ci --arch arm64 -test --no-build-nodejs -projects $(Build.SourcesDirectory)/eng/helix/helix.proj /p:IsHelixJob=true /p:BuildAllProjects=true /p:BuildNative=true -bl
4040
displayName: Run build.sh helix arm64 target
4141
env:
4242
SYSTEM_ACCESSTOKEN: $(System.AccessToken) # We need to set this env var to publish helix results to Azure Dev Ops
43+
installNodeJs: false
4344
artifacts:
4445
- name: Helix_arm64_logs
4546
path: artifacts/logs/

build.ps1

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,23 @@ elseif((-not $BuildNative) -and (-not $BuildManaged) -and (-not $BuildNodeJS) -a
191191
$BuildManaged = $true
192192
}
193193

194-
if ($BuildManaged -and ($NoBuildNodeJS)) {
195-
Write-Warning "Some managed projects that depend on NodeJS projects will be skipped since building NodeJS is disabled."
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+
}
196211
}
197212

198213
if ($BuildInstallers) { $MSBuildArguments += "/p:BuildInstallers=true" }

build.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,19 @@ if [ "$build_deps" = false ]; then
221221
msbuild_args[${#msbuild_args[*]}]="-p:BuildProjectReferences=false"
222222
fi
223223

224-
if [ "$build_nodejs" = false ] && [ "$build_managed" = true ]; then
225-
__warn "Some managed projects that depend on NodeJS projects will be skipped since building NodeJS is disabled."
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
226237
fi
227238

228239
# Only set these MSBuild properties if they were explicitly set by build parameters.

docs/BuildFromSource.md

Lines changed: 3 additions & 3 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,7 +138,7 @@ 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. To disable building NodeJS projects and all C# projects that depend on them, specify /p:BuildNodeJs=false on the command line.
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.
142142

143143
### Using `dotnet` on command line in this repo
144144

eng/Build.props

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,6 @@
120120
<ProjectToBuild Condition=" '$(BuildJava)' == 'true'" Include="@(JavaProjects)" Exclude="@(ProjectToExclude)" />
121121
<ProjectToExclude Condition=" '$(BuildJava)' != 'true'" Include="@(JavaProjects)" />
122122

123-
<!-- These projects have a transitive dependency on Microsoft.AspNetCore.Components.Web.JS. Exclude these projects if we are not building NodeJS -->
124-
<!-- Do not skip these projects on the CI since we don't want to accidentally miss building artifacts -->
125-
<DotnetProjectsTransitiveNodeJsDependencies Include="
126-
$(RepoRoot)src\Framework\**\*.csproj;
127-
$(RepoRoot)src\Analyzers\Analyzers\test\Microsoft.AspNetCore.Analyzers.Test.csproj;
128-
$(RepoRoot)src\ProjectTemplates\*\*.csproj;
129-
$(RepoRoot)src\ProjectTemplates\testassets\*\*.csproj;
130-
$(RepoRoot)src\Components\**\*.*proj;
131-
$(RepoRoot)src\Mvc\**\*.*proj;" />
132-
<ProjectToExclude Include="@(DotnetProjectsTransitiveNodeJsDependencies)" Condition="'$(BuildNodeJS)' == 'false' and '$(ContinuousIntegrationBuild)' != 'true'" />
133-
134123
<!--
135124
Use caution to avoid deep recursion. If the globbing pattern picks up something which exceeds MAX_PATH,
136125
the entire pattern will silently fail to evaluate correctly.

src/Components/Web.JS/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
node_modules/
2-
dist/
2+
dist/Debug/

src/Components/Web.JS/dist/Release/blazor.server.js

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Components/Web.JS/dist/Release/blazor.webassembly.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)