More filtering
This commit is contained in:
parent
75f2c16d80
commit
bfd86d7f2f
@ -9,7 +9,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
<Exec Command="xcopy "$(SolutionDir)Templates" "$(TargetDir)Data" /E /I /Y /D" />
|
<Exec Command="xcopy "$(SolutionDir)Templates" "$(TargetDir)Data" /E /I /Y" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -126,16 +126,27 @@ public class ReCodeItAutoMapper
|
|||||||
{
|
{
|
||||||
// Filter types to the ones we're looking for
|
// Filter types to the ones we're looking for
|
||||||
var mappingPairs = MappingPairs
|
var mappingPairs = MappingPairs
|
||||||
.Where(pair => Settings.TokensToMatch.Any(token => pair.Type.Name.StartsWith(token)))
|
|
||||||
|
|
||||||
// Filter out anything that has the same name as the type, we cant remap those
|
|
||||||
.Where(pair => !Settings.TokensToMatch.Any(token => pair.Name.ToLower().StartsWith(token.ToLower())))
|
|
||||||
|
|
||||||
// Filter based on length, short lengths dont make good class names
|
// Filter based on length, short lengths dont make good class names
|
||||||
.Where(pair => pair.Name.Length >= Settings.MinLengthToMatch)
|
.Where(pair => pair.Name.Length >= Settings.MinLengthToMatch)
|
||||||
|
|
||||||
// Filter based on direct name blacklist
|
// Filter out anything that doesnt start with our specified tokens (Where pair.Type.Name
|
||||||
.Where(pair => !Settings.PropertyFieldBlackList.Any(token => pair.Name.ToLower().StartsWith(token.ToLower())));
|
// is the property Type name `Class1202` and token is start identifer we are looking for `GClass`
|
||||||
|
.Where(pair => Settings.TokensToMatch
|
||||||
|
.Any(token => pair.Type.Name.StartsWith(token)))
|
||||||
|
|
||||||
|
// Filter out anything that has the same name as the type, we cant remap those
|
||||||
|
.Where(pair => !Settings.TokensToMatch
|
||||||
|
.Any(token => pair.Name.ToLower().StartsWith(token.ToLower())))
|
||||||
|
|
||||||
|
// Filter based on direct name blacklist (Where pair.Name is the property name and token
|
||||||
|
// is blacklisted item `Columns`
|
||||||
|
.Where(pair => !Settings.PropertyFieldBlackList
|
||||||
|
.Any(token => pair.Name.ToLower().StartsWith(token.ToLower())))
|
||||||
|
|
||||||
|
// We only want types once, so make it unique
|
||||||
|
.GroupBy(pair => pair.Type.FullName)
|
||||||
|
.Select(group => group.First())
|
||||||
|
.ToList();
|
||||||
|
|
||||||
foreach (var pair in mappingPairs)
|
foreach (var pair in mappingPairs)
|
||||||
{
|
{
|
||||||
|
@ -45,8 +45,9 @@
|
|||||||
"Template",
|
"Template",
|
||||||
"Condition",
|
"Condition",
|
||||||
"Conditions",
|
"Conditions",
|
||||||
"counter",
|
"Counter",
|
||||||
"Instance",
|
"Instance",
|
||||||
|
"Command"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user