From adce554d533f14749053e52cd347c3556102393c Mon Sep 17 00:00:00 2001 From: jimstitt Date: Fri, 17 Jan 2014 23:05:54 -0500 Subject: Add support for xaml extension. --- src/actions/vstudio/vs2005_csproj.lua | 16 ++++++++++++++++ src/tools/dotnet.lua | 7 ++++++- 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/actions/vstudio/vs2005_csproj.lua b/src/actions/vstudio/vs2005_csproj.lua index c4fc815..36a9ea8 100644 --- a/src/actions/vstudio/vs2005_csproj.lua +++ b/src/actions/vstudio/vs2005_csproj.lua @@ -33,6 +33,13 @@ if premake.findfile(prj, testname) then return "AutoGen", testname end + elseif fname:endswith(".xaml.cs") then + -- is there a matching *.cs file? + local basename = fname:sub(1, -9) + local testname = basename .. ".xaml" + if premake.findfile(prj, testname) then + return "SubTypeCode", testname + end else -- is there a *.Designer.cs file? local basename = fname:sub(1, -4) @@ -61,6 +68,10 @@ end end end + + if fname:endswith(".xaml") then + return "XamlDesigner" + end if action == "Content" then return "CopyNewest" @@ -107,6 +118,11 @@ _p(' Designer') elseif elements == "SubTypeForm" then _p(' Form') + elseif elements == "SubTypeCode" then + _p(' Code') + elseif elements == "XamlDesigner" then + _p(' Designer') + _p(' MSBuild:Compile') elseif elements == "PreserveNewest" then _p(' PreserveNewest') end diff --git a/src/tools/dotnet.lua b/src/tools/dotnet.lua index 69feffa..c52d326 100644 --- a/src/tools/dotnet.lua +++ b/src/tools/dotnet.lua @@ -3,7 +3,6 @@ -- Interface for the C# compilers, all of which are flag compatible. -- Copyright (c) 2002-2009 Jason Perkins and the Premake project -- - premake.dotnet = { } premake.dotnet.namestyle = "windows" @@ -36,6 +35,12 @@ return "EmbeddedResource" elseif fcfg.buildaction == "Copy" or ext == ".asax" or ext == ".aspx" then return "Content" + elseif fcfg.buildaction == "Page" or ext == ".xaml" then + if ( path.getname( fcfg.name ) == "App.xaml" ) then + return "ApplicationDefinition" + else + return "Page" + end else return "None" end -- cgit v1.2.3