Commit Graph
100 Commits
Author SHA1 Message Date
Renaud Paquay 81b93a6699 Small refactorings
--HG--
branch : dev
2010-07-06 11:25:39 -07:00
Renaud Paquay 24eb381be3 Dynamic loading: Skip reference assemblies in ~/bin
--HG--
branch : dev
2010-07-03 12:29:40 -07:00
Renaud Paquay 392f4fd7b2 Dynamic loading: monitor .cs files in addition to .csproj file
--HG--
branch : dev
2010-07-03 12:29:04 -07:00
Renaud Paquay 0fa27bb6d6 Renames...
--HG--
branch : dev
2010-07-03 12:28:23 -07:00
Renaud Paquay 23521a1d5b Merge
--HG--
branch : dev
2010-07-03 09:52:53 -07:00
Renaud Paquay 6c2ee38bd3 Perf: Don't call "GetReferencedAssemblies" when loading extensions
GetReferencedAssemblies forces all assemblies to be loaded, which has an impact
on startup time. Since we know the name of the assemblies we need to load for
extensions/modules, do a assembly name check instead.

Also refactor code paths to always use the IBuildManager abstraction.

--HG--
branch : dev
2010-07-02 23:37:33 -07:00
Renaud Paquay 6ff8f611db Perf: Cache for dependencies.xml file was incorrectly setup
--HG--
branch : dev
2010-07-02 21:27:24 -07:00
Renaud Paquay b0842c5529 Fix dynamic compilation issue in command line host
--HG--
branch : dev
2010-07-02 21:08:50 -07:00
Renaud Paquay e7aa444a95 Create a stub for IVirtualPathProvider (Unit Tests)
--HG--
branch : dev
2010-07-02 21:08:13 -07:00
Renaud Paquay a178f29e37 Merge
--HG--
branch : dev
2010-07-02 12:31:10 -07:00
Renaud Paquay 462eed28f3 Slightly refactor AppDomain restart code
--HG--
branch : dev
2010-07-02 10:55:11 -07:00
Renaud Paquay fd81420210 Merge
--HG--
branch : dev
2010-07-02 09:12:33 -07:00
Renaud Paquay 6b2c1788ab Monitor "~/Modules" path to detect add/remove of modules
--HG--
branch : dev
2010-07-01 17:29:53 -07:00
Renaud Paquay 9af69afef0 Merge
--HG--
branch : dev
2010-07-01 16:57:22 -07:00
Renaud Paquay ed3bece16e Slightly tweak the redirect code...
--HG--
branch : dev
2010-07-01 16:57:07 -07:00
Renaud Paquay 81e3001014 Remove reference to modules from Orchard.Web project
With the dynamic compilation work, this is not required anymore.

--HG--
branch : dev
2010-07-01 12:16:11 -07:00
Renaud Paquay bf9e6f78f8 Redirect the request if the AppDomain needs to be restarted
--HG--
branch : dev
2010-07-01 12:12:39 -07:00
Renaud Paquay bafc6ab6f0 Removed unneeded reference from Orchard.Setup
--HG--
branch : dev
2010-07-01 10:14:04 -07:00
Renaud Paquay 12be04814c Fix unit test
--HG--
branch : dev
2010-06-30 23:56:03 -07:00
Renaud Paquay 606d1869ab Add support for dynamic extension dependencies
Suppose Module A is loaded through its pre-compiled version
Suppose Module B is loaded through its pre-compiled version
Suppose Module A depends on Module B

If the csproj of Module B is updated, Module B will be dynamically compiled.
We have to ensure Module A is also dynamically compiled, because Module A can't
reference the pre-compiled version of B anymore.

The way we enforce this is by asking every loader if they are compatible
with all module references of a module before picking it as the actual loader.
If a loader decides it's not compatible with the module references, the next
loader in order of priority will be considered.

--HG--
branch : dev
2010-06-30 23:41:44 -07:00
Renaud Paquay 5b89b6a78d Generalize the dependy ordering algorithm
--HG--
branch : dev
2010-06-30 23:39:38 -07:00
Renaud Paquay 65c3ff3cd7 Rename
--HG--
branch : dev
2010-06-30 20:57:40 -07:00
Renaud Paquay 188a0b5314 Include project-2-project references when parsing csproj file
--HG--
branch : dev
2010-06-30 20:13:01 -07:00
Renaud Paquay afc5979c10 Rename ReferenceDescriptor to DependencyReferenceDescriptor
--HG--
branch : dev
2010-06-30 20:01:44 -07:00
Renaud Paquay 74710b6c26 Merge
--HG--
branch : dev
2010-06-30 19:57:59 -07:00
Renaud Paquay 2dc0f61a42 Fix unit test
--HG--
branch : dev
2010-06-30 18:35:49 -07:00
Renaud Paquay 0f7664c236 Merge
--HG--
branch : dev
2010-06-30 18:18:49 -07:00
Renaud Paquay c43e87662c Support for dynamic loading of module references
--HG--
branch : dev
2010-06-30 18:18:11 -07:00
Renaud Paquay 2e24980ba6 Merge
--HG--
branch : dev
2010-06-24 10:24:35 -07:00
Renaud Paquay 6086c9c775 Merge
--HG--
branch : dev
2010-06-23 15:34:36 -07:00
Renaud Paquay 7c19d01d3e Update LocalizedString to also store the textHint, scopy and args
This is so that OrchardException classes which expose a LocalizedString
can be examined for the language neutral text if needed.

--HG--
branch : dev
2010-06-22 12:17:39 -07:00
Renaud Paquay 5db91c1689 Rename OrchardSystemException to OrchardCoreException
--HG--
branch : dev
rename : src/Orchard/OrchardSystemException.cs => src/Orchard/OrchardCoreException.cs
2010-06-22 10:53:28 -07:00
Renaud Paquay 2fad0edb92 Merge
--HG--
branch : dev
2010-06-22 10:28:35 -07:00
Renaud Paquay a9acdc1847 Refactor OrchardException classes
All constructors now take a"LocalizedString" as the error message.

--HG--
branch : dev
2010-06-22 10:25:57 -07:00
Renaud Paquay 1290ea7d6e Refactor OrchardException classes
All constructors now take a"LocalizedString" as the error message.

--HG--
branch : dev
2010-06-22 10:21:24 -07:00
Renaud Paquay 3725b84b20 Refactoring a csproj file compiler/build provider
* Removed unused "ServiceLocator" class

* Added "OrchardHostContainerRegistry" class to enable Shim/HostContainer
  registration for DI

* Refactored the BuildProvider for .csproj file to use the new
  OrchardHostContainerRegistry class and enable proper DI for implementations.

--HG--
branch : dev
2010-06-21 16:40:13 -07:00
Renaud Paquay 7e23f3a30b Tweaking amount of logging done in extension loaders
--HG--
branch : dev
2010-06-18 19:54:08 -07:00
Renaud Paquay a2da9c0f97 Merge
--HG--
branch : dev
2010-06-18 18:41:14 -07:00
Renaud Paquay 499dda8993 Added workaround for nhibernate limitation
From the comment:

/// <summary>
/// We should be able to support reloading multiple version of a compiled module from
/// a ".csproj" file in the same AppDomain. However, we are currently running into a
/// limitation with NHibernate getting confused when a type name is present in
/// multiple assemblies loaded in an AppDomain.  So, until a solution is found, any change
/// to a ".csproj" file of an active module requires an AppDomain restart.
/// The purpose of this class is to keep track of all .csproj files monitored until
/// an AppDomain restart.
/// </summary>

--HG--
branch : dev
2010-06-18 18:36:19 -07:00
Renaud Paquay 253126957d Removed unused parameter
--HG--
branch : dev
2010-06-18 18:35:19 -07:00
Renaud Paquay a7841bd919 Slightly refactor ExtensionLoader.Load method implementations
--HG--
branch : dev
2010-06-18 14:27:04 -07:00
Renaud Paquay a9593f69ff Update WebFormVirtualPathProvider GetFileHash method
When a WebForm view file is served through the WebFormVirtualPathProvider,
we override GetFileHash to include the virtual path of all the dependencies
used to compile the form. For example, if we had a "Assembly Name=..."
directive, we want to include the file hash of the assembly file, so that if the
assembly file is updated with a newer version, the file hash of the WebForm view
file will be different, which will tell ASP.NET the view file needs to be
recompiled.

--HG--
branch : dev
2010-06-18 10:23:41 -07:00
Renaud Paquay e9dedb765d Add assembly directives for views in "~/Themes"
When a view is served from the "~/Themes" directory, we need to add
the assembly directives of all the modules dynamically compiled.

--HG--
branch : dev
2010-06-17 10:54:09 -07:00
Renaud Paquay a248ead846 Fix typos...
--HG--
branch : dev
2010-06-17 10:53:10 -07:00
Renaud Paquay d3c393cc41 Add Unit Tests for AssemblyProbingFolder
--HG--
branch : dev
rename : src/Orchard/FileSystems/Dependencies/IAssenblyProbyFolder.cs => src/Orchard/FileSystems/Dependencies/IAssemblyProbingFolder.cs
2010-06-16 17:23:33 -07:00
Renaud Paquay ff34e0a6b7 Merge
--HG--
branch : dev
2010-06-16 15:45:06 -07:00
Renaud Paquay c4bc2a1375 Remove IAppDataFolder implementation for Azure
We don't need this. Azure supports writing tp ~/App_Data. There is no
guarantee that the content will persist, but that's exactly the assumption
of the IAppDataFolder abstraction: it's a local cache, which persists
for _some_ time accross app restarts.

--HG--
branch : dev
2010-06-16 15:44:53 -07:00
Renaud Paquay ed410cba61 Move probing assembly folder behavior in separate class
The behavior of the "assembly load probing folder" is really
a separate concern from managing the list of loaded extesions.

--HG--
branch : dev
2010-06-16 14:35:13 -07:00
Renaud Paquay 2705aff234 Merge
--HG--
branch : dev
2010-06-16 11:52:18 -07:00
Renaud Paquay f8fe5a8665 Update unit tests to use StubAppDataFolder
--HG--
branch : dev
2010-06-16 11:49:45 -07:00
Renaud Paquay ec0e452c3a Add more unit test for IDependenciesFolder
--HG--
branch : dev
2010-06-15 19:05:49 -07:00
Renaud Paquay 4ad1abc4c9 Add more unit test for IDependenciesFolder
--HG--
branch : dev
2010-06-15 18:56:37 -07:00
Renaud Paquay b45ccb6864 Add more unit tests
--HG--
branch : dev
2010-06-15 14:18:07 -07:00
Renaud Paquay d258e12161 Merge
--HG--
branch : dev
2010-06-15 14:05:11 -07:00
Renaud Paquay 9444fc83f5 Add unit test for IDepdendenciesFolder
--HG--
branch : dev
rename : src/Orchard.Tests/Environment/Configuration/AppDataFolderTests.cs => src/Orchard.Tests/FileSystems/AppData/AppDataFolderTests.cs
2010-06-15 14:04:55 -07:00
Renaud Paquay df3a1a4044 Re-adding reference to MultiTenancy
--HG--
branch : dev
2010-06-14 21:03:12 -07:00
Renaud Paquay 141f8bc421 Refactor ASP.NET specific behavior into abstraction interface
--HG--
branch : dev
2010-06-14 20:49:20 -07:00
Renaud Paquay 4672c4487e Merge
--HG--
branch : dev
2010-06-14 16:05:25 -07:00
Renaud Paquay c0cc66f0be Save "dependencies.xml" only if there are changes
--HG--
branch : dev
2010-06-14 16:01:23 -07:00
Renaud Paquay 59dbbfb44e Merge
--HG--
branch : dev
2010-06-14 09:02:25 -07:00
Renaud Paquay cd3a537396 work on extension loading
* Add a "ExtensionLoaderCoordinator" class
* Rework the way loaders are notified of extensions being loaded,
  (de)activated, etc.

--HG--
branch : dev
2010-06-14 09:01:31 -07:00
Renaud Paquay ad54ffdbb2 Remove implicit conversion from string to LocalizedString
In most cases, relying on the implicit conversion is a sign
of a missing call to "T".

--HG--
branch : dev
2010-06-12 13:33:35 -07:00
Renaud Paquay ff5448ac31 Normalize usage of IAppDataFolder
--HG--
branch : dev
2010-06-12 12:42:04 -07:00
Renaud Paquay 695f001f0f Add ability for OrchardHost to reset its state when Extensions change
OrchardHost calls into all extension loaders to all extensions descriptor,
allowing each loader to add the set of resource to monitor for change.
OrchardHost resets its list of shells at the beginning of a request if
any monitored resources has changed.

--HG--
branch : dev
2010-06-12 12:38:49 -07:00
Renaud Paquay 767f19a4e3 Slightly refactor IAppDataFolder
Remove the "SetBasePath" method, introduce IAppDataFolderRoot as replacement.

--HG--
branch : dev
2010-06-12 12:18:08 -07:00
Renaud Paquay c566e6599d Fix build error from previous merge
--HG--
branch : dev
2010-06-11 21:27:56 -07:00
Renaud Paquay 9f92ee275c Merge
--HG--
branch : dev
2010-06-11 21:23:42 -07:00
Renaud Paquay 4ea580b54e Update dependencies storage to store state of all loaded extensions
--HG--
branch : dev
2010-06-11 21:21:20 -07:00
Renaud Paquay 9b9efe02a2 Removing obsolete method
--HG--
branch : dev
2010-06-11 21:20:13 -07:00
Renaud Paquay 75efa67b61 Make extension loading a 2 pass process
First pass is "probing": any loader who thinks it can load a
given extension returns a descriptor for it. The descriptor contains
information about how old the extension is.

The extension manager sorts the descriptor list return by probing all
loaders, and picks the most recent entry.

During the 2nd pass, each loader is called again, with the candidate extension
entry as argument. This allows each loader to be notified that, if they don't
load an extension, they might still need to cleanup some state related to
previous loading.

In essence, this is implementing a complete state machine of loaders and
extension "active/inactive" states/transitions.

--HG--
branch : dev
2010-06-11 17:12:27 -07:00
Renaud Paquay e7615d6eb7 Merge
--HG--
branch : dev
2010-06-11 15:49:28 -07:00
Renaud Paquay 4b9c9da8fd Refactor IAppDataFolder and default implementation
Refactor IAppDataFolder so that it can be used for implementing
DefaultDependenciesFolder.

--HG--
branch : dev
rename : src/Orchard/Environment/Extensions/Loaders/WebFormsExtensionsVirtualFile.cs => src/Orchard/FileSystems/Dependencies/WebFormsExtensionsVirtualFile.cs
rename : src/Orchard/Environment/Extensions/Loaders/WebFormsExtensionsVirtualPathProvider.cs => src/Orchard/FileSystems/Dependencies/WebFormsExtensionsVirtualPathProvider.cs
rename : src/Orchard/Environment/IVirtualPathProvider.cs => src/Orchard/FileSystems/VirtualPath/DefaultVirtualPathProvider.cs
rename : src/Orchard/Environment/ICustomVirtualPathProvider.cs => src/Orchard/FileSystems/VirtualPath/ICustomVirtualPathProvider.cs
2010-06-11 15:48:40 -07:00
Renaud Paquay 4e9ebd1755 Merge
--HG--
branch : dev
2010-06-10 16:08:30 -07:00
Renaud Paquay 27680af618 Merge
--HG--
branch : dev
2010-06-10 10:29:24 -07:00
Renaud Paquay 7f1b47e7c4 Merge
--HG--
branch : dev
2010-06-09 19:00:48 -07:00
Renaud Paquay 4becc488c8 Couple of fixed with dynamic extension loader
Perf: Use the cache manager to keep the list of dependency descriptors in
      memory, with invalidation when "dependencies.xml" changes on disk

When loading an assembly from the list of references assemblies, notify
the dependencies folder component, so it removes the entry.

--HG--
branch : dev
2010-06-09 18:55:35 -07:00
Renaud Paquay 9c3f6bfc74 Tweak dynamic extension loader
* Add "Assembly Src" directive to WebForms files loaded from vpp
* Notify the OrchardHost when the .csproj file a a dynamic module is changed.
* Make the registration of custom virtual path provider a bit more extensible,
  so that the custom VPP can be instantiated using DI.

--HG--
branch : dev
2010-06-06 21:36:06 -07:00
Renaud Paquay 2c9d0caf0a Remove extra spaces
--HG--
branch : dev
2010-06-05 23:06:40 -07:00
Renaud Paquay 70f3f01b22 Fix braces formatting
--HG--
branch : dev
2010-06-05 23:04:56 -07:00
Renaud Paquay 196a24d572 Merge
--HG--
branch : dev
2010-06-05 15:40:12 -07:00
Renaud Paquay 1efde731fe Create a virtual path provider for WebForms files
This is so that we dynamically add the relevant <%@ Assembly Name="" %>
directive to WebForms files served from modules which have been dynamically
compiled and stored in the "~/App_Data/Dependencies" folder.

--HG--
branch : dev
2010-06-04 22:28:01 -07:00
Renaud Paquay 2be308bbf6 Fix couple of bugs in DependenciesFolder
We need to overwrite files when copying to App_Data/Dependencies folder.
We need to compare modification date, not creation date when deciding
to copy a file to the App_Data/Dependencies folder.

--HG--
branch : dev
2010-06-04 22:26:16 -07:00
Renaud Paquay 412d21b234 Tweak extension loading strategy:
Don't store compiled assemblies in "App_Data/Dependencies" if we
have a more recent one already stored.

--HG--
branch : dev
2010-06-04 19:59:20 -07:00
Renaud Paquay a249579191 Fix localization issue from previous merge
--HG--
branch : dev
2010-06-04 19:58:23 -07:00
Renaud Paquay 7ea379596d Fix error from previous merge
--HG--
branch : dev
2010-06-04 19:23:52 -07:00
Renaud Paquay 30444e7696 Merge
--HG--
branch : dev
2010-06-04 19:16:11 -07:00
Renaud Paquay a1be3efecb Module loading strategies
Make the precompiled and dynamic extension loaders work properly
and also refactor some code to introduce proper abstractions, such
as IVirtualPathProvider, IHostEnvironment, IBuildManager, etc.

--HG--
branch : dev
2010-06-04 19:13:57 -07:00
Renaud Paquay abe6c67b25 Implement dynamic compilation of modules
--HG--
branch : dev
2010-06-03 17:00:28 -07:00
Renaud Paquay d24f4cf2ac Fix identation
--HG--
branch : dev
2010-06-03 16:57:58 -07:00
Renaud Paquay 2a41a3dedf Remove implicit conversion from LocalizedString to string
Having both way implicit conversion tend to confuse the C# compiler
and really question the existence of the specific type in the first place.

--HG--
branch : dev
2010-06-03 16:57:44 -07:00
Renaud Paquay 9b57d00d13 Module loading work
Adding "App_Data/Extensions" probing path for assembly loading. This directory
will be used to store dynamically compiled module assemblies.

Adding a BuildProvider for ".csproj" file. This will be used to dynamic compile
modules when passing ".csproj" file names to the BuildManager

--HG--
branch : dev
2010-06-03 16:54:14 -07:00
Renaud Paquay 0b5581d11c Merge
--HG--
branch : dev
2010-06-02 17:33:31 -07:00
Renaud Paquay d48d822990 Fix bug in shell state computation
--HG--
branch : dev
2010-06-02 17:32:58 -07:00
Renaud Paquay 01c7e29db2 Fix unit test memory leak
Shutdown ASP.NET AppDomains after running each SpecFlow scenario.

--HG--
branch : dev
2010-05-22 17:50:18 -07:00
Renaud Paquay d716019a5e Merge net40 -> dev
Dev10 - .NET 4.0 support

--HG--
branch : dev
2010-05-21 23:44:03 -07:00
Renaud Paquay 9f728ab04e Fix input validation (.net 4.0 breaking change)
--HG--
branch : net40
2010-05-21 23:41:46 -07:00
Renaud Paquay 1af2d3717c Move project to .net 4.0
Also cleanup assemblyinfo files

--HG--
branch : net40
2010-05-21 22:23:26 -07:00
Renaud Paquay 459916ada6 Merge
--HG--
branch : net40
2010-05-21 21:53:00 -07:00
Renaud Paquay eb138170f8 Fix unit tests
--HG--
branch : dev
2010-05-21 21:26:07 -07:00
Renaud Paquay d6dc292491 Fix unit tests
--HG--
branch : dev
2010-05-20 11:00:44 -07:00