PowerToys
PowerToys copied to clipboard
[Settings & Launcher] Clean no longer works
From the changes in #2759 , disabling IncrementalClean causes Clean to no longer work for those projects. The target would have to be tweaked a bit to fix it.
Tried out the following approaches, but they didn't work. This issue still remains for the settings project. In all the cases, it seems like we hit either the double compilation issue or the clean not working issue.
-
The present approach that we have for the settings Runner project is that the IncrementalClean step is overridden with an empty target so that we no longer face the double compilation issue. Since the same incremental clean step is used as a depency Target for Clean, clean does not work as expected.
-
I tried to include the following in the Directory.Build.props file.
<Project>
<Target
Name="ForceAssignProjectConfigurationBeforeSplitProjectReferencesByFileExistence_KLUDGE"
BeforeTargets="_SplitProjectReferencesByFileExistence"
DependsOnTargets="AssignProjectConfiguration" />
</Project>
This solved the incremental clean issue but it still had the double compilation issue.
- The next approach that I tried was to remove the incrementalClean target from the CoreBuild target dependencies. This fixed the double compilation issue but Clean was still not working as expected.
<PropertyGroup>
<CoreBuildDependsOn>
BuildOnlySettings;
PrepareForBuild;
PreBuildEvent;
ResolveReferences;
PrepareResources;
ResolveKeySource;
Compile;
ExportWindowsMDFile;
UnmanagedUnregistration;
GenerateSerializationAssemblies;
CreateSatelliteAssemblies;
GenerateManifests;
GetTargetPath;
PrepareForRun;
UnmanagedRegistration;
PostBuildEvent
</CoreBuildDependsOn>
</PropertyGroup>
<Target
Name="CoreBuild"
DependsOnTargets="$(CoreBuildDependsOn)">
<OnError ExecuteTargets="_TimeStampAfterCompile;PostBuildEvent" Condition="'$(RunPostBuildEvent)'=='Always' or '$(RunPostBuildEvent)'=='OnOutputUpdated'"/>
<OnError ExecuteTargets="_CleanRecordFileWrites"/>
</Target>
- The other approach that I tried was to override the CleanDependsOn Property as follows -
<PropertyGroup>
<CleanDependsOn>
$(CleanDependsOn);
CustomClean
</CleanDependsOn>
</PropertyGroup>
<Target Name="CustomClean"
DependsOnTargets="_CleanGetCurrentAndPriorFileWrites" />
The idea behind this was that we depend on the same targets that Incremental Clean used to depend on ie. _CleanGetCurrentAndPriorFileWrites. Ideally this should work as we are implementing a custom target which behaved just like incremental clean and are calling it when the Clean target is triggered. However, even this did not fix the clean issue.
Moving it to v1 as the double compilation issue exists when incremental clean is removed as stated above. This issue would be solved when we switch to WinUI 3.
@arjunbalgovind @alekhyareddy28 Is this still a thing?
/needinfo
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 5 days. It will be closed if no further activity occurs within 5 days of this comment.