Regenerate resx files using ResxFileCodeGenerator
This is a temporary arrangement until we can start generating designer file equivalents from k build. A side-effect of the change is that the generated file will no longer build in CoreCLR profile due to missing API.
This commit is contained in:
parent
27574b1616
commit
37e225d517
|
|
@ -193,20 +193,35 @@ functions
|
||||||
configs["k10"] = new Dictionary<string, object>();
|
configs["k10"] = new Dictionary<string, object>();
|
||||||
configs["net45"] = new Dictionary<string, object>();
|
configs["net45"] = new Dictionary<string, object>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Templates
|
||||||
|
const string csTemplate = @"<Compile Include=""{0}"" />";
|
||||||
|
const string resxDesignerTemplate = @"<Compile Include=""{0}"">
|
||||||
|
<DependentUpon>{1}</DependentUpon>
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
</Compile>";
|
||||||
|
const string resxTemplate = @"<EmbeddedResource Include=""{0}"">
|
||||||
|
<LogicalName>{1}.{2}.resources</LogicalName>
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>{2}.Designer.cs</LastGenOutput>
|
||||||
|
<CustomToolNamespace>{1}.Resources</CustomToolNamespace>
|
||||||
|
</EmbeddedResource>";
|
||||||
|
|
||||||
|
// Build the list of resx files
|
||||||
|
var resxFileNames = FindFilesOfType(projectDir, "*.resx");
|
||||||
|
var resxDesignerFiles = new HashSet<string>(resxFileNames.Select(f => Path.ChangeExtension(f, "Designer.cs")),
|
||||||
|
StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
var resxFiles = String.Join(Environment.NewLine,
|
||||||
|
resxFileNames.Select(p => String.Format(resxTemplate, p, projectName, Path.GetFileNameWithoutExtension(p))));
|
||||||
|
|
||||||
// Build the list of cs files
|
// Build the list of cs files
|
||||||
var csFiles
|
var csFiles
|
||||||
= String.Join(Environment.NewLine,
|
= String.Join(Environment.NewLine,
|
||||||
FindFilesOfType(projectDir, "*.cs")
|
FindFilesOfType(projectDir, "*.cs")
|
||||||
.Select(p => String.Format(@"<Compile Include=""{0}"" />", p)));
|
.Select(p => resxDesignerFiles.Contains(p) ? String.Format(resxDesignerTemplate, p, Path.ChangeExtension(Path.GetFileNameWithoutExtension(p), "resx")) :
|
||||||
|
String.Format(csTemplate, p)));
|
||||||
// Build the list of resx files
|
|
||||||
var resxFiles
|
|
||||||
= String.Join(Environment.NewLine,
|
|
||||||
FindFilesOfType(projectDir, "*.resx")
|
|
||||||
.Select(p => String.Format(@"<EmbeddedResource Include=""{0}"">
|
|
||||||
<LogicalName>{1}.{2}.resources</LogicalName>
|
|
||||||
</EmbeddedResource>", p, projectName, Path.GetFileNameWithoutExtension(p))));
|
|
||||||
|
|
||||||
bool isSample = Path.GetDirectoryName(projectDir)
|
bool isSample = Path.GetDirectoryName(projectDir)
|
||||||
.TrimEnd(Path.DirectorySeparatorChar)
|
.TrimEnd(Path.DirectorySeparatorChar)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue