Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Refactor Library Export process #2226

Closed
analogrelay opened this issue Jul 9, 2015 · 3 comments
Closed

Refactor Library Export process #2226

analogrelay opened this issue Jul 9, 2015 · 3 comments

Comments

@analogrelay
Copy link
Contributor

Switch from ILibraryExportProviders to a single LibraryExporter class which understands a fixed set of Library types.

@analogrelay analogrelay added this to the 1.0.0-beta6 milestone Jul 9, 2015
@analogrelay analogrelay self-assigned this Jul 9, 2015
@muratg muratg modified the milestones: 1.0.0-beta7, 1.0.0-beta6 Jul 13, 2015
@analogrelay
Copy link
Contributor Author

In this, we should also split the LibraryManager implementation class

analogrelay added a commit that referenced this issue Jul 28, 2015
analogrelay added a commit that referenced this issue Jul 30, 2015
analogrelay added a commit that referenced this issue Jul 30, 2015
@analogrelay
Copy link
Contributor Author

/cc @davidfowl @lodejard

I'm going to do this in phases (but all still in beta7, though some phases could be bumped if necessary for time).

Phase 1

Split LibraryExporter out of LibraryManager (to match the interfaces), but keep it in the runtime. Also some small renames/renamespacing. Mostly just Microsoft.Dnx.Compilation.Caching -> Microsoft.Dnx.Compilation\Caching (i.e. rename the project, since non-caching things will be joining it)

Phase 2

Remove ILibraryExportProvider. Instead, we will have dependency providers create sub-classes of LibraryDescription (the internal type used to represent a library). Then, LibraryExporter will have a reference to the Runtime's LibraryManager (the concrete type) and use it to retrieve the strongly-typed LibraryDescriptions. The exporter will use the data in the LibraryDescription to export the library, using either virtual methods or down-casting. The loaders will also be factored to use this data, and thus the Project loader will move to Compilation. In theory, the project resolver could also move...

Phase 3

Move LibraryExporter and friends to Microsoft.Dnx.Compilation. This will mean Compilation will be coupled to Runtime, since it needs to use LibraryDescription and LibraryManager (which are in Runtime). However, this makes sense to me since Compilation is tightly coupled to Runtime. Whereas the Runtime is not tightly coupled to Compilation (i.e. the runtime could operate without the compilers). As part of this, we'll need to work out a way for ApplicationHost and DTH to stitch them back together, it might get a little ugly, but we can finesse it in Phase 4. Right now, I'm thinking that AppHostContext just gets a Func or interface that allows it to attach the compilation things (assembly loaders/exporters)

Phase 4

Final finesse and clean-up. The way we stitch Runtme and Compilation will probably be pretty ugly. Something like an ICompilationAttacherThingy in Runtime that Compilation implements. This will mainly be a refactoring of ApplicationHostContext, since that's where the stitching happens.

@analogrelay
Copy link
Contributor Author

Phase 2-4 were completed by #2424 (despite the title only saying phase 2)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants