Merge pull request #830 from Blizzard/resource-generator-access

Resource generator access
This commit is contained in:
Tom van Dijck 2017-06-21 09:36:29 -07:00 committed by GitHub
commit 5b8a3d26eb
3 changed files with 38 additions and 1 deletions

View File

@ -80,6 +80,25 @@
end
function suite.publicResourceDesignerDependency()
files { "Resources.resx", "Resources.Designer.cs" }
resourcegenerator 'public'
prepare()
test.capture [[
<Compile Include="Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<EmbeddedResource Include="Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
]]
end
function suite.settingsDesignerDependency()
files { "Properties/Settings.settings", "Properties/Settings.Designer.cs" }
prepare()

View File

@ -1001,6 +1001,16 @@
tokens = true,
}
api.register {
name = "resourcegenerator",
scope = "project",
kind = "string",
allowed = {
"internal",
"public"
}
}
api.register {
name = "rtti",
scope = "config",

View File

@ -160,7 +160,15 @@
testname = basename .. ".Designer.cs"
if project.hasfile(fcfg.project, testname) then
info.SubType = "Designer"
info.Generator = "ResXFileCodeGenerator"
local resourceAccessGenerator = "ResXFileCodeGenerator"
if fcfg.project.resourcegenerator then
if fcfg.project.resourcegenerator == "public" then
resourceAccessGenerator = "PublicResXFileCodeGenerator"
end
end
info.Generator = resourceAccessGenerator
info.LastGenOutput = path.getname(testname)
end
end