Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch Source Generator To Newtonsoft #28

Merged
merged 1 commit into from
Aug 15, 2023
Merged

Switch Source Generator To Newtonsoft #28

merged 1 commit into from
Aug 15, 2023

Conversation

Axemasta
Copy link
Owner

See #27, the source generation wasn't working when referencing the nuget package (local ref works perferctly).

Upon further inspection the following error is logged in visual studio:

Severity	Code	Description	Project	File	Line	Suppression State	Detail Description
Warning	CS8785	Generator 'LocalizationKeySourceGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'FileNotFoundException' with message 'Could not load file or assembly 'System.Text.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'	Mocale.Samples (net7.0-android)	C:\Dev\GitHub\Mocale\samples\Mocale.Samples\CSC	1	Active	Generator threw the following exception:
'{0}'.

I took a look at fiddling with dependencies but after reading this SO thread and seeing the utter headache ahead of me, I decided to keep it simple and replace System.Text.Json with Newtonsoft.Json. I'm trying to use the system package going forwards but with the multiple dependencies and difficulty tracking this issue down, I'd rather have a working package and a good nights sleep!

Tested working with a private nuget feed so going to release this fix.

There is an issue with system.text.json failing to load at runtime, quite frankly i think its a POS and has been a huge headache. Going back to the good old newtsonsoft to see if this fixes the issue
@github-actions
Copy link

File Coverage Lines Branches Missing
All files 26% 23% 28%
Mocale.Cache.SQLite\MocaleBuilderExtension.cs 0% 0% 100% 11-33
Mocale.Cache.SQLite\Repositories\CacheRepository.cs 0% 0% 0% 13-94
Mocale.Cache.SQLite\Repositories\RepositoryBase.cs 0% 0% 100% 6-18
Mocale.Cache.SQLite\Repositories\TranslationsRepository.cs 0% 0% 0% 12-163
Mocale.Cache.SQLite\Providers\DatabaseConnectionProvider.cs 0% 0% 100% 16-50
Mocale.Cache.SQLite\Providers\DatabasePathProvider.cs 0% 0% 100% 8-18
Mocale.Cache.SQLite\Models\SqliteConfig.cs 0% 0% 100% 5-9
Mocale.Cache.SQLite\Managers\LocalisationCacheManager.cs 0% 0% 0% 18-55
Mocale.Cache.SQLite\Managers\SqlCacheUpdateManager.cs 0% 0% 0% 15-78
Mocale.Cache.SQLite\Entities\TranslationItem.cs 0% 0% 100% 10-16
Mocale.Cache.SQLite\Entities\UpdateHistoryItem.cs 0% 0% 100% 10-14
Mocale\AppBuilderExtensions.cs 0% 0% 0% 14-61
Mocale\MocaleBuilder.cs 0% 0% 0% 6-30
Mocale\MocaleBuilderExtensions.cs 0% 0% 0% 9-72
Mocale\MocaleInitializeService.cs 0% 0% 100% 6-13
Mocale\MocaleLocator.cs 0% 0% 100% 31-42
Mocale\Wrappers\DateTimeWrapper.cs 0% 0% 100% 10
Mocale\Providers\EmbeddedResourceProvider.cs 0% 0% 0% 12-98
Mocale\Providers\ResxResourceProvider.cs 0% 0% 0% 14-66
Mocale\Models\AppResourcesConfig.cs 0% 0% 100% 8
Mocale\Models\EmbeddedResourcesConfig.cs 0% 0% 100% 6-10
Mocale\Models\MocaleConfiguration.cs 91% 83% 100% 7
Mocale\Managers\ConfigurationManager.cs 0% 0% 100% 11-21
Mocale\Managers\TranslationResolver.cs 0% 0% 0% 19-180
Mocale\Managers\TranslationResolver.cs 0% 0% 100% 100-116
Mocale\Managers\TranslationResolver.cs 0% 0% 0% 38-92
Mocale\Managers\TranslatorManager.cs 93% 93% 93% 41 102 121
Mocale\Extensions\DictionaryExtension.cs 95% 100% 90%
Mocale\Extensions\LocalizeExtension.cs 0% 0% 100% 9-37
Mocale\Extensions\TaskExtensions.cs 87% 100% 75%
Mocale\Extensions\UriExtension.cs 62% 25% 100% 12-25
Mocale\Exceptions\InitializationException.cs 0% 0% 100% 6-8
Mocale\Exceptions\MocaleException.cs 0% 0% 100% 6-13
Mocale.Providers.Aws.S3\MocaleBuilderExtension.cs 0% 0% 100% 8-20
Mocale.Providers.Aws.S3\S3BucketProvider.cs 0% 0% 0% 11-49
Mocale.Providers.Aws.S3\Models\BucketConfig.cs 0% 0% 100% 5
Mocale.Providers.Azure.Blob\BlobLocalizationProvider.cs 0% 0% 100% 19-35
Mocale.Providers.Azure.Blob\BlobLocalizationProvider.cs 0% 0% 0% 42-70
Mocale.Providers.Azure.Blob\BlobLocalizationProvider.cs 0% 0% 0% 101-132
Mocale.Providers.Azure.Blob\BlobLocalizationProvider.cs 0% 0% 0% 73-94
Mocale.Providers.Azure.Blob\MocaleBuilderExtension.cs 0% 0% 0% 10-28
Mocale.Providers.Azure.Blob\Models\BlobResourceInfo.cs 0% 0% 100% 5-7
Mocale.Providers.Azure.Blob\Models\BlobStorageConfig.cs 0% 0% 100% 8-20
Mocale.Providers.Azure.Blob\Managers\BlobResourceLocator.cs 0% 0% 0% 21-56
Mocale.Providers.Azure.Blob\Managers\BlobResourceLocator.cs 0% 0% 0% 64-90
Mocale.Providers.Github.Raw\GitHubRawProvider.cs 85% 71% 100% 40-44
Mocale.Providers.Github.Raw\GitHubRawProvider.cs 44% 39% 50% 53-60 68-74 82-90
Mocale.Providers.Github.Raw\MocaleBuilderExtension.cs 0% 0% 0% 8-29

Minimum allowed coverage is 5%

Generated by 🐒 cobertura-action against 5c015eb

@Axemasta Axemasta merged commit 9cd54d3 into main Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant