Skip to content

Commit

Permalink
updated dotnetbase to generate configurations list in opening propert… (
Browse files Browse the repository at this point in the history
#2320)

* updated dotnetbase to generate configurations list in opening propertygroup containing project properties

---------

Co-authored-by: Beernaert Robbe <robbe.beernaert@student.howest.be>
  • Loading branch information
lolrobbe2 and Beernaert Robbe authored Nov 22, 2024
1 parent 6f0cb4a commit fc06984
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
16 changes: 16 additions & 0 deletions modules/vstudio/tests/cs2005/test_netcore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ local wks, prj
function suite.setup()
p.action.set("vs2005")
wks, prj = test.createWorkspace()
configurations { "Debug", "Release", "Distribution"}
language "C#"
end

Expand All @@ -33,6 +34,10 @@ local function targetFrameworkVersionPrepare()
dn2005.targetFrameworkVersion(cfg)
end

local function projectConfigurationsPrepare()
dn2005.projectConfigurations(prj)
end

local function prepareNetcore()
dn2005.projectElement(prj)
end
Expand Down Expand Up @@ -132,3 +137,14 @@ function suite.allowUnsafeProperty_core()
</PropertyGroup>
]]
end

function suite.project_element_configurations()
p.action.set("vs2022")
dotnetframework "net8.0"

projectConfigurationsPrepare()

test.capture [[
<Configurations>Debug;Release;Distribution</Configurations>
]]
end
1 change: 1 addition & 0 deletions modules/vstudio/vs2005_csproj.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
dotnetbase.bindingRedirects,
dotnetbase.netcore.useWpf,
dotnetbase.csversion,
dotnetbase.projectConfigurations,
dotnetbase.netcore.enableDefaultCompileItems,
}
else
Expand Down
9 changes: 8 additions & 1 deletion modules/vstudio/vs2005_dotnetbase.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,14 @@
_p(1,'</PropertyGroup>')
end


--
-- Write the available configurations to have correct configuration mapping on vs2022 format and later.
--
function dotnetbase.projectConfigurations(prj)
if _ACTION >= "vs2022" and #prj.configurations > 0 then
_p(2, '<Configurations>%s</Configurations>', table.implode(prj.configurations, "", "", ";"))
end
end
--
-- Write out the settings for the project configurations.
--
Expand Down

0 comments on commit fc06984

Please sign in to comment.