From f44694c28eee8bf3593f23a39607fb62e9299309 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 9 Apr 2009 15:46:02 +0000 Subject: * Allows MRMs to import libraries in the OpenSim bin directory. * Syntax: //@DEPENDS:library.dll --- .../Scripting/Minimodule/MRMModule.cs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/OptionalModules') diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs index b978d7c..5c249b9 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs @@ -217,12 +217,23 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule string rootPath = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory); + List libraries = new List(); + string[] lines = Script.Split(new string[] {"\n"}, StringSplitOptions.RemoveEmptyEntries); + foreach (string s in lines) + { + if(s.StartsWith("//@DEPENDS:")) + { + libraries.Add(s.Replace("//@DEPENDS:", "")); + } + } - // TODO: Add Libraries - parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, - "OpenSim.Region.OptionalModules.dll")); - parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, - "log4net.dll")); + libraries.Add("OpenSim.Region.OptionalModules.dll"); + libraries.Add("log4net.dll"); + + foreach (string library in libraries) + { + parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, library)); + } parameters.GenerateExecutable = false; parameters.OutputAssembly = OutFile; -- cgit v1.1