diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-03-09 02:27:58 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-03-09 02:27:58 +0200 |
| commit | eb793f20dc078a304a423a481e5bb0eddce71471 (patch) | |
| tree | ca7b60be7b2d588875017b3885ba3d3cd3f893f9 /Software/Visual_Studio/Tango.PMR | |
| parent | 1b5d452cccd3be79c226f1438c3efe7abe786017 (diff) | |
| parent | ae9cdafa944db884bf878f36a7a328c53a7588a8 (diff) | |
| download | Tango-eb793f20dc078a304a423a481e5bb0eddce71471.tar.gz Tango-eb793f20dc078a304a423a481e5bb0eddce71471.zip | |
MERGE
Diffstat (limited to 'Software/Visual_Studio/Tango.PMR')
| -rw-r--r-- | Software/Visual_Studio/Tango.PMR/ExtensionMethods/VersionPackageDescriptorExtensions.cs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/Software/Visual_Studio/Tango.PMR/ExtensionMethods/VersionPackageDescriptorExtensions.cs b/Software/Visual_Studio/Tango.PMR/ExtensionMethods/VersionPackageDescriptorExtensions.cs index 78b179736..766b03270 100644 --- a/Software/Visual_Studio/Tango.PMR/ExtensionMethods/VersionPackageDescriptorExtensions.cs +++ b/Software/Visual_Studio/Tango.PMR/ExtensionMethods/VersionPackageDescriptorExtensions.cs @@ -25,20 +25,21 @@ public static class VersionPackageDescriptorExtensions throw new InvalidDataException("TFP package contains multiple MCU files."); } - var mcuFile = descriptor.FileDescriptors.SingleOrDefault(x => x.Destination == VersionFileDestination.Mcu); - - if (String.IsNullOrWhiteSpace(mcuFile.Version)) + if (descriptor.FileDescriptors.GroupBy(x => x.FileName).Any(x => x.Count() > 1)) { - throw new InvalidDataException("TFP package MCU does specify any version."); + throw new InvalidDataException("The TPF package cannot contain duplicate file names."); } - try - { - Version.Parse(mcuFile.Version); - } - catch + foreach (var item in descriptor.FileDescriptors) { - throw new InvalidDataException($"TFP package MCU version '{mcuFile.Version}' is invalid."); + try + { + Version.Parse(item.Version); + } + catch + { + throw new InvalidDataException($"Invalid version ({item.Version}) for file '{item.FileName}'."); + } } } |
