Skip to content
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

Changed build to run all npm builds before backend builds. #5433

Merged
merged 1 commit into from
Dec 13, 2022
Merged
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
1 change: 1 addition & 0 deletions Build/Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<PackageReference Include="Cake.Issues.MsBuild" Version="2.0.0-beta0001" />
<PackageReference Include="Cake.Json" Version="7.0.1" />
<PackageReference Include="Cake.XdtTransform" Version="2.0.0" />
<PackageReference Include="Cake.Yarn" Version="0.4.8" />
<PackageReference Include="Dnn.CakeUtils" Version="2.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
Expand Down
18 changes: 1 addition & 17 deletions Build/BuildScripts/AEModule.build
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<Project ToolsVersion="4.0" DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\Yarn.MSBuild.1.22.17\build\Yarn.MSBuild.props" Condition="Exists('..\..\packages\Yarn.MSBuild.1.22.17\build\Yarn.MSBuild.props')" />
<Import Project="..\..\packages\Yarn.MSBuild.1.22.17\build\Yarn.MSBuild.targets" Condition="Exists('..\..\packages\Yarn.MSBuild.1.22.17\build\Yarn.MSBuild.targets')" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we remove the Yarn.MSBuild package entirely?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, if we go with this solution then it is unused...


<PropertyGroup>
<ResourceZipWorkingDirectory>$(MSBuildProjectDirectory)\Package\Resources\admin\personaBar</ResourceZipWorkingDirectory>
<WorkingDirectory>$(RootDirectory)</WorkingDirectory>
</PropertyGroup>

<Target Name="AfterBuild" DependsOnTargets="RunYarn;CopyBin;GetFiles;DebugProject;Package"></Target>
<Target Name="AfterBuild" DependsOnTargets="CopyBin;GetFiles;DebugProject;Package"></Target>
<Target Name="GetFiles">
<ItemGroup>
<PersonaBar-views Include="admin/personaBar/**/*.html" />
Expand All @@ -34,18 +32,4 @@
<Copy SourceFiles="@(PersonaBar-scripts)" DestinationFolder="$(ModuleFolderName)\%(RecursiveDir)" />
<Copy SourceFiles="@(PersonaBar-css)" DestinationFolder="$(ModuleFolderName)\%(RecursiveDir)" />
</Target>
<Target Name="RunYarn" Condition="$(YarnWorkingDirectory.Length) > 0 AND '$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<ItemGroup>
<_YarnWorkingDirectory Include="$(YarnWorkingDirectory)" Exclude="**/node_modules/**/*" />
</ItemGroup>

<MSBuild Projects="$(MSBuildProjectFile)" Targets="RunYarnWorkspace" Properties="WorkingDirectory=%(_YarnWorkingDirectory.RootDir)%(_YarnWorkingDirectory.Directory);" />
</Target>

<Target Name="RunYarnWorkspace">
<Message Importance="high" Text="Running Yarn for $(WorkingDirectory)" />

<Yarn Command="install --no-immutable" WorkingDirectory="$(WorkingDirectory)" IgnoreExitCode="false" Condition="$(WorkingDirectory.Length) > 0" />
<Yarn Command="build" WorkingDirectory="$(WorkingDirectory)" IgnoreExitCode="false" Condition="$(WorkingDirectory.Length) > 0" />
</Target>
</Project>
1 change: 1 addition & 0 deletions Build/Tasks/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace DotNetNuke.Build.Tasks
/// <summary>A cake task to compile the platform.</summary>
[IsDependentOn(typeof(CleanWebsite))]
[IsDependentOn(typeof(RestoreNuGetPackages))]
[IsDependentOn(typeof(BuildNpmPackages))]
public sealed class Build : FrostingTask<Context>
{
/// <inheritdoc/>
Expand Down
32 changes: 32 additions & 0 deletions Build/Tasks/BuildNpmPackages.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
namespace DotNetNuke.Build.Tasks
{
using Cake.Common.IO;
using Cake.Core;
using Cake.Core.IO;
using Cake.Core.Tooling;
using Cake.Frosting;
using Cake.Yarn;

/// <summary>
/// Builds the npm packages for the entire solution.
/// </summary>
public sealed class BuildNpmPackages : FrostingTask<Context>
{
/// <inheritdoc/>
public override void Run(Context context)
{
var yarn = new YarnRunner(
context.FileSystem,
context.Environment,
context.ProcessRunner,
context.Tools);
yarn.Install(c => c
.WithArgument("--no-immutable")
.WithWorkingDirectory(context.Directory("./")));
yarn.RunScript("build");
}
}
}
17 changes: 10 additions & 7 deletions DNN_Platform.sln
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetNuke.Syndication", "D
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetNuke.Library", "DNN Platform\Library\DotNetNuke.Library.csproj", "{6B29ADED-7B56-4484-BEA5-C0E09079535B}"
ProjectSection(ProjectDependencies) = postProject
{CA056730-5759-41F8-A6C1-420F9C0C63E7} = {CA056730-5759-41F8-A6C1-420F9C0C63E7}
{4912F062-F8A8-4F9D-8F8E-244EBEE1ACBD} = {4912F062-F8A8-4F9D-8F8E-244EBEE1ACBD}
{9F2F4076-D434-448F-9CBB-7BF7A9766AB1} = {9F2F4076-D434-448F-9CBB-7BF7A9766AB1}
{03E3AFA5-DDC9-48FB-A839-AD4282CE237E} = {03E3AFA5-DDC9-48FB-A839-AD4282CE237E}
{3CD5F6B8-8360-4862-80B6-F402892DB7DD} = {3CD5F6B8-8360-4862-80B6-F402892DB7DD}
{4912F062-F8A8-4F9D-8F8E-244EBEE1ACBD} = {4912F062-F8A8-4F9D-8F8E-244EBEE1ACBD}
{9F2F4076-D434-448F-9CBB-7BF7A9766AB1} = {9F2F4076-D434-448F-9CBB-7BF7A9766AB1}
{CA056730-5759-41F8-A6C1-420F9C0C63E7} = {CA056730-5759-41F8-A6C1-420F9C0C63E7}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CountryListBox", "DNN Platform\Controls\CountryListBox\CountryListBox.csproj", "{CA056730-5759-41F8-A6C1-420F9C0C63E7}"
Expand Down Expand Up @@ -101,8 +101,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetNuke.Tests.AspNetCCP"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetNuke.Tests.Web", "DNN Platform\Tests\DotNetNuke.Tests.Web\DotNetNuke.Tests.Web.csproj", "{705708E8-6AD9-4021-9B36-EFC83AD42EE7}"
ProjectSection(ProjectDependencies) = postProject
{3D9C3F5F-1D2D-4D89-995B-438055A5E3A6} = {3D9C3F5F-1D2D-4D89-995B-438055A5E3A6}
{3CD5F6B8-8360-4862-80B6-F402892DB7DD} = {3CD5F6B8-8360-4862-80B6-F402892DB7DD}
{3D9C3F5F-1D2D-4D89-995B-438055A5E3A6} = {3D9C3F5F-1D2D-4D89-995B-438055A5E3A6}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FBD3B3FB-C9A6-43D2-8FE7-6A0A19DF0D0C}"
Expand Down Expand Up @@ -224,13 +224,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetNuke.Log4Net", "DNN P
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetNuke.Website", "DNN Platform\Website\DotNetNuke.Website.csproj", "{7F680294-37DA-4901-A19B-AF09794F73D7}"
ProjectSection(ProjectDependencies) = postProject
{A86EBC44-2BC8-4C4A-997B-2708E4AAC345} = {A86EBC44-2BC8-4C4A-997B-2708E4AAC345}
{3D9C3F5F-1D2D-4D89-995B-438055A5E3A6} = {3D9C3F5F-1D2D-4D89-995B-438055A5E3A6}
{4912F062-F8A8-4F9D-8F8E-244EBEE1ACBD} = {4912F062-F8A8-4F9D-8F8E-244EBEE1ACBD}
{03E3AFA5-DDC9-48FB-A839-AD4282CE237E} = {03E3AFA5-DDC9-48FB-A839-AD4282CE237E}
{3CD5F6B8-8360-4862-80B6-F402892DB7DD} = {3CD5F6B8-8360-4862-80B6-F402892DB7DD}
{3D9C3F5F-1D2D-4D89-995B-438055A5E3A6} = {3D9C3F5F-1D2D-4D89-995B-438055A5E3A6}
{4912F062-F8A8-4F9D-8F8E-244EBEE1ACBD} = {4912F062-F8A8-4F9D-8F8E-244EBEE1ACBD}
{5DEAB0D5-0F54-44C9-A167-F48264A04B3D} = {5DEAB0D5-0F54-44C9-A167-F48264A04B3D}
{6B29ADED-7B56-4484-BEA5-C0E09079535B} = {6B29ADED-7B56-4484-BEA5-C0E09079535B}
{A86EBC44-2BC8-4C4A-997B-2708E4AAC345} = {A86EBC44-2BC8-4C4A-997B-2708E4AAC345}
{EE1329FE-FD88-4E1A-968C-345E394EF080} = {EE1329FE-FD88-4E1A-968C-345E394EF080}
EndProjectSection
EndProject
Expand Down Expand Up @@ -500,6 +500,9 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider", "DNN Platform\Providers\CachingProviders\DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider\DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider.csproj", "{2C25580C-A971-4F0B-9F70-436A35C2473E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dnn.Modules.ResourceManager", "DNN Platform\Modules\ResourceManager\Dnn.Modules.ResourceManager.csproj", "{7D61A32C-0F21-453F-A981-BD8E5A3A5304}"
ProjectSection(ProjectDependencies) = postProject
{9CCA271F-CFAA-42A3-B577-7D5CBB38C646} = {9CCA271F-CFAA-42A3-B577-7D5CBB38C646}
EndProjectSection
Comment on lines +503 to +505
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we know what this change is?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have no clue, it was done by Visual Studio...

EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "HtmlEditorProviders", "HtmlEditorProviders", "{682824D2-B21A-4460-AC66-67BFFDD5A559}"
EndProject
Expand Down