Skip to content

Improve slnx format output#2653

Merged
redorav merged 7 commits into
premake:masterfrom
redorav:master
May 4, 2026
Merged

Improve slnx format output#2653
redorav merged 7 commits into
premake:masterfrom
redorav:master

Conversation

@redorav
Copy link
Copy Markdown
Collaborator

@redorav redorav commented Apr 15, 2026

What does this PR do?

Improves the configuration mapping for the slnx format

How does this PR change Premake's behavior?

It accounts for the buildcfg and platform combinations so they map correctly to the project files

Anything else we should know?

Some unit tests are failing due to some iterator not being set up correctly, don't think it's a big one but I need someone to review what I'm doing. Once that's fixed I can get to fixing any valid unit test failures and add new ones

Did you check all the boxes?

  • Focus on a single fix or feature; remove any unrelated formatting or code changes
  • Add unit tests showing fix or feature works; all tests pass
  • Mention any related issues (put closes #XXXX in comment to auto-close issue when PR is merged)
  • Follow our coding conventions
  • Minimize the number of commits
  • Align documentation to your changes

You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to requests like these!

Comment thread modules/vstudio/vs2026_solution.lua Outdated
Comment thread modules/vstudio/vs2026_solution.lua Outdated
@nickclark2016 nickclark2016 mentioned this pull request Apr 23, 2026
7 tasks
redorav and others added 2 commits April 30, 2026 20:19
Update unit tests so they all pass correctly
I have taken a different approach altogether to this, as the new format allows for default properties to be set. Therefore what we do is detect what is relevant for a given project from what's available in the solution, and everything else is set as a default, as all projects need to specify what happens to configurations in the solution but outside their purview. By not adding configs the project doesn't care about, we make the slnx more understandable and concise
Copy link
Copy Markdown
Member

@nickclark2016 nickclark2016 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR causes failures in loading the solution file. Digging deeper, it's emitting multiple "Project" XML nodes for the same project, which is invalid.

More details after further investigation:

Each project is put into every group (folder node) in the solution. Something like this should suffice to show the issue:

workspace "Foo"
  project "Bar"
  kind "ConsoleApp"
  language "C++"
  
  group "Baz"
    project "Quux"
    kind "ConsoleApp"
    language "C++"

@redorav
Copy link
Copy Markdown
Collaborator Author

redorav commented May 1, 2026

Hmm could you give me an example of a script that does that? It's meant to just loop through the projects once. Ah I see, I haven't tested with group folders, I'll fix once I'm free this evening. I wonder if this is a bug that existed already in the original implementation and I just carried it over without much thought, I'll double check

@nickclark2016
Copy link
Copy Markdown
Member

Hmm could you give me an example of a script that does that? It's meant to just loop through the projects once. Ah I see, I haven't tested with group folders, I'll fix once I'm free this evening. I think this is a bug that existed already in the original implementation, I just carried it over without much thought, I'll double check

This is not a bug present in the original version. It's a regression.

Comment thread modules/vstudio/vs2026_solution.lua Outdated
@redorav redorav merged commit 4ae10aa into premake:master May 4, 2026
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants