Skip to content

Commit fc06984

Browse files
lolrobbe2Beernaert Robbe
andauthored
updated dotnetbase to generate configurations list in opening propert… (#2320)
* updated dotnetbase to generate configurations list in opening propertygroup containing project properties --------- Co-authored-by: Beernaert Robbe <[email protected]>
1 parent 6f0cb4a commit fc06984

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

modules/vstudio/tests/cs2005/test_netcore.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ local wks, prj
2020
function suite.setup()
2121
p.action.set("vs2005")
2222
wks, prj = test.createWorkspace()
23+
configurations { "Debug", "Release", "Distribution"}
2324
language "C#"
2425
end
2526

@@ -33,6 +34,10 @@ local function targetFrameworkVersionPrepare()
3334
dn2005.targetFrameworkVersion(cfg)
3435
end
3536

37+
local function projectConfigurationsPrepare()
38+
dn2005.projectConfigurations(prj)
39+
end
40+
3641
local function prepareNetcore()
3742
dn2005.projectElement(prj)
3843
end
@@ -132,3 +137,14 @@ function suite.allowUnsafeProperty_core()
132137
</PropertyGroup>
133138
]]
134139
end
140+
141+
function suite.project_element_configurations()
142+
p.action.set("vs2022")
143+
dotnetframework "net8.0"
144+
145+
projectConfigurationsPrepare()
146+
147+
test.capture [[
148+
<Configurations>Debug;Release;Distribution</Configurations>
149+
]]
150+
end

modules/vstudio/vs2005_csproj.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
dotnetbase.bindingRedirects,
5353
dotnetbase.netcore.useWpf,
5454
dotnetbase.csversion,
55+
dotnetbase.projectConfigurations,
5556
dotnetbase.netcore.enableDefaultCompileItems,
5657
}
5758
else

modules/vstudio/vs2005_dotnetbase.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,14 @@
8585
_p(1,'</PropertyGroup>')
8686
end
8787

88-
88+
--
89+
-- Write the available configurations to have correct configuration mapping on vs2022 format and later.
90+
--
91+
function dotnetbase.projectConfigurations(prj)
92+
if _ACTION >= "vs2022" and #prj.configurations > 0 then
93+
_p(2, '<Configurations>%s</Configurations>', table.implode(prj.configurations, "", "", ";"))
94+
end
95+
end
8996
--
9097
-- Write out the settings for the project configurations.
9198
--

0 commit comments

Comments
 (0)