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:
Arjun Balgovind 2020-05-01 13:17:30 -07:00 committed by GitHub
parent 032aa2d1d6
commit 8cb134f56b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 29 additions and 30 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
#pragma once
#include <common\keyboard_layout.h>
#include <common\two_way_pipe_message_ipc.h>
#include "..\keyboard_layout.h"
#include "..\two_way_pipe_message_ipc.h"
#include <msclr\marshal.h>
#include <msclr\marshal_cppstd.h>
#include <functional>

View File

@ -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&#xD;&#xA;&#xD;&#xA;IF NOT DEFINED settingsBuildEventCompleted (&#xD;&#xA;setlocal enableDelayedExpansion&#xD;&#xA;SET settingsProfileFolderName=Properties\PublishProfiles\&#xD;&#xA;&#xD;&#xA;rem Create the publish profile folder if it doesn't exist&#xD;&#xA;IF NOT EXIST !settingsProfileFolderName! (mkdir !settingsProfileFolderName!)&#xD;&#xA;SET settingsProfileFileName=SettingsProfile.pubxml&#xD;&#xA;SET settingsPublishProfile=!settingsProfileFolderName!!settingsProfileFileName!&#xD;&#xA;&#xD;&#xA;rem Create the publish profile pubxml&#xD;&#xA;echo ^&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?^&gt; &gt; !settingsPublishProfile!&#xD;&#xA;echo ^&lt;^^!-- &gt;&gt; !settingsPublishProfile!&#xD;&#xA;echo https://go.microsoft.com/fwlink/?LinkID=208121. &gt;&gt; !settingsPublishProfile!&#xD;&#xA;echo --^&gt; &gt;&gt; !settingsPublishProfile!&#xD;&#xA;echo ^&lt;Project ToolsVersion=&quot;4.0&quot; xmlns=&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot;^&gt; &gt;&gt; !settingsPublishProfile!&#xD;&#xA;echo ^&lt;PropertyGroup^&gt; &gt;&gt; !settingsPublishProfile!&#xD;&#xA;echo ^&lt;PublishProtocol^&gt;FileSystem^&lt;/PublishProtocol^&gt; &gt;&gt; !settingsPublishProfile!&#xD;&#xA;echo ^&lt;Configuration^&gt;$(ConfigurationName)^&lt;/Configuration^&gt; &gt;&gt; !settingsPublishProfile!&#xD;&#xA;echo ^&lt;Platform^&gt;$(PlatformName)^&lt;/Platform^&gt; &gt;&gt; !settingsPublishProfile!&#xD;&#xA;echo ^&lt;TargetFramework^&gt;netcoreapp3.1^&lt;/TargetFramework^&gt; &gt;&gt; !settingsPublishProfile!&#xD;&#xA;echo ^&lt;PublishDir^&gt;..\..\..\$(PlatformName)\$(ConfigurationName)\SettingsUIRunner^&lt;/PublishDir^&gt; &gt;&gt; !settingsPublishProfile!&#xD;&#xA;echo ^&lt;RuntimeIdentifier^&gt;win-x64^&lt;/RuntimeIdentifier^&gt; &gt;&gt; !settingsPublishProfile!&#xD;&#xA;echo ^&lt;SelfContained^&gt;false^&lt;/SelfContained^&gt; &gt;&gt; !settingsPublishProfile!&#xD;&#xA;echo ^&lt;PublishSingleFile^&gt;False^&lt;/PublishSingleFile^&gt; &gt;&gt; !settingsPublishProfile!&#xD;&#xA;echo ^&lt;PublishReadyToRun^&gt;False^&lt;/PublishReadyToRun^&gt; &gt;&gt; !settingsPublishProfile!&#xD;&#xA;echo ^&lt;/PropertyGroup^&gt; &gt;&gt; !settingsPublishProfile!&#xD;&#xA;echo ^&lt;/Project^&gt; &gt;&gt; !settingsPublishProfile!&#xD;&#xA;&#xD;&#xA;rem Set a variable to know that the publish event is called to avoid it being called again&#xD;&#xA;SET settingsBuildEventCompleted=1&#xD;&#xA;&#xD;&#xA;rem In case of Release we should not use Debug CRT in VCRT forwarders&#xD;&#xA;IF $(ConfigurationName)==Release (&#xD;&#xA;&quot;$(MSBuildBinPath)\msbuild.exe&quot; Microsoft.PowerToys.Settings.UI.Runner.csproj -t:Build -p:Configuration=&quot;$(ConfigurationName)&quot; -p:Platform=&quot;$(PlatformName)&quot; -p:AppxBundle=Never -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=!settingsProfileFileName!&#xD;&#xA;) ELSE (&#xD;&#xA;&quot;$(MSBuildBinPath)\msbuild.exe&quot; Microsoft.PowerToys.Settings.UI.Runner.csproj -t:Build -p:Configuration=&quot;$(ConfigurationName)&quot; -p:Platform=&quot;$(PlatformName)&quot; -p:AppxBundle=Never -p:PublishProfile=!settingsProfileFileName!&#xD;&#xA;)&#xD;&#xA;SET settingsBuildEventCompleted=&#xD;&#xA;)&#xD;&#xA;" />
</Target>
</Project>

View File

@ -2,7 +2,7 @@
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == 'x64' ">Debug</Configuration>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x64</Platform>
<ProjectGuid>{A7D5099E-F0FD-4BF3-8522-5A682759F915}</ProjectGuid>
<OutputType>AppContainerExe</OutputType>
@ -116,6 +116,7 @@
<Content Include="Assets\Square150x150Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Assets\StoreLogo.png" />
<Content Include="Assets\StoreLogo.scale-100.png" />
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
<Content Include="Properties\Default.rd.xml" />
@ -239,11 +240,11 @@
<EnableXBindDiagnostics>false</EnableXBindDiagnostics>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,14 +1,11 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="KillPowerLauncher" BeforeTargets="PreBuildEvent;BeforeClean">
<Message Text="Killing process 'PowerLauncher.exe'" Importance="normal" ContinueOnError="true" />
<Exec Command="taskkill /F /IM PowerLauncher.exe"
IgnoreExitCode="true"
IgnoreStandardErrorWarningFormat="true">
<Message Text="Killing process 'PowerLauncher.exe'" Importance="normal" ContinueOnError="false" />
<Exec Command="tasklist /FI &quot;IMAGENAME eq PowerLauncher.exe&quot; 2&gt;NUL | find /I /N &quot;PowerLauncher.exe&quot;&gt;NUL &#xD;&#xA; if %25ERRORLEVEL%25==0 ( taskkill /f /im PowerLauncher.exe )"
IgnoreExitCode="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode"/>
</Exec>
<Error Text="Cannot kill PowerLauncher.exe process." Condition="$(ErrorCode) == 1"/>
<Message Text="Process PowerLauncher.exe does not exist." Condition="$(ErrorCode) == 128"/>
</Target>
</Project>

View File

@ -2,7 +2,7 @@
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == 'x64' ">Debug</Configuration>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x64</Platform>
<ProjectGuid>{4A3DE70C-684C-410D-B851-C23B6DAEDF16}</ProjectGuid>
<OutputType>AppContainerExe</OutputType>

View File

@ -7,7 +7,8 @@
<UseWindowsForms>true</UseWindowsForms>
<StartupObject>PowerLauncher.App</StartupObject>
<ApplicationIcon>Resources\placeholderLauncher.ico</ApplicationIcon>
<ApplicationManifest>app.manifest</ApplicationManifest>
<ApplicationManifest>app.manifest</ApplicationManifest>
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<Platforms>x64</Platforms>
@ -16,7 +17,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutputPath>..\..\..\..\x64\Debug\modules\launcher\</OutputPath>
<OutputPath>..\..\..\..\$(Platform)\$(Configuration)\modules\launcher\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
@ -29,7 +30,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutputPath>..\..\..\..\x64\Release\modules\launcher\</OutputPath>
<OutputPath>..\..\..\..\$(Platform)\$(Configuration)\modules\launcher\</OutputPath>
<DefineConstants>TRACE;RELEASE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
@ -73,7 +74,8 @@
<PackageReference Include="PropertyChanged.Fody" Version="3.2.8" />
<PackageReference Include="System.Data.SQLite" Version="1.0.112" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.112.1" />
<PackageReference Include="System.Runtime" Version="4.3.1" />
<PackageReference Include="System.Runtime" Version="4.3.1" />
<PackageReference Include="Microsoft.VCRTForwarders.140" Version="1.0.6" />
</ItemGroup>
<ItemGroup>
@ -191,7 +193,4 @@
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.VCRTForwarders.140" Version="1.0.6" />
</ItemGroup>
</Project>

View File

@ -64,8 +64,8 @@
<PackageReference Include="System.Runtime" Version="4.3.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\core\Microsoft.PowerToys.Settings.UI.Lib\Microsoft.PowerToys.Settings.UI.Lib.csproj" />
<ItemGroup>
<ProjectReference Include="..\..\..\core\Microsoft.PowerToys.Settings.UI.Lib\Microsoft.PowerToys.Settings.UI.Lib.csproj" />
</ItemGroup>
</Project>