Merge pull request #439 from LORgames/ssurtees/schemaFiles

Added support for schema files in C# projects
This commit is contained in:
Jason Perkins 2016-02-29 08:22:18 -05:00
commit 0b6ad5b532
2 changed files with 72 additions and 1 deletions

View File

@ -62,7 +62,7 @@
if fname:endswith(".Designer.cs") then
local basename = fname:sub(1, -13)
-- Look for associated files: .resx, .settings, .cs
-- Look for associated files: .resx, .settings, .cs, .xsd
local testname = basename .. ".resx"
if project.hasfile(fcfg.project, testname) then
info.AutoGen = "True"
@ -83,6 +83,13 @@
info.DependentUpon = testname
end
testname = basename .. ".xsd"
if project.hasfile(fcfg.project, testname) then
info.AutoGen = "True"
info.DesignTime = "True"
info.DependentUpon = testname
end
elseif fname:endswith(".xaml.cs") then
info.SubType = "Code"
info.DependentUpon = fname:sub(1, -4)
@ -147,6 +154,22 @@
end
end
if info.action == "None" and fname:endswith(".xsd") then
local testname = fname:sub(1, -5) .. ".Designer.cs"
if project.hasfile(fcfg.project, testname) then
info.SubType = "Designer"
info.Generator = "MSDataSetGenerator"
info.LastGenOutput = path.getname(testname)
end
end
if info.action == "None" and (fname:endswith(".xsc") or fname:endswith(".xss")) then
local testname = fname:sub(1, -5) .. ".xsd"
if project.hasfile(fcfg.project, testname) then
info.DependentUpon = testname
end
end
if fname:endswith(".xaml") then
local testname = fname .. ".cs"
if project.hasfile(fcfg.project, testname) then

View File

@ -82,6 +82,37 @@
]]
end
function suite.datasetDesignerDependency()
files { "DataSet.xsd", "DataSet.Designer.cs" }
prepare()
test.capture [[
<Compile Include="DataSet.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>DataSet.xsd</DependentUpon>
</Compile>
<None Include="DataSet.xsd">
<Generator>MSDataSetGenerator</Generator>
<LastGenOutput>DataSet.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</None>
]]
end
function suite.datasetDependencies()
files { "DataSet.xsd", "DataSet.xsc", "DataSet.xss" }
prepare()
test.capture [[
<None Include="DataSet.xsc">
<DependentUpon>DataSet.xsd</DependentUpon>
</None>
<None Include="DataSet.xsd" />
<None Include="DataSet.xss">
<DependentUpon>DataSet.xsd</DependentUpon>
</None>
]]
end
--
-- File associations should always be made relative to the file
@ -99,6 +130,23 @@
]]
end
function suite.datasetDependency_inSubfolder()
files { "DataSets/DataSet.xsd", "DataSets/DataSet.Designer.cs" }
prepare()
test.capture [[
<Compile Include="DataSets\DataSet.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>DataSet.xsd</DependentUpon>
</Compile>
<None Include="DataSets\DataSet.xsd">
<Generator>MSDataSetGenerator</Generator>
<LastGenOutput>DataSet.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</None>
]]
end
--
-- Test build actions.