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.tmpl')
-rw-r--r--src/actions/vstudio/vs2005_csproj.tmpl159
1 files changed, 159 insertions, 0 deletions
diff --git a/src/actions/vstudio/vs2005_csproj.tmpl b/src/actions/vstudio/vs2005_csproj.tmpl
new file mode 100644
index 0000000..3026307
--- /dev/null
+++ b/src/actions/vstudio/vs2005_csproj.tmpl
@@ -0,0 +1,159 @@
+<%
+ eol = "\r\n"
+ local csc = premake.csc
+
+ -- translate the action to a Visual Studio version number
+ local vsversion
+ if _ACTION == "vs2005" then
+ vsversion = "8.0.50727"
+ elseif _ACTION == "vs2008" then
+ vsversion = "9.0.50727"
+ end
+
+
+ --
+ -- Figure out what elements a particular file need in its item block,
+ -- based on its build action and any related files in the project.
+ --
+
+ 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?
+ local basename = fname:sub(1, -13)
+ local testname = basename .. ".cs"
+ if premake.findfile(prj, testname) then
+ return "Dependency", testname
+ end
+ -- is there a matching *.resx file?
+ testname = basename .. ".resx"
+ if premake.findfile(prj, testname) then
+ return "AutoGen", testname
+ end
+ else
+ -- is there a *.Designer.cs file?
+ local basename = fname:sub(1, -4)
+ local testname = basename .. ".Designer.cs"
+ if premake.findfile(prj, testname) then
+ return "SubTypeForm"
+ end
+ end
+ end
+
+ if action == "EmbeddedResource" and fname:endswith(".resx") then
+ -- is there a matching *.cs file?
+ local basename = fname:sub(1, -6)
+ local testname = path.getname(basename .. ".cs")
+ if premake.findfile(prj, testname) then
+ if premake.findfile(prj, basename .. ".Designer.cs") then
+ return "DesignerType", testname
+ else
+ return "Dependency", testname
+ end
+ else
+ -- is there a matching *.Designer.cs?
+ testname = path.getname(basename .. ".Designer.cs")
+ if premake.findfile(prj, testname) then
+ return "AutoGenerated"
+ end
+ end
+ end
+
+ if action == "Content" then
+ return "CopyNewest"
+ end
+
+ return "None"
+ end
+
+ -- end of preprocessing; template starts here --
+%>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' "><%= premake.esc(this.solution.configurations[1]) %></Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion><%= vsversion %></ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{<%= this.uuid %>}</ProjectGuid>
+ <OutputType><%= csc.getkind(this) %></OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace><%= this.buildtarget.basename %></RootNamespace>
+ <AssemblyName><%= this.buildtarget.basename %></AssemblyName>
+ </PropertyGroup>
+ <% for cfg in premake.eachconfig(this) do %>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == '<%= premake.esc(cfg.name) %>|AnyCPU' ">
+ <% if cfg.flags.Symbols then %>
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <% else %>
+ <DebugType>pdbonly</DebugType>
+ <% end %>
+ <Optimize><%= iif(cfg.flags.Optimize or cfg.flags.OptimizeSize or cfg.flags.OptimizeSpeed, "true", "false") %></Optimize>
+ <OutputPath><%= cfg.buildtarget.directory %></OutputPath>
+ <DefineConstants><%= table.concat(premake.esc(cfg.defines), ";") %></DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <% if cfg.flags.Unsafe then %>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <% end %>
+ <% if cfg.flags.FatalWarnings then %>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ <% end %>
+ </PropertyGroup>
+ <% end %>
+ <ItemGroup>
+ <% for _, prj in ipairs(premake.getlinks(this, "siblings", "object")) do %>
+ <ProjectReference Include="<%= path.translate(path.getrelative(this.location, _VS.projectfile(prj)), "\\") %>">
+ <Project>{<%= prj.uuid %>}</Project>
+ <Name><%= premake.esc(prj.name) %></Name>
+ </ProjectReference>
+ <% end %>
+ <% for _, linkname in ipairs(premake.getlinks(this, "system", "basename")) do %>
+ <Reference Include="<%= premake.esc(linkname) %>" />
+ <% end %>
+ </ItemGroup>
+ <ItemGroup>
+ <%
+ for fcfg in premake.eachfile(this) do
+ local action = csc.getbuildaction(fcfg)
+ local fname = path.translate(premake.esc(fcfg.name), "\\")
+ local elements, dependency = getelements(this, action, fcfg.name)
+ if elements == "None" then
+ %>
+ <<%= action %> Include="<%= fname %>" />
+ <%
+ else
+ %>
+ <<%= action %> Include="<%= fname %>">
+ <% if elements == "AutoGen" then %>
+ <AutoGen>True</AutoGen>
+ <% elseif elements == "AutoGenerated" then %>
+ <SubType>Designer</SubType>
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput><%= premake.esc(path.getbasename(fcfg.name)) %>.Designer.cs</LastGenOutput>
+ <% elseif elements == "SubTypeDesigner" then %>
+ <SubType>Designer</SubType>
+ <% elseif elements == "SubTypeForm" then %>
+ <SubType>Form</SubType>
+ <% elseif elements == "PreserveNewest" then %>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ <% end %>
+ <% if dependency then %>
+ <DependentUpon><%= path.translate(premake.esc(dependency), "\\") %></DependentUpon>
+ <% end %>
+ </<%= action %>>
+ <%
+ end
+ end
+ %>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>