Skip to content

projects: fix Windows project 'clean' function#18412

Closed
jay wants to merge 7 commits into
curl:masterfrom
jay:fix_projects_clean
Closed

projects: fix Windows project 'clean' function#18412
jay wants to merge 7 commits into
curl:masterfrom
jay:fix_projects_clean

Conversation

@jay

@jay jay commented Aug 27, 2025

Copy link
Copy Markdown
Member
  • Fix generate.bat "-clean" option.

  • Minor change to version template substitutes to match old files,
    eg go back to using format version "11.00" instead of "11.0".

  • Do not remove the VC directories during clean, instead remove just the
    generated project files.

Removing the VC directories has the unwanted behavior of removing files
other than those generated. Visual Studio will generate its own
preference files (like if you have some debug arguments in your .suo)
and those files sit in the VC directories. We ignore these files and
they are the user's files and should not be deleted. Also the user (such
as me) may have their own untracked files that we shouldn't be deleting.

Follow-up to 57d349f which consolidated the project templates.

Closes #xxxx

@jay jay added Windows Windows-specific script labels Aug 27, 2025
@github-actions github-actions Bot added the build label Aug 27, 2025
- Fix generate.bat "-clean" option.

- Minor change to version template substitutes to match old files,
  eg go back to using format version "11.00" instead of "11.0".

- Do not remove the VC directories during clean, instead remove just the
  generated project files.

Removing the VC directories has the unwanted behavior of removing files
other than those generated. Visual Studio will generate its own
preference files (like if you have some debug arguments in your .suo)
and those files sit in the VC directories. We ignore these files and
they are the user's files and should not be deleted. Also the user (such
as me) may have their own untracked files that we shouldn't be deleting.

Follow-up to 57d349f which consolidated the project templates.

Closes #xxxx
@jay
jay force-pushed the fix_projects_clean branch from 59fe6b3 to 8437c7a Compare August 27, 2025 07:35
@jay

jay commented Aug 27, 2025

Copy link
Copy Markdown
Member Author

I think it may be possible to not have VCxx in the tree without affecting the untracked files so I'm going to limit this PR to getting rid of the remove directory command but not the create directory command.

Comment thread projects/generate.bat Outdated
Comment thread projects/Windows/.gitignore Outdated
@vszakats

vszakats commented Aug 27, 2025

Copy link
Copy Markdown
Member

Peeking into the .filters files, they list a bunch of possible extensions
to form source file groups, but of those extensions, only .c, .h and .rc
are actually used in the project files. Those file types are already put in
their own group when generating the project. Do you think the .filters
files are doing something useful, or could they be dropped maybe?

Their content, after deleting non-existing extensions:

  <ItemGroup>
    <Filter Include="Source Files">
      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
      <Extensions>c</Extensions>
    </Filter>
    <Filter Include="Header Files">
      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
      <Extensions>h</Extensions>
    </Filter>
    <Filter Include="Resource Files">
      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
      <Extensions>rc</Extensions>
    </Filter>
  </ItemGroup>
</Project>

jay added 3 commits August 28, 2025 14:23
.. also add a readme explaining that files in templ directory should not
be opened with visual studio.

template files are already in a tmpl directory which is enough to
identify them as template files without having the templ extension.
however it's possible the user won't understand that? so i added a
readme explaining that they are template files.
@jay

jay commented Aug 28, 2025

Copy link
Copy Markdown
Member Author

Do you think the .filters
files are doing something useful, or could they be dropped maybe?

I think they could be structural, I don't know. It's really hard to tell with MS and I'd rather not break anything. It's safer to keep them. I did add your suggested change though to limit the scope of the filtering to extensions that we actually use.

edit: I realized this is what they are doing, and I do find it useful:

filtering

@jay jay closed this in c72bb7a Sep 2, 2025
@jay
jay deleted the fix_projects_clean branch September 2, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants