Moving scripting outside of framework.

--HG--
branch : dev
This commit is contained in:
andrerod
2010-11-18 23:50:28 -08:00
parent c08b75e047
commit b911cbb13b
15 changed files with 201 additions and 36 deletions

View File

@@ -76,6 +76,7 @@
<Reference Include="IronRuby.Libraries">
<HintPath>..\..\lib\dlr\IronRuby.Libraries.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Dynamic, Version=1.1.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\dlr\Microsoft.Dynamic.dll</HintPath>
@@ -139,6 +140,7 @@
<Compile Include="Roles\Controllers\AdminControllerTests.cs" />
<Compile Include="Roles\Services\RoleServiceTests.cs" />
<Compile Include="Migrations\SchemaCommandGeneratorTests.cs" />
<Compile Include="Scripting\ScriptingTests.cs" />
<Compile Include="Settings\Blueprint\ShellDescriptorManagerTests.cs" />
<Compile Include="Themes\Services\ThemeServiceTests.cs" />
<Compile Include="Values.cs" />

View File

@@ -8,6 +8,7 @@ using ClaySharp;
using ClaySharp.Behaviors;
using NUnit.Framework;
using Orchard.Scripting;
using Orchard.Scripting.Scripting;
namespace Orchard.Tests.Scripting {
[TestFixture]

View File

@@ -3,6 +3,7 @@ using System.IO;
using Autofac;
using NUnit.Framework;
using Orchard.Scripting;
using Orchard.Scripting.Scripting;
using Orchard.UI.Widgets;
using Orchard.Widgets.RuleEngine;

View File

@@ -246,7 +246,6 @@
<Compile Include="Mvc\Routes\ShellRouteTests.cs" />
<Compile Include="Mvc\Routes\UrlPrefixTests.cs" />
<Compile Include="Records\BigRecord.cs" />
<Compile Include="Scripting\ScriptingTests.cs" />
<Compile Include="Stubs\InMemoryWebSiteFolder.cs" />
<Compile Include="Stubs\StubHttpContextAccessor.cs" />
<Compile Include="Stubs\StubWorkContextAccessor.cs" />

View File

@@ -0,0 +1,11 @@
Name: Scripting
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 0.8.0
OrchardVersion: 0.8.0
Description: The scripting module enables the possibility to execute scripts.
Features:
Orchard.Scripting:
Description: Scripting support.
Category: Scripting

View File

@@ -0,0 +1,130 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{2AD6973D-C7BB-416E-89FE-EEE34664E05F}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Orchard.Search</RootNamespace>
<AssemblyName>Orchard.Search</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="IronRuby, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\dlr\IronRuby.dll</HintPath>
</Reference>
<Reference Include="IronRuby.Libraries, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\dlr\IronRuby.Libraries.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Dynamic, Version=1.1.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\dlr\Microsoft.Dynamic.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Scripting, Version=1.1.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\dlr\Microsoft.Scripting.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.ComponentModel.DataAnnotations">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web.Mvc">
<HintPath>..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web.Abstractions" />
<Reference Include="System.Web.Routing" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Web.Services" />
<Reference Include="System.EnterpriseServices" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Scripting\IScriptingManager.cs" />
<Compile Include="Scripting\IScriptingRuntime.cs" />
<Compile Include="Scripting\ScriptingManager.cs" />
<Compile Include="Scripting\ScriptingRuntime.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Orchard\Orchard.Framework.csproj">
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
<Name>Orchard.Framework</Name>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Module.txt" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target> -->
<Target Name="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)" />
</Target>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>False</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>47866</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>
</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>True</UseCustomServer>
<CustomServerUrl>http://orchard.codeplex.com</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>

View File

@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;
using System.Security;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Orchard.Scripting")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Orchard.Scripting")]
[assembly: AssemblyCopyright("Copyright © Outercurve Foundation 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("fa37585c-b84e-4b5b-a7da-13692ff45a94")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("0.8.0")]
[assembly: AssemblyFileVersion("0.8.0")]
[assembly: SecurityTransparent]

View File

@@ -2,7 +2,7 @@
using Microsoft.Scripting.Hosting;
namespace Orchard.Scripting {
public interface IScriptingManager : IDependency {
public interface IScriptingManager /* : IDependency */ {
dynamic GetVariable(string name);
void SetVariable(string name, object value);
dynamic ExecuteExpression(string expression);

View File

@@ -1,7 +1,7 @@
using Microsoft.Scripting.Hosting;
namespace Orchard.Scripting {
public interface IScriptingRuntime : ISingletonDependency {
public interface IScriptingRuntime /*: ISingletonDependency */ {
ScriptScope CreateScope();
dynamic ExecuteExpression(string expression, ScriptScope scope);
void ExecuteFile(string fileName, ScriptScope scope);

View File

@@ -25,7 +25,7 @@ namespace Orchard.Scripting {
return _scriptingRuntime.ExecuteExpression(expression, _scope.Value);
}
public dynamic ExecuteOperation(Func<ObjectOperations, dynamic> invoke) {
public dynamic ExecuteOperation(Func<ObjectOperations, object> invoke) {
return invoke(_operations.Value);
}

View File

@@ -114,6 +114,11 @@
<ProjectReference Include="..\..\..\Orchard\Orchard.Framework.csproj">
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
<Name>Orchard.Framework</Name>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\Orchard.Scripting\Orchard.Scripting.csproj">
<Project>{2AD6973D-C7BB-416E-89FE-EEE34664E05F}</Project>
<Name>Orchard.Scripting</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>

View File

@@ -51,22 +51,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\autofac\Autofac.Integration.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="IronRuby, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\dlr\IronRuby.dll</HintPath>
</Reference>
<Reference Include="IronRuby.Libraries, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\dlr\IronRuby.Libraries.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Dynamic, Version=1.1.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\dlr\Microsoft.Dynamic.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Scripting, Version=1.1.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\dlr\Microsoft.Scripting.dll</HintPath>
</Reference>
<Reference Include="NHibernate.ByteCode.Castle, Version=2.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\fluentnhibernate\NHibernate.ByteCode.Castle.dll</HintPath>

View File

@@ -100,6 +100,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Messaging", "Orchar
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Localization", "Orchard.Web\Modules\Orchard.Localization\Orchard.Localization.csproj", "{FBC8B571-ED50-49D8-8D9D-64AB7454A0D6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Scripting", "Orchard.Web\Modules\Orchard.Scripting\Orchard.Scripting.csproj", "{2AD6973D-C7BB-416E-89FE-EEE34664E05F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
CodeCoverage|Any CPU = CodeCoverage|Any CPU
@@ -536,6 +538,16 @@ Global
{FBC8B571-ED50-49D8-8D9D-64AB7454A0D6}.FxCop|Any CPU.Build.0 = Release|Any CPU
{FBC8B571-ED50-49D8-8D9D-64AB7454A0D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FBC8B571-ED50-49D8-8D9D-64AB7454A0D6}.Release|Any CPU.Build.0 = Release|Any CPU
{2AD6973D-C7BB-416E-89FE-EEE34664E05F}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
{2AD6973D-C7BB-416E-89FE-EEE34664E05F}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU
{2AD6973D-C7BB-416E-89FE-EEE34664E05F}.Coverage|Any CPU.ActiveCfg = Release|Any CPU
{2AD6973D-C7BB-416E-89FE-EEE34664E05F}.Coverage|Any CPU.Build.0 = Release|Any CPU
{2AD6973D-C7BB-416E-89FE-EEE34664E05F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2AD6973D-C7BB-416E-89FE-EEE34664E05F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2AD6973D-C7BB-416E-89FE-EEE34664E05F}.FxCop|Any CPU.ActiveCfg = Release|Any CPU
{2AD6973D-C7BB-416E-89FE-EEE34664E05F}.FxCop|Any CPU.Build.0 = Release|Any CPU
{2AD6973D-C7BB-416E-89FE-EEE34664E05F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2AD6973D-C7BB-416E-89FE-EEE34664E05F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -569,6 +581,7 @@ Global
{3420C92A-747F-4990-BA08-F2C9531E44AD} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{085948FF-0E9B-4A9A-B564-F8B8B4BDDDBC} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{FBC8B571-ED50-49D8-8D9D-64AB7454A0D6} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{2AD6973D-C7BB-416E-89FE-EEE34664E05F} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{ABC826D4-2FA1-4F2F-87DE-E6095F653810} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
{F112851D-B023-4746-B6B1-8D2E5AD8F7AA} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
{6CB3EB30-F725-45C0-9742-42599BA8E8D2} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}

View File

@@ -89,19 +89,7 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\sharpziplib\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="IronRuby">
<HintPath>..\..\lib\dlr\IronRuby.dll</HintPath>
</Reference>
<Reference Include="IronRuby.Libraries">
<HintPath>..\..\lib\dlr\IronRuby.Libraries.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Dynamic">
<HintPath>..\..\lib\dlr\Microsoft.Dynamic.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Scripting">
<HintPath>..\..\lib\dlr\Microsoft.Scripting.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Infrastructure">
<HintPath>..\..\lib\aspnetmvc\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
@@ -184,10 +172,6 @@
<Compile Include="Messaging\Services\DefaultMessageManager.cs" />
<Compile Include="Mvc\IOrchardViewPage.cs" />
<Compile Include="Mvc\Spooling\HtmlStringWriter.cs" />
<Compile Include="Scripting\IScriptingManager.cs" />
<Compile Include="Scripting\IScriptingRuntime.cs" />
<Compile Include="Scripting\ScriptingManager.cs" />
<Compile Include="Scripting\ScriptingRuntime.cs" />
<Compile Include="Security\CurrentUserWorkContext.cs" />
<Compile Include="Settings\CurrentSiteWorkContext.cs" />
<Compile Include="Settings\ResourceDebugMode.cs" />