Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions/vstudio/vs2005_csproj.lua')
-rw-r--r--src/actions/vstudio/vs2005_csproj.lua65
1 files changed, 39 insertions, 26 deletions
diff --git a/src/actions/vstudio/vs2005_csproj.lua b/src/actions/vstudio/vs2005_csproj.lua
index c5ec9b5..c4fc815 100644
--- a/src/actions/vstudio/vs2005_csproj.lua
+++ b/src/actions/vstudio/vs2005_csproj.lua
@@ -16,10 +16,10 @@
--
-- Figure out what elements a particular source code file need in its item
-- block, based on its build action and any related files in the project.
---
-
+--
+
local function getelements(prj, action, fname)
-
+
if action == "Compile" and fname:endswith(".cs") then
if fname:endswith(".Designer.cs") then
-- is there a matching *.cs file?
@@ -61,18 +61,18 @@
end
end
end
-
+
if action == "Content" then
return "CopyNewest"
end
-
+
return "None"
end
--
-- Return the Visual Studio architecture identification string. The logic
--- to select this is getting more complicated in VS2010, but I haven't
+-- to select this is getting more complicated in VS2010, but I haven't
-- tackled all the permutations yet.
--
@@ -125,16 +125,17 @@
--
function cs2005.projectelement(prj)
- local toolversion = {
- vs2005 = '',
- vs2008 = ' ToolsVersion="3.5"',
- vs2010 = ' ToolsVersion="4.0"',
- }
+ local action = premake.action.current()
+
+ local toolversion = ''
+ if action.vstudio.toolsVersion then
+ toolversion = string.format(' ToolsVersion="%s"', action.vstudio.toolsVersion)
+ end
if _ACTION > "vs2008" then
_p('<?xml version="1.0" encoding="utf-8"?>')
end
- _p('<Project%s DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">', toolversion[_ACTION])
+ _p('<Project%s DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">', toolversion)
end
@@ -143,33 +144,38 @@
--
function cs2005.projectsettings(prj)
- local version = {
- vs2005 = '8.0.50727',
- vs2008 = '9.0.21022',
- vs2010 = '8.0.30703',
- }
-
_p(' <PropertyGroup>')
_p(' <Configuration Condition=" \'$(Configuration)\' == \'\' ">%s</Configuration>', premake.esc(prj.solution.configurations[1]))
_p(' <Platform Condition=" \'$(Platform)\' == \'\' ">%s</Platform>', cs2005.arch(prj))
- _p(' <ProductVersion>%s</ProductVersion>', version[_ACTION])
- _p(' <SchemaVersion>2.0</SchemaVersion>')
+
+ local action = premake.action.current()
+ if action.vstudio.productVersion then
+ _p(' <ProductVersion>%s</ProductVersion>', action.vstudio.productVersion)
+ end
+
+ if _ACTION < "vs2012" then
+ _p(' <SchemaVersion>2.0</SchemaVersion>')
+ end
+
_p(' <ProjectGuid>{%s}</ProjectGuid>', prj.uuid)
_p(' <OutputType>%s</OutputType>', premake.dotnet.getkind(prj))
_p(' <AppDesignerFolder>Properties</AppDesignerFolder>')
_p(' <RootNamespace>%s</RootNamespace>', prj.buildtarget.basename)
_p(' <AssemblyName>%s</AssemblyName>', prj.buildtarget.basename)
- local framework = prj.framework or iif(_ACTION == "vs2010", "4.0", nil)
+ local framework = prj.framework or action.vstudio.targetFramework
if framework then
_p(' <TargetFrameworkVersion>v%s</TargetFrameworkVersion>', framework)
end
- if _ACTION == "vs2010" then
- _p(' <TargetFrameworkProfile>Client</TargetFrameworkProfile>')
+ if _ACTION == 'vs2010' then
+ _p(' <TargetFrameworkProfile></TargetFrameworkProfile>')
+ end
+
+ if _ACTION >= "vs2010" then
_p(' <FileAlignment>512</FileAlignment>')
end
-
+
_p(' </PropertyGroup>')
end
@@ -194,6 +200,11 @@
io.eol = "\r\n"
cs2005.projectelement(prj)
+
+ if _ACTION > "vs2010" then
+ _p(' <Import Project="$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props" Condition="Exists(\'$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\')" />')
+ end
+
cs2005.projectsettings(prj)
for cfg in premake.eachconfig(prj) do
@@ -235,7 +246,9 @@
cs2005.files(prj)
_p(' </ItemGroup>')
- _p(' <Import Project="$(MSBuildBinPath)\\Microsoft.CSharp.targets" />')
+ local msbuild = iif(_ACTION < "vs2012", "Bin", "Tools")
+ _p(' <Import Project="$(MSBuild%sPath)\\Microsoft.CSharp.targets" />', msbuild)
+
_p(' <!-- To modify your build process, add your task inside one of the targets below and uncomment it.')
_p(' Other similar extension points exist, see Microsoft.Common.targets.')
_p(' <Target Name="BeforeBuild">')
@@ -244,6 +257,6 @@
_p(' </Target>')
_p(' -->')
_p('</Project>')
-
+
end