mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 11:46:30 +02:00
Add post-build event for publishing SettingsV2 (#2473)
* Added post build script * Added comments * Added unset statement * Added debug checks * added more debug statements * Added dir and cat statements to check pipeline output * revert installer change * Moved nuget package reference from update to include * Removed debug cat command * Removed debugging statements * Added build script for launcher * Added launcher scripts * Removed launcher scripts * Changed taskkill to throw error * Added back old config properties
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
<Platforms>x64</Platforms>
|
||||
<ApplicationIcon>icon.ico</ApplicationIcon>
|
||||
<Win32Resource />
|
||||
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
|
||||
|
||||
@@ -63,6 +64,7 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.VCRTForwarders.140" Version="1.0.6" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -70,8 +72,8 @@
|
||||
<ProjectReference Include="..\Microsoft.PowerToys.Settings.UI\Microsoft.PowerToys.Settings.UI.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Update="Microsoft.VCRTForwarders.140" Version="1.0.5" />
|
||||
</ItemGroup>
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="rem Check required to avoid a recursive loop of building

IF NOT DEFINED settingsBuildEventCompleted (
setlocal enableDelayedExpansion
SET settingsProfileFolderName=Properties\PublishProfiles\

rem Create the publish profile folder if it doesn't exist
IF NOT EXIST !settingsProfileFolderName! (mkdir !settingsProfileFolderName!)
SET settingsProfileFileName=SettingsProfile.pubxml
SET settingsPublishProfile=!settingsProfileFolderName!!settingsProfileFileName!

rem Create the publish profile pubxml
echo ^<?xml version="1.0" encoding="utf-8"?^> > !settingsPublishProfile!
echo ^<^^!-- >> !settingsPublishProfile!
echo https://go.microsoft.com/fwlink/?LinkID=208121. >> !settingsPublishProfile!
echo --^> >> !settingsPublishProfile!
echo ^<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"^> >> !settingsPublishProfile!
echo ^<PropertyGroup^> >> !settingsPublishProfile!
echo ^<PublishProtocol^>FileSystem^</PublishProtocol^> >> !settingsPublishProfile!
echo ^<Configuration^>$(ConfigurationName)^</Configuration^> >> !settingsPublishProfile!
echo ^<Platform^>$(PlatformName)^</Platform^> >> !settingsPublishProfile!
echo ^<TargetFramework^>netcoreapp3.1^</TargetFramework^> >> !settingsPublishProfile!
echo ^<PublishDir^>..\..\..\$(PlatformName)\$(ConfigurationName)\SettingsUIRunner^</PublishDir^> >> !settingsPublishProfile!
echo ^<RuntimeIdentifier^>win-x64^</RuntimeIdentifier^> >> !settingsPublishProfile!
echo ^<SelfContained^>false^</SelfContained^> >> !settingsPublishProfile!
echo ^<PublishSingleFile^>False^</PublishSingleFile^> >> !settingsPublishProfile!
echo ^<PublishReadyToRun^>False^</PublishReadyToRun^> >> !settingsPublishProfile!
echo ^</PropertyGroup^> >> !settingsPublishProfile!
echo ^</Project^> >> !settingsPublishProfile!

rem Set a variable to know that the publish event is called to avoid it being called again
SET settingsBuildEventCompleted=1

rem In case of Release we should not use Debug CRT in VCRT forwarders
IF $(ConfigurationName)==Release (
"$(MSBuildBinPath)\msbuild.exe" Microsoft.PowerToys.Settings.UI.Runner.csproj -t:Build -p:Configuration="$(ConfigurationName)" -p:Platform="$(PlatformName)" -p:AppxBundle=Never -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=!settingsProfileFileName!
) ELSE (
"$(MSBuildBinPath)\msbuild.exe" Microsoft.PowerToys.Settings.UI.Runner.csproj -t:Build -p:Configuration="$(ConfigurationName)" -p:Platform="$(PlatformName)" -p:AppxBundle=Never -p:PublishProfile=!settingsProfileFileName!
)
SET settingsBuildEventCompleted=
)
" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user