diff options
author | Tedd Hansen | 2008-11-08 17:35:48 +0000 |
---|---|---|
committer | Tedd Hansen | 2008-11-08 17:35:48 +0000 |
commit | 9511a8c76370f21e839114007dcd2b25c69b009a (patch) | |
tree | b63323dfd96ecd1cc3cd560939bd66bb43ec9c1c /OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_CS.cs | |
parent | * Added IClientIM to IClientCore interfaces (diff) | |
download | opensim-SC-9511a8c76370f21e839114007dcd2b25c69b009a.zip opensim-SC-9511a8c76370f21e839114007dcd2b25c69b009a.tar.gz opensim-SC-9511a8c76370f21e839114007dcd2b25c69b009a.tar.bz2 opensim-SC-9511a8c76370f21e839114007dcd2b25c69b009a.tar.xz |
Work in progress on SECS stuff. Have been holding it off until after 0.6 release. Still messy as hell and doesn't really work yet. Will undergo dramatic changes. AND MOST IMPORTANTLY: Will be conformed to work in coop with todays DNE and XEngine, hopefully one day providing a common interface for all components.
Diffstat (limited to 'OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_CS.cs')
-rw-r--r-- | OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_CS.cs | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_CS.cs b/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_CS.cs index 9c72359..1286dc5 100644 --- a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_CS.cs +++ b/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_CS.cs | |||
@@ -25,20 +25,46 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | using System; | 27 | using System; |
28 | using System.CodeDom.Compiler; | ||
28 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
29 | using System.Text; | 30 | using System.Text; |
30 | using OpenSim.ApplicationPlugins.ScriptEngine.Components; | 31 | using Microsoft.CSharp; |
32 | using OpenSim.ScriptEngine.Shared; | ||
31 | 33 | ||
32 | namespace OpenSim.ScriptEngine.Components.DotNetEngine.Compilers | 34 | namespace OpenSim.ScriptEngine.Components.DotNetEngine.Compilers |
33 | { | 35 | { |
34 | public class Compiler_CS: CompilerBase | 36 | public class Compiler_CS : CILCompiler, IScriptCompiler |
35 | { | 37 | { |
36 | public override void Start() | 38 | private string[] ScriptUsing = new string[] |
39 | { | ||
40 | "System", | ||
41 | "OpenSim.ScriptEngine.Shared", | ||
42 | "OpenSim.Region.ScriptEngine.Shared", | ||
43 | "System.Collections.Generic" | ||
44 | }; | ||
45 | |||
46 | public Compiler_CS() | ||
37 | { | 47 | { |
48 | CompileProvider = new CSharpCodeProvider(); | ||
38 | } | 49 | } |
39 | 50 | ||
40 | public override void Close() | 51 | public override string PreProcessScript(ref string script) |
41 | { | 52 | { |
53 | string s = ""; | ||
54 | foreach (string u in ScriptUsing) | ||
55 | { | ||
56 | s += "using " + u + ";"; | ||
57 | } | ||
58 | |||
59 | s += "\r\n" | ||
60 | + String.Empty + "namespace ScriptAssemblies { " | ||
61 | + String.Empty + "public class UserScript" + " : " + ScriptInheritFrom + " { \r\n" + | ||
62 | @"public Script() { } " + | ||
63 | script + | ||
64 | "} }\r\n"; | ||
65 | |||
66 | return s; | ||
42 | } | 67 | } |
68 | |||
43 | } | 69 | } |
44 | } | 70 | } |