mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
Pre-creation of generated folder for any csproj (#39018)
* Test for Precreation of generated folder for any csproj to prevent random build break
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- Some items may be set in Directory.Build.props in root -->
|
<!-- Some items may be set in Directory.Build.props in root -->
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project=".\Common.Dotnet.PrepareGeneratedFolder.targets" />
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<WindowsSdkPackageVersion>10.0.22621.57</WindowsSdkPackageVersion>
|
<WindowsSdkPackageVersion>10.0.22621.57</WindowsSdkPackageVersion>
|
||||||
<TargetFramework>net9.0-windows10.0.22621.0</TargetFramework>
|
<TargetFramework>net9.0-windows10.0.22621.0</TargetFramework>
|
||||||
|
|||||||
16
src/Common.Dotnet.PrepareGeneratedFolder.targets
Normal file
16
src/Common.Dotnet.PrepareGeneratedFolder.targets
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
|
||||||
|
<Target Name="EnsureGeneratedBaseFolder" BeforeTargets="XamlPreCompile">
|
||||||
|
<PropertyGroup>
|
||||||
|
<!-- Only create the base 'generated' folder -->
|
||||||
|
<CompilerGeneratedFilesOutputPath>$(ProjectDir)obj\g</CompilerGeneratedFilesOutputPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<!-- Create 'generated' folder if missing -->
|
||||||
|
<MakeDir Directories="$(CompilerGeneratedFilesOutputPath)" />
|
||||||
|
|
||||||
|
<!-- Optional logging for debugging -->
|
||||||
|
<Message Text="Ensured: $(GeneratedBasePath)" Importance="Low" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
</Project>
|
||||||
@@ -15,8 +15,6 @@
|
|||||||
<ProjectPriFileName>PowerToys.EnvironmentVariablesUILib.pri</ProjectPriFileName>
|
<ProjectPriFileName>PowerToys.EnvironmentVariablesUILib.pri</ProjectPriFileName>
|
||||||
<GenerateLibraryLayout>true</GenerateLibraryLayout>
|
<GenerateLibraryLayout>true</GenerateLibraryLayout>
|
||||||
<IsPackable>true</IsPackable>
|
<IsPackable>true</IsPackable>
|
||||||
<!-- The default generated file path exceeds the length limit 260 on the build agent. Using a shorter path as a workaround. -->
|
|
||||||
<CompilerGeneratedFilesOutputPath>$(ProjectDir)obj\g</CompilerGeneratedFilesOutputPath>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
@@ -56,7 +54,4 @@
|
|||||||
<Manifest Include="$(ApplicationManifest)" />
|
<Manifest Include="$(ApplicationManifest)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="EnsureCompilerGeneratedFilesOutputPathExists" BeforeTargets="XamlPreCompile">
|
|
||||||
<MakeDir Directories="$(CompilerGeneratedFilesOutputPath)" />
|
|
||||||
</Target>
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
Reference in New Issue
Block a user