Add post-build event for publishing Launcher (#2561)

* 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

* Fixed interop folder and added hacked powerlauncher script

* Added publish only for Release
This commit is contained in:
Arjun Balgovind 2020-05-04 13:30:38 -07:00 committed by GitHub
parent 0f6563e8e0
commit d401474981
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -53,9 +53,13 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<TargetName>PowerToysInterop</TargetName>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)$(Platform)\$(Configuration)\obj\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetName>PowerToysInterop</TargetName>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)$(Platform)\$(Configuration)\obj\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>

View file

@ -193,4 +193,8 @@
</None>
</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 launcherBuildEventCompleted (&#xD;&#xA;setlocal enableDelayedExpansion&#xD;&#xA;SET launcherProfileFolderName=Properties\PublishProfiles\&#xD;&#xA;&#xD;&#xA;rem Create the publish profile folder if it doesn't exist&#xD;&#xA;IF NOT EXIST !launcherProfileFolderName! (mkdir !launcherProfileFolderName!)&#xD;&#xA;SET launcherProfileFileName=LauncherProfile.pubxml&#xD;&#xA;SET launcherPublishProfile=!launcherProfileFolderName!!launcherProfileFileName!&#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; !launcherPublishProfile!&#xD;&#xA;echo ^&lt;^^!-- &gt;&gt; !launcherPublishProfile!&#xD;&#xA;echo https://go.microsoft.com/fwlink/?LinkID=208121. &gt;&gt; !launcherPublishProfile!&#xD;&#xA;echo --^&gt; &gt;&gt; !launcherPublishProfile!&#xD;&#xA;echo ^&lt;Project ToolsVersion=&quot;4.0&quot; xmlns=&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot;^&gt; &gt;&gt; !launcherPublishProfile!&#xD;&#xA;echo ^&lt;PropertyGroup^&gt; &gt;&gt; !launcherPublishProfile!&#xD;&#xA;echo ^&lt;PublishProtocol^&gt;FileSystem^&lt;/PublishProtocol^&gt; &gt;&gt; !launcherPublishProfile!&#xD;&#xA;echo ^&lt;Configuration^&gt;$(ConfigurationName)^&lt;/Configuration^&gt; &gt;&gt; !launcherPublishProfile!&#xD;&#xA;echo ^&lt;Platform^&gt;$(PlatformName)^&lt;/Platform^&gt; &gt;&gt; !launcherPublishProfile!&#xD;&#xA;echo ^&lt;TargetFramework^&gt;netcoreapp3.1^&lt;/TargetFramework^&gt; &gt;&gt; !launcherPublishProfile!&#xD;&#xA;echo ^&lt;PublishDir^&gt;..\..\..\..\$(PlatformName)\$(ConfigurationName)\modules\launcher^&lt;/PublishDir^&gt; &gt;&gt; !launcherPublishProfile!&#xD;&#xA;echo ^&lt;RuntimeIdentifier^&gt;win-x64^&lt;/RuntimeIdentifier^&gt; &gt;&gt; !launcherPublishProfile!&#xD;&#xA;echo ^&lt;SelfContained^&gt;false^&lt;/SelfContained^&gt; &gt;&gt; !launcherPublishProfile!&#xD;&#xA;echo ^&lt;PublishSingleFile^&gt;False^&lt;/PublishSingleFile^&gt; &gt;&gt; !launcherPublishProfile!&#xD;&#xA;echo ^&lt;PublishReadyToRun^&gt;False^&lt;/PublishReadyToRun^&gt; &gt;&gt; !launcherPublishProfile!&#xD;&#xA;echo ^&lt;/PropertyGroup^&gt; &gt;&gt; !launcherPublishProfile!&#xD;&#xA;echo ^&lt;/Project^&gt; &gt;&gt; !launcherPublishProfile!&#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 launcherBuildEventCompleted=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; PowerLauncher.csproj -p:Configuration=&quot;$(ConfigurationName)&quot; -p:Platform=&quot;$(PlatformName)&quot; -p:AppxBundle=Never -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=!launcherProfileFileName!&#xD;&#xA;&quot;$(MSBuildBinPath)\msbuild.exe&quot; PowerLauncher.csproj -t:Publish -p:Configuration=&quot;$(ConfigurationName)&quot; -p:Platform=&quot;$(PlatformName)&quot; -p:AppxBundle=Never -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=!launcherProfileFileName!&#xD;&#xA;)&#xD;&#xA;SET launcherBuildEventCompleted=&#xD;&#xA;)" />
</Target>
</Project>