Skip to content

Improve components infrastructure #12024

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions .azure/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ jobs:
/p:OnlyPackPlatformSpecificPackages=true
/bl:artifacts/log/build.win-arm.binlog
$(_BuildArgs)
installNodeJs: false
installJdk: false
artifacts:
- name: Windows_arm_Packages
Expand All @@ -170,7 +169,6 @@ jobs:
-p:OnlyPackPlatformSpecificPackages=true
-bl:artifacts/log/build.macos.binlog
$(_BuildArgs)
installNodeJs: false
artifacts:
- name: MacOS_x64_Packages
path: artifacts/packages/
Expand All @@ -191,7 +189,6 @@ jobs:
jobName: Linux_x64_build
jobDisplayName: "Build: Linux x64"
agentOs: Linux
installNodeJs: false
steps:
- script: ./build.sh
--ci
Expand Down Expand Up @@ -259,7 +256,6 @@ jobs:
-p:OnlyPackPlatformSpecificPackages=true
-bl:artifacts/log/build.linux-arm.binlog
$(_BuildArgs)
installNodeJs: false
artifacts:
- name: Linux_arm_Packages
path: artifacts/packages/
Expand Down Expand Up @@ -289,7 +285,6 @@ jobs:
-p:OnlyPackPlatformSpecificPackages=true
-bl:artifacts/log/build.arm64.binlog
$(_BuildArgs)
installNodeJs: false
artifacts:
- name: Linux_arm64_Packages
path: artifacts/packages/
Expand Down Expand Up @@ -322,7 +317,6 @@ jobs:
-p:OnlyPackPlatformSpecificPackages=true
-bl:artifacts/log/build.musl.binlog
$(_BuildArgs)
installNodeJs: false
artifacts:
- name: Linux_musl_x64_Packages
path: artifacts/packages/
Expand Down Expand Up @@ -355,7 +349,6 @@ jobs:
-p:OnlyPackPlatformSpecificPackages=true
-bl:artifacts/log/build.musl.binlog
$(_BuildArgs)
installNodeJs: false
artifacts:
- name: Linux_musl_arm64_Packages
path: artifacts/packages/
Expand Down Expand Up @@ -489,6 +482,10 @@ jobs:
chmod +x $HOME/bin/jq
echo "##vso[task.prependpath]$HOME/bin"
displayName: Install jq
- task: NodeTool@0
displayName: Install Node 10.x
inputs:
versionSpec: 10.x
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
Expand Down
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ elseif ($Projects) {
}
# When adding new sub-group build flags, add them to this check.
elseif((-not $BuildNative) -and (-not $BuildManaged) -and (-not $BuildNodeJS) -and (-not $BuildInstallers) -and (-not $BuildJava)) {
Write-Warning "No default group of projects was specified, so building the 'managed' subsets of projects. Run ``build.cmd -help`` for more details."
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."

# This goal of this is to pick a sensible default for `build.cmd` with zero arguments.
# Now that we support subfolder invokations of build.cmd, we will be pushing to have build.cmd build everything (-all) by default
Expand Down
4 changes: 4 additions & 0 deletions docs/BuildFromSource.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Building ASP.NET Core on Windows requires:
```ps1
PS> ./eng/scripts/InstallJdk.ps1
```
* Yarn <https://yarnpkg.com> is required if you are building JS components. For example, this may be required for building Components and SignalR.

### macOS/Linux

Expand All @@ -40,6 +41,7 @@ Building ASP.NET Core on macOS or Linux requires:
* Java Development Kit 11 or newer. Either:
* OpenJDK <https://jdk.java.net/>
* Oracle's JDK <https://www.oracle.com/technetwork/java/javase/downloads/index.html>
* Yarn <https://yarnpkg.com> is required if you are building JS components. For example, this may be required for building Components and SignalR.

## Clone the source code

Expand Down Expand Up @@ -129,6 +131,8 @@ On macOS/Linux:
./build.sh
```

By default, only the C# projects are built. Some sub-areas have additional requirements, such as needing Yarn to be installed, before being able to build successfully.

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

Because we are using pre-release versions of .NET Core, you have to set a handful of environment variables
Expand Down
8 changes: 6 additions & 2 deletions eng/Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
$(RepoRoot)src\submodules\**\*.*proj;
$(RepoRoot)src\Installers\**\*.*proj;
$(RepoRoot)src\SignalR\clients\ts\**\node_modules\**\*.*proj;
$(RepoRoot)src\Components\Web.JS\node_modules\**\*.*proj;
$(RepoRoot)src\Components\Blazor\Templates\src\content\**\*.*proj;
$(RepoRoot)src\ProjectTemplates\Web.ProjectTemplates\content\**\*.csproj;
$(RepoRoot)src\ProjectTemplates\Web.ProjectTemplates\content\**\*.fsproj;
Expand Down Expand Up @@ -101,14 +102,15 @@
<ProjectToBuild Condition=" '$(BuildNative)' == 'true'" Include="@(NativeProjects)" Exclude="@(ProjectToExclude)" />
<ProjectToExclude Condition=" '$(BuildNative)' != 'true'" Include="@(NativeProjects)" />

<NodeJsProjectsForManagedProjects Include="$(RepoRoot)src\Components\Web.JS\Microsoft.AspNetCore.Components.Web.JS.npmproj" RestoreInParallel="false"/>
<NodeJsProjects Include="
$(RepoRoot)src\SignalR\**\*.npmproj;
$(RepoRoot)src\Middleware\**\*.npmproj;
"
RestoreInParallel="false"
Exclude="@(ProjectToExclude)" />

<ProjectToBuild Condition=" '$(BuildNodeJS)' == 'true'" Include="@(NodeJsProjects)" Exclude="@(ProjectToExclude)" />
<ProjectToBuild Condition=" '$(BuildNodeJS)' == 'true'" Include="@(NodeJsProjects);@(NodeJsProjectsForManagedProjects)" Exclude="@(ProjectToExclude)" />
<ProjectToExclude Condition=" '$(BuildNodeJS)' != 'true'" Include="@(NodeJsProjects)" />

<JavaProjects Include="$(RepoRoot)src\SignalR\**\*.javaproj"
Expand Down Expand Up @@ -156,8 +158,10 @@
$(RepoRoot)**\bin\**\*;
$(RepoRoot)**\obj\**\*;" />

<ProjectToBuild Condition=" '$(BuildManaged)' == 'true'" Include="@(DotNetProjects)" Exclude="@(ProjectToExclude)" />
<ProjectToBuild Condition=" '$(BuildManaged)' == 'true'" Include="@(NodeJsProjectsForManagedProjects);@(DotNetProjects)" Exclude="@(ProjectToExclude)" />
<ProjectToExclude Condition=" '$(BuildManaged)' != 'true'" Include="@(DotNetProjects)" />

<ProjectToExclude Condition=" '$(BuildManaged)' != 'true' and '$(BuildNodeJS)' != 'true'" Include="@(NodeJsProjectsForManagedProjects)" />
</ItemGroup>
</Otherwise>
</Choose>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<ItemGroup>
<Reference Include="Microsoft.AspNetCore.Blazor" />
<ProjectReference Include="$(RepoRoot)src\Components\Web.JS\Microsoft.AspNetCore.Components.Web.JS.npmproj" ReferenceOutputAssemblies="false" />
</ItemGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@

<ItemGroup>
<Reference Include="Microsoft.AspNetCore.Blazor" />
<ProjectReference Include="$(RepoRoot)src\Components\Web.JS\Microsoft.AspNetCore.Components.Web.JS.npmproj" ReferenceOutputAssemblies="false" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="$(RepoRoot)src\Components\Web.JS\Microsoft.AspNetCore.Components.Web.JS.npmproj" ReferenceOutputAssemblies="false" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
<ItemGroup>
<Reference Include="Microsoft.AspNetCore.Blazor" />
<Reference Include="Microsoft.AspNetCore.Blazor.HttpClient" />
<ProjectReference Include="$(RepoRoot)src\Components\Web.JS\Microsoft.AspNetCore.Components.Web.JS.npmproj" ReferenceOutputAssemblies="false" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
<Reference Include="Microsoft.Extensions.Caching.Memory" />
<Reference Include="Microsoft.Extensions.FileProviders.Composite" />
<Reference Include="Microsoft.Extensions.FileProviders.Embedded" />

<ProjectReference Include="..\..\Web.JS\Microsoft.AspNetCore.Components.Web.JS.npmproj" />
</ItemGroup>

<PropertyGroup>
Expand Down Expand Up @@ -51,12 +53,7 @@
</ItemGroup>

<PropertyGroup>
<!--
We check in the Release / Production build of blazor.*.js, but not the Debug builds. Consequently the former is always available to embed, the latter is only available
if Web.JS was built locally. Use the Debug build when available and building in Debug configuration.
-->
<BlazorServerJSFile>..\..\Web.JS\dist\Release\blazor.server.js</BlazorServerJSFile>
<BlazorServerJSFile Condition="'$(Configuration)' == 'Debug' AND Exists('..\..\Web.JS\dist\Debug\blazor.server.js')">..\..\Web.JS\dist\Debug\blazor.server.js</BlazorServerJSFile>
<BlazorServerJSFile>..\..\Web.JS\dist\$(Configuration)\blazor.server.js</BlazorServerJSFile>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Web.JS/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules/
dist/Debug/
dist/
3 changes: 0 additions & 3 deletions src/Components/Web.JS/dist/.gitattributes

This file was deleted.

15 changes: 0 additions & 15 deletions src/Components/Web.JS/dist/Release/blazor.server.js

This file was deleted.

1 change: 0 additions & 1 deletion src/Components/Web.JS/dist/Release/blazor.webassembly.js

This file was deleted.

18 changes: 17 additions & 1 deletion src/Components/build.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
@ECHO OFF
SET RepoRoot=%~dp0..\..
%RepoRoot%\build.cmd -projects %~dp0**\*.*proj "/p:EnforceE2ETestPrerequisites=true" %*

REM Building Web.JS first explicitly to workaround ordering issues between csproj and npmproj.
ECHO Building Web.JS
CALL %RepoRoot%\build.cmd -projects %~dp0Web.JS\Microsoft.AspNetCore.Components.Web.JS.npmproj "/p:EnforceE2ETestPrerequisites=true" %*

IF %ERRORLEVEL% NEQ 0 (
EXIT /b %ErrorLevel%
)

ECHO Building Components
CALL %RepoRoot%\build.cmd -projects %~dp0**\*.*proj "/p:EnforceE2ETestPrerequisites=true" %*

IF %ERRORLEVEL% NEQ 0 (
EXIT /b %ErrorLevel%
)

ECHO Components successfully built!
2 changes: 1 addition & 1 deletion src/Shared/E2ETesting/E2ETesting.targets
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Importance="High"
Text="Prerequisites were not enforced at build time. Running Yarn or the E2E tests might fail as a result. Check /src/Shared/E2ETesting/Readme.md for instructions." />

<Yarn Command="install --mutex network" />
<Yarn Command="install --mutex network" Condition="'$(EnforceE2ETestPrerequisites)' == 'true'"/>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WIP, I think this will break some dev workflows. Don't check this in yet.

</Target>

<Target
Expand Down