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

.net standard 2.0 support #45

Merged
merged 76 commits into from
Sep 24, 2017
Merged

.net standard 2.0 support #45

merged 76 commits into from
Sep 24, 2017

Conversation

jumpinjackie
Copy link
Owner

@jumpinjackie jumpinjackie commented Sep 24, 2017

netstandard2.0 support for

  • OSGeo.FDO.Expressions
  • OSGeo.MapGuide.ObjectModels
  • OSGeo.MapGuide.MaestroAPI
  • Above projects also multi-target and targets net461 in addition to netstandard2.0
    • Needed to workaround issues around strong naming (.net Core doesn't support it, but our whole dependency chain on full framework does)
  • NuGet package support for these libraries
  • Fixes netstandard-ization #23

Other changes:

  • New full-framework-only OSGeo.MapGuide.MaestroAPI.FxBridge project where netstandard2.0 incompatible code has been relocated to. Mainly involves code that uses types from System.Drawing
  • HTTP provider no longer exists as a separate project/assembly. It has been integrated into MaestroAPI itself. ConnectionProviders.xml is only required if using the local (mg-desktop) provider or using a tool-generated (ie. ProviderTemplate) wrapper provider around the official MapGuide .net API.
  • Internalize a whole bunch of classes that should not be public
  • Make use of Microsoft.IO.RecyclableMemoryStream to pool most usages of System.IO.MemoryStream in MaestroAPI/ObjectModels to reduce heap fragmentation and GC pressure.
  • Restore/Re-activate integration tests. Fixes Restore integration test capabilities #35
  • Maestro (the windows desktop application) and supporting full-framework class libraries now targets .net Framework 4.6.1 as a minimum
  • SDK package no longer produced as consumption of MaestroAPI should be done through NuGet packages

Baseline target for this project is netstandard1.6 (same as the .net core compatible port of Irony its referencing)
The previous attempt at this was targeting netstandard1.6, which required pulling in 50 bajillion NuGet packages to fill in the missing bits.

This attempt targets netstandard2.0. Besides replacing System.Drawing.Font with a custom struct that carries the same information, everything else built without errors. Yay!
Like the ObjectModels conversion, targeting netstandard2.0 was mostly seamless with the small change of:
  1. Needing to move ImageSymbolConverter out to its own full framework class library (OSGeo.MapGuide.MaestroAPI.FxBridge) where we can reference System.Drawing
  2. Commenting out testing for raster type (that used the CLR type of Bitmap, which doesn't exist in netstandard2.0) in RuntimeMapLayer.cs
  3. Have IMappingService.GetLegendImage and its implementations return a raw System.IO.Stream instead of System.Drawing.Image (that is not present in netstandard2.0)
  4. Remove or replace references to anything under System.Drawing
…is is a pre-requisite to consume netstandard2.0 libraries, of which MaestroAPI is now one of.

Also move ImageSymbolConverter to Maestro.Editors. The FxBridge project is now strictly a series of extension method classes to polyfill APIs that were renamed or removed.
- Add references to upstream dependencies in the test projects. This is a full-framework workaround to allow our existing test projects to be executable in the VS test explorer and hopefully allow our existing full-framework testing infrastructure to work as before.
- Add missing shared assembly info source files to the converted netstandard projects.
- Move OSGeo.FDO.Expressions up to netstandard2.0. This is needed to allow the referencing (full-framework) test project to fully pass. When OSGeo.FDO.Expressions was at netstandard1.6, it leaked out a required dependency to System.Runtime, which broke a few tests due to assembly manifest mismatch BS if referenced from the (full-framework) test project.
…version that is aware of netstandard2.0 support
 - Download NuGet v4.3.0 client before running "nuget restore". This is the version that is netstandard2.0 aware and it not yet incorporated into the AppVeyor build images
 - Fix up OSGeo.MapGuide.MaestroAPI.Local.csproj in release configuration
…at was previously compatbility errors downgraded to the expected NU1701 warning), install the SHFB tools to ensure API docs can build again
- Disable building the SDK package parts for now. In light of netstandard support, this will need revising. We probably don't even need a SDK package anymore and just serve everything through NuGet packages.
- Similarly, modify Doc/MaestroAPI.shfbproj to reduce the API documentation surface area. This is a stopgap measure until we look at an alternative documentation system. The only reason we needed SHFB was to produce CHM files, which serves as a nice documentation artifact to bundle into the SDK package. But since the SDK package may no longer be required, it means that SHFB could also be on the chopping block too.
- Update installer to:
  - Just add files by wildcards (due to the explosion of dlls due to the piecemeal System.* nuget packages brought on by the netstandard libraries).
  - Require .net Framework 4.6.1. This is the full framework version that supports the .net standard 2.0 API surface.
…undant and all these files have been removed.

- Fix various postbuilds to reference the machine-local nuget package cache path (as that's where all nuget packages are now installed to)
- Reference netstandard (prerelease) versions of GeoAPI, NetTopologySuite and ProjNet
- Update DockPanelSuite to 3.0.0
# Conflicts:
#	MaestroAPITests/MaestroAPITests.csproj
#	MaestroAPITests/packages.config
#	OSGeo.MapGuide.MaestroAPI.Http/OSGeo.MapGuide.MaestroAPI.Http.csproj
#	OSGeo.MapGuide.MaestroAPI.Local/OSGeo.MapGuide.MaestroAPI.Local.csproj
#	OSGeo.MapGuide.MaestroAPI.Local/packages.config
#	OSGeo.MapGuide.MaestroAPI.Native/OSGeo.MapGuide.MaestroAPI.Native32-2.2.0.csproj
#	OSGeo.MapGuide.MaestroAPI.Tests/OSGeo.MapGuide.MaestroAPI.Tests.csproj
#	OSGeo.MapGuide.MaestroAPI.Tests/packages.config
#	OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj
#	OSGeo.MapGuide.MaestroAPI/Utility.cs
- Fix the signing key path to be project-relative instead of solution-relative
…e> instead of Dictionary<string, IResource>

For the HTTP implementation, use Parallel.ForEach in conjunction with ConcurrentDictionary<string, IResource> instead of using ThreadPool.QueueUserWorkItem()
…ution root (instead of some place in appdata)

  - Fix postbuild events of various projects now that nuget packages are back inside the solution root.
- Change output paths of various projects back to bin\[Debug|Release] as we no longer will be making a SDK package
- Add unittest.bat to easily run unit tests on Windows
- Attempt to fix appveyor.yml
  - Remove SDK package building
  - Remove API documentation generation
  - Disable OpenCover and just run the unit tests as-is
… of transitive dependencies (brought by the switch over to PackageReferences)
…e start publishing to NuGet gallery as prerelease packages)
…gain if we hit it with xunit console runner against the full framework test assemblies. So restore this functionality.
YAML, where 2 stray spaces breaks the file validity. What a stupid markup language!
 - Undocumented API members
 - Un-used usings
 - Classes that should be internal instead of public
@jumpinjackie jumpinjackie added this to the 6.0m8 milestone Sep 24, 2017
@jumpinjackie jumpinjackie self-assigned this Sep 24, 2017
@jumpinjackie jumpinjackie merged commit 587a6bd into master Sep 24, 2017
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.

None yet

1 participant