protected static void Build(string code, Dictionary <string, string> substitutions = null) { var engine = new Engine(); var result = engine.Build( code, substitutions ?? new Dictionary <string, string>(), false ); TaskRegistry.Global = new TaskRegistry(result); }
protected static void Build(string code, Dictionary<string, string> substitutions = null) { var engine = new Engine(); var result = engine.Build( code, substitutions ?? new Dictionary<string, string>(), false ); TaskRegistry.Global = new TaskRegistry(result); }
public BuildResult Build(string code, IDictionary <string, string> substitutions, bool debug) { var key = new CacheKey(script, code, substitutions, debug); var cached = key.Find(tasks); if (cached != null && !reset) { return(cached); } if (reset) { key.Reset(); } var output = engine.Build(code, substitutions, debug); key.Store(output); return(output); }
protected static string Build(string code, Dictionary <string, string> substitutions = null, bool createScriptFile = false) { var additionalReferences = new[] { new AssemblyReference(typeof(StepAttribute).Assembly.Location), new AssemblyReference(typeof(Env).Assembly.Location) }; var engine = new Engine(additionalReferences); var source = new ScriptSource(code); if (createScriptFile) { var tmp = Path.GetTempFileName(); File.WriteAllText(tmp, code); source = new ScriptSource(code, new FileInfo(tmp)); } var result = engine.Build(source, substitutions ?? new Dictionary <string, string>(), false); TaskRegistry.Global = new TaskRegistry(result); return(source.File?.FullName); }