Skip to content

Use TargetFrameworks tag if multiple frameworks are provided by dotnetframework#2727

Open
CapeGuyBen wants to merge 1 commit into
premake:masterfrom
CapeGuyGames:feature/targetframeworks
Open

Use TargetFrameworks tag if multiple frameworks are provided by dotnetframework#2727
CapeGuyBen wants to merge 1 commit into
premake:masterfrom
CapeGuyGames:feature/targetframeworks

Conversation

@CapeGuyBen

Copy link
Copy Markdown
Contributor

What does this PR do?

Allows multiple target .NET frameworks to be supported by a single dotnet project

How does this PR change Premake's behavior?

Extends the dotnetframework property to switch from using TargetFramework to TargetFrameworks when multiple (semicolon-separated) target names are provided

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

]]
end

function suite.multiple_target_dotnet_frameworks()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This has mixed spaces and tabs, should be normalized to tabs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

test_netcore.lua is now normalised to tabs

### Parameters ###

`version` is one of:
`versions` is a semicolon separated list of version numbers where each element is one of:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't we use table for list?

@nickclark2016 nickclark2016 Jul 4, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would agree. A table would be better.

To follow up, a table input should allow for single inputs as well.

@CapeGuyBen CapeGuyBen Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It could use a list:string? I think that would require a separate dotnetframeworks (plural version) property to avoid breaking backwards compatibility with existing uses of dotnetframework. This would mirror the TargetFramework and TargetFrameworks solution properties.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't believe so. I would need to verify, but it should just let you "append" to a list/table if you have only a single input specified, rather than a table.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@CapeGuyBen CapeGuyBen force-pushed the feature/targetframeworks branch from 89f9cc0 to 2de7d8a Compare July 4, 2026 20:27
### Parameters ###

`version` is one of:
`versions` is a semicolon separated list of version numbers where each element is one of:

@nickclark2016 nickclark2016 Jul 4, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would agree. A table would be better.

To follow up, a table input should allow for single inputs as well.

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.

4 participants