Skip to content

Commit

Permalink
Merge pull request #1142 from Blizzard/csver
Browse files Browse the repository at this point in the history
Support for CSDialect
  • Loading branch information
samsinsane committed Aug 10, 2018
2 parents b64a7cc + e152b8b commit 8e02eac
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 2 deletions.
24 changes: 24 additions & 0 deletions modules/vstudio/tests/cs2005/projectsettings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,30 @@
]]
end


--
-- Lang version tests
--

function suite.OnCSVersion()
csversion "6"
prepare()
test.capture [[
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{AE61726D-187C-E440-BD07-2556188A6565}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MyProject</RootNamespace>
<AssemblyName>MyProject</AssemblyName>
<LangVersion>6</LangVersion>
</PropertyGroup>
]]
end


--
-- Make sure the root namespace can be overridden.
Expand Down
3 changes: 2 additions & 1 deletion modules/vstudio/vs2005_csproj.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
dotnetbase.targetFrameworkProfile,
dotnetbase.fileAlignment,
dotnetbase.bindingRedirects,
dotnetbase.projectTypeGuids
dotnetbase.projectTypeGuids,
dotnetbase.csversion
}
end

Expand Down
6 changes: 5 additions & 1 deletion modules/vstudio/vs2005_dotnetbase.lua
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,6 @@
end
end


function dotnetbase.targetFrameworkVersion(cfg)
local action = p.action.current()
local framework = cfg.dotnetframework or action.vstudio.targetFramework
Expand All @@ -696,6 +695,11 @@
end
end

function dotnetbase.csversion(cfg)
if cfg.csversion then
_p(2,'<LangVersion>%s</LangVersion>', cfg.csversion)
end
end

function dotnetbase.targetFrameworkProfile(cfg)
if _ACTION == "vs2010" then
Expand Down
6 changes: 6 additions & 0 deletions src/_premake_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,12 @@
kind = "string",
}

api.register {
name = "csversion",
scope = "config",
kind = "string",
}

api.register {
name = "gccprefix",
scope = "config",
Expand Down

0 comments on commit 8e02eac

Please sign in to comment.