Skip to content

Commit

Permalink
Use GenerateComputedBuildStaticWebAssetsDependsOn
Browse files Browse the repository at this point in the history
  • Loading branch information
volkanceylan committed Dec 26, 2024
1 parent 11cc498 commit d1dedb3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
5 changes: 4 additions & 1 deletion common-features/build/Feature.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
</ItemGroup>
<Import Project="$(SerenitySrc)Serenity.Net.Web\Serenity.Net.Web.targets" Condition="'$(AddAutoRefs)' != 'false'" />
<Import Project="$(SerenitySrc)RestoreNpmPackages.targets" />
<Target Name="CompileProjectTSConfig" AfterTargets="AfterBuild" DependsOnTargets="NpmInstall;RestoreNodeTypes"
<PropertyGroup>
<GenerateComputedBuildStaticWebAssetsDependsOn>CompileProjectTSConfig;$(GenerateComputedBuildStaticWebAssetsDependsOn)</GenerateComputedBuildStaticWebAssetsDependsOn>
</PropertyGroup>
<Target Name="CompileProjectTSConfig" DependsOnTargets="NpmInstall;RestoreNodeTypes"
Condition="Exists('tsconfig.json') And '$(BuildingProject)' != 'false' And '$(DesignTimeBuild)' != 'true'">
<Message Text="Executing TypeScript compiler for $(ProjectName)..." Importance="high"></Message>
<Exec Command="node &quot;$(TSJavaScriptFile.Replace('build\\..\tools\', 'tools\'))&quot; -p ./tsconfig.json" Condition="!Exists('tsbuild.js')" ContinueOnError="true" />
Expand Down
2 changes: 1 addition & 1 deletion packages/corelib/Serenity.Corelib.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<Description>NuGet version of @serenity-is/corelib NPM package</Description>
<PrepareForBuildDependsOn>TSBuild;$(PrepareForBuildDependsOn)</PrepareForBuildDependsOn>
<GenerateComputedBuildStaticWebAssetsDependsOn>TSBuild;$(GenerateComputedBuildStaticWebAssetsDependsOn)</GenerateComputedBuildStaticWebAssetsDependsOn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\sleekgrid\Serenity.SleekGrid.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion packages/sleekgrid
7 changes: 4 additions & 3 deletions serene/src/Serene.Web/Serene.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<RootNamespace>Serene</RootNamespace>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<TypeScriptNoEmitOnError>false</TypeScriptNoEmitOnError>
<GenerateComputedBuildStaticWebAssetsDependsOn>RunTSBuild;$(GenerateComputedBuildStaticWebAssetsDependsOn)</GenerateComputedBuildStaticWebAssetsDependsOn>
<!--#if (IsNotTemplate)-->
<CommonSrc>..\..\..\common-features\src\</CommonSrc>
<SerenitySrc>..\..\..\src\</SerenitySrc>
Expand Down Expand Up @@ -46,12 +47,12 @@
</ItemGroup>
<ItemGroup Condition="'$(UseProjectRefs)' == 'false'">
</ItemGroup>
<Target Name="NpmInstall" BeforeTargets="BeforeBuild" Condition="!Exists('node_modules\@serenity-is\tsbuild\package.json')">
<Message Text="Installing NPM packages..." Importance="high" />
<Target Name="NpmInstall" Condition="!Exists('node_modules\@serenity-is\tsbuild\package.json')">
<Message Text="Installing NPM packages for $(ProjectName)..." Importance="high" />
<Exec Command="npm install" Condition="!Exists('..\..\..\pnpm-workspace.yaml')" />
<Exec Command="pnpm install" Condition="Exists('..\..\..\pnpm-workspace.yaml')" />
</Target>
<Target Name="RunTSBuild" BeforeTargets="BeforeBuild;GenerateStaticWebAssetsManifest" DependsOnTargets="RestoreNodeTypes;NpmInstall" Condition="'$(SkipTSBuild)' != 'true'">
<Target Name="RunTSBuild" DependsOnTargets="RestoreNodeTypes;NpmInstall" Condition="'$(SkipTSBuild)' != 'true'">
<Message Text="Executing TypeScript compiler for $(ProjectName)..." Importance="high" />
<ItemGroup>
<CleanedEsmFiles Include="wwwroot\esm\**" />
Expand Down
1 change: 1 addition & 0 deletions src/RestoreNpmPackages.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</ItemGroup>
</Target>
<Target Name="NpmInstall" Condition="'$(SkipNodeScripts)' != 'true'" DependsOnTargets="ComputeNpmPackageMetadata" Inputs="@(NpmPackageFile)" Outputs="%(NpmPackageFile.StampFile)">
<Message Text="Installing NPM packages for $(ProjectName)..." Importance="high" />
<Exec Command="%(NpmPackageFile.InstallCommand)" WorkingDirectory="%(WorkingDir)" />
<Touch Files="%(NpmPackageFile.StampFile)" AlwaysCreate="true" Condition="Exists('%(NodeModulesDir)')" ContinueOnError="true" />
</Target>
Expand Down

0 comments on commit d1dedb3

Please sign in to comment.