Fix double compile issue for Launcher and Settings (#2759)

* Fix double compile issue

* Removed debugging code

* added prebuild event

* Updated output folders
This commit is contained in:
Arjun Balgovind 2020-05-08 09:07:18 -07:00 committed by GitHub
parent 6b2955f135
commit 5471735419
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 90 additions and 20 deletions

View File

@ -69,6 +69,77 @@
</PropertyGroup>
<Error Condition="!Exists('..\packages\WiX.3.11.2\build\wix.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WiX.3.11.2\build\wix.props'))" />
</Target>
<PropertyGroup>
<PreBuildEvent>setlocal enableDelayedExpansion
rem Publish Settings
SET settingsProfileFolderName=..\..\..\..\src\core\Microsoft.PowerToys.Settings.UI.Runner\Properties\PublishProfiles\
rem Create the publish profile folder if it doesn%27t exist
IF NOT EXIST !settingsProfileFolderName! (mkdir !settingsProfileFolderName!)
SET settingsProfileFileName=SettingsProfile.pubxml
SET settingsPublishProfile=!settingsProfileFolderName!!settingsProfileFileName!
rem Create the publish profile pubxml
echo ^&lt;%3fxml version="1.0" encoding="utf-8"%3f^&gt; &gt; !settingsPublishProfile!
echo ^&lt;^^!-- &gt;&gt; !settingsPublishProfile!
echo https://go.microsoft.com/fwlink/%3fLinkID=208121. &gt;&gt; !settingsPublishProfile!
echo --^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;PropertyGroup^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;PublishProtocol^&gt;FileSystem^&lt;/PublishProtocol^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;Configuration^&gt;$(ConfigurationName)^&lt;/Configuration^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;Platform^&gt;$(PlatformName)^&lt;/Platform^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;TargetFramework^&gt;netcoreapp3.1^&lt;/TargetFramework^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;PublishDir^&gt;..\..\..\$(PlatformName)\$(ConfigurationName)\SettingsUIRunner^&lt;/PublishDir^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;RuntimeIdentifier^&gt;win-x64^&lt;/RuntimeIdentifier^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;SelfContained^&gt;false^&lt;/SelfContained^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;PublishSingleFile^&gt;False^&lt;/PublishSingleFile^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;PublishReadyToRun^&gt;False^&lt;/PublishReadyToRun^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;/PropertyGroup^&gt; &gt;&gt; !settingsPublishProfile!
echo ^&lt;/Project^&gt; &gt;&gt; !settingsPublishProfile!
rem In case of Release we should not use Debug CRT in VCRT forwarders
IF $(ConfigurationName)==Release (
"$(MSBuildBinPath)\msbuild.exe" ..\..\..\..\src\core\Microsoft.PowerToys.Settings.UI.Runner\Microsoft.PowerToys.Settings.UI.Runner.csproj -t:Publish -p:Configuration="$(ConfigurationName)" -p:Platform="$(PlatformName)" -p:AppxBundle=Never -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=!settingsProfileFileName!
) ELSE (
"$(MSBuildBinPath)\msbuild.exe" ..\..\..\..\src\core\Microsoft.PowerToys.Settings.UI.Runner\Microsoft.PowerToys.Settings.UI.Runner.csproj -t:Publish -p:Configuration="$(ConfigurationName)" -p:Platform="$(PlatformName)" -p:AppxBundle=Never -p:PublishProfile=!settingsProfileFileName!
)
rem Publish Launcher
SET launcherProfileFolderName=..\..\..\..\src\modules\launcher\PowerLauncher\Properties\PublishProfiles\
rem Create the publish profile folder if it doesn%27t exist
IF NOT EXIST !launcherProfileFolderName! (mkdir !launcherProfileFolderName!)
SET launcherProfileFileName=LauncherProfile.pubxml
SET launcherPublishProfile=!launcherProfileFolderName!!launcherProfileFileName!
rem Create the publish profile pubxml
echo ^&lt;%3fxml version="1.0" encoding="utf-8"%3f^&gt; &gt; !launcherPublishProfile!
echo ^&lt;^^!-- &gt;&gt; !launcherPublishProfile!
echo https://go.microsoft.com/fwlink/%3fLinkID=208121. &gt;&gt; !launcherPublishProfile!
echo --^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;PropertyGroup^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;PublishProtocol^&gt;FileSystem^&lt;/PublishProtocol^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;Configuration^&gt;$(ConfigurationName)^&lt;/Configuration^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;Platform^&gt;$(PlatformName)^&lt;/Platform^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;TargetFramework^&gt;netcoreapp3.1^&lt;/TargetFramework^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;PublishDir^&gt;..\..\..\..\$(PlatformName)\$(ConfigurationName)\modules\launcher^&lt;/PublishDir^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;RuntimeIdentifier^&gt;win-x64^&lt;/RuntimeIdentifier^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;SelfContained^&gt;false^&lt;/SelfContained^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;PublishSingleFile^&gt;False^&lt;/PublishSingleFile^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;PublishReadyToRun^&gt;False^&lt;/PublishReadyToRun^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;/PropertyGroup^&gt; &gt;&gt; !launcherPublishProfile!
echo ^&lt;/Project^&gt; &gt;&gt; !launcherPublishProfile!
rem In case of Release we should not use Debug CRT in VCRT forwarders
IF $(ConfigurationName)==Release (
"$(MSBuildBinPath)\msbuild.exe" ..\..\..\..\src\modules\launcher\PowerLauncher\PowerLauncher.csproj -t:Publish -p:Configuration="$(ConfigurationName)" -p:Platform="$(PlatformName)" -p:AppxBundle=Never -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=!launcherProfileFileName!
) ELSE (
"$(MSBuildBinPath)\msbuild.exe" ..\..\..\..\src\modules\launcher\PowerLauncher\PowerLauncher.csproj -t:Publish -p:Configuration="$(ConfigurationName)" -p:Platform="$(PlatformName)" -p:AppxBundle=Never -p:PublishProfile=!launcherProfileFileName!
)</PreBuildEvent>
</PropertyGroup>
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Wix.targets.

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,5 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="IncrementalClean" />
</Project>

View File

@ -71,8 +71,4 @@
<ProjectReference Include="..\Microsoft.PowerToys.Settings.UI\Microsoft.PowerToys.Settings.UI.csproj" />
</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

@ -8,4 +8,6 @@
</Exec>
</Target>
<Target Name="IncrementalClean" />
</Project>

View File

@ -192,8 +192,4 @@
</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>

View File

@ -15,7 +15,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\..\..\..\x64\Debug\modules\launcher\</OutputPath>
<OutputPath>..\..\..\..\x64\Debug\modules\launcher\WoxCore</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
@ -27,7 +27,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutputPath>..\..\..\..\x64\Release\modules\launcher\</OutputPath>
<OutputPath>..\..\..\..\x64\Release\modules\launcher\WoxCore</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>

View File

@ -15,7 +15,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\..\..\..\x64\Debug\modules\launcher\</OutputPath>
<OutputPath>..\..\..\..\x64\Debug\modules\launcher\WoxInfrastructure</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
@ -28,7 +28,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutputPath>..\..\..\..\x64\Release\modules\launcher\</OutputPath>
<OutputPath>..\..\..\..\x64\Release\modules\launcher\WoxInfrastructure</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>

View File

@ -16,7 +16,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\..\..\..\x64\Debug\modules\launcher\</OutputPath>
<OutputPath>..\..\..\..\x64\Debug\modules\launcher\WoxPlugin</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
@ -28,7 +28,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutputPath>..\..\..\..\x64\Release\modules\launcher\</OutputPath>
<OutputPath>..\..\..\..\x64\Release\modules\launcher\WoxPlugin</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>

View File

@ -14,7 +14,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\..\..\..\x64\Debug\modules\launcher\</OutputPath>
<OutputPath>..\..\..\..\x64\Debug\modules\launcher\WoxTest</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
@ -27,7 +27,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>..\..\..\..\x64\Release\modules\launcher\</OutputPath>
<OutputPath>..\..\..\..\x64\Release\modules\launcher\WoxTest</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>

View File

@ -15,7 +15,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutputPath>..\..\..\..\x64\Debug\modules\launcher\</OutputPath>
<OutputPath>..\..\..\..\x64\Debug\modules\launcher\Wox</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
@ -28,7 +28,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutputPath>..\..\..\..\x64\Release\modules\launcher\</OutputPath>
<OutputPath>..\..\..\..\x64\Release\modules\launcher\Wox</OutputPath>
<DefineConstants>TRACE;RELEASE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>