Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for CSDialect #1142

Merged
merged 1 commit into from
Aug 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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


Copy link
Member

Choose a reason for hiding this comment

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

I'm fairly certain that there's normally two lines between functions. This also applies to the new lines below for dotnetbase.csversion.

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",
Copy link
Member

Choose a reason for hiding this comment

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

These are supposed to be in alphabetical order, I think dotnetframework was renamed from framework which is why it's here and not up with the other d* APIs.

scope = "config",
kind = "string",
}

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