mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-18 14:41:21 +08:00
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:
parent
6b2955f135
commit
5471735419
@ -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 ^<%3fxml version="1.0" encoding="utf-8"%3f^> > !settingsPublishProfile!
|
||||
echo ^<^^!-- >> !settingsPublishProfile!
|
||||
echo https://go.microsoft.com/fwlink/%3fLinkID=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 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 ^<%3fxml version="1.0" encoding="utf-8"%3f^> > !launcherPublishProfile!
|
||||
echo ^<^^!-- >> !launcherPublishProfile!
|
||||
echo https://go.microsoft.com/fwlink/%3fLinkID=208121. >> !launcherPublishProfile!
|
||||
echo --^> >> !launcherPublishProfile!
|
||||
echo ^<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"^> >> !launcherPublishProfile!
|
||||
echo ^<PropertyGroup^> >> !launcherPublishProfile!
|
||||
echo ^<PublishProtocol^>FileSystem^</PublishProtocol^> >> !launcherPublishProfile!
|
||||
echo ^<Configuration^>$(ConfigurationName)^</Configuration^> >> !launcherPublishProfile!
|
||||
echo ^<Platform^>$(PlatformName)^</Platform^> >> !launcherPublishProfile!
|
||||
echo ^<TargetFramework^>netcoreapp3.1^</TargetFramework^> >> !launcherPublishProfile!
|
||||
echo ^<PublishDir^>..\..\..\..\$(PlatformName)\$(ConfigurationName)\modules\launcher^</PublishDir^> >> !launcherPublishProfile!
|
||||
echo ^<RuntimeIdentifier^>win-x64^</RuntimeIdentifier^> >> !launcherPublishProfile!
|
||||
echo ^<SelfContained^>false^</SelfContained^> >> !launcherPublishProfile!
|
||||
echo ^<PublishSingleFile^>False^</PublishSingleFile^> >> !launcherPublishProfile!
|
||||
echo ^<PublishReadyToRun^>False^</PublishReadyToRun^> >> !launcherPublishProfile!
|
||||
echo ^</PropertyGroup^> >> !launcherPublishProfile!
|
||||
echo ^</Project^> >> !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
5
src/core/Directory.Build.targets
Normal file
5
src/core/Directory.Build.targets
Normal file
@ -0,0 +1,5 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<Target Name="IncrementalClean" />
|
||||
|
||||
</Project>
|
@ -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

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>
|
@ -8,4 +8,6 @@
|
||||
</Exec>
|
||||
</Target>
|
||||
|
||||
<Target Name="IncrementalClean" />
|
||||
|
||||
</Project>
|
@ -192,8 +192,4 @@
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="rem Check required to avoid a recursive loop of building

IF NOT DEFINED launcherBuildEventCompleted (
setlocal enableDelayedExpansion
SET launcherProfileFolderName=Properties\PublishProfiles\

rem Create the publish profile folder if it doesn't exist
IF NOT EXIST !launcherProfileFolderName! (mkdir !launcherProfileFolderName!)
SET launcherProfileFileName=LauncherProfile.pubxml
SET launcherPublishProfile=!launcherProfileFolderName!!launcherProfileFileName!

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

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

rem In case of Release we should not use Debug CRT in VCRT forwarders
IF $(ConfigurationName)==Release (
"$(MSBuildBinPath)\msbuild.exe" PowerLauncher.csproj -p:Configuration="$(ConfigurationName)" -p:Platform="$(PlatformName)" -p:AppxBundle=Never -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=!launcherProfileFileName!
"$(MSBuildBinPath)\msbuild.exe" PowerLauncher.csproj -t:Publish -p:Configuration="$(ConfigurationName)" -p:Platform="$(PlatformName)" -p:AppxBundle=Never -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=!launcherProfileFileName!
)
SET launcherBuildEventCompleted=
)" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user