private static DateTime GetStamp(IBSharpProject project) { project = project.Get <IBSharpProject>("_real_project") ?? project; var dirs = project.GetSourceDirectories().ToArray(); var stamp = dirs.SelectMany(_ => Directory.GetFiles(_, "*.bxls", SearchOption.AllDirectories)).Max(_ => File.GetLastWriteTime(_)); var csharp = Directory.GetFiles(project.GetCompileDirectory(), "*.cs", SearchOption.AllDirectories) .Where(_ => !_.Contains("\\obj\\")).ToArray(); if (0 != csharp.Length) { var _s = csharp.Max(_ => File.GetLastWriteTime(_)); if (_s > stamp) { stamp = _s; } } var xslt = Directory.GetFiles(project.GetCompileDirectory(), "*.xslt", SearchOption.AllDirectories) .Where(_ => !_.Contains("\\obj\\")).ToArray(); if (0 != xslt.Length) { var _s = xslt.Max(_ => File.GetLastWriteTime(_)); if (_s > stamp) { stamp = _s; } } return(stamp); }
/// <summary> /// Загрузка расширений /// </summary> protected virtual void PrepareExtensions() { if (Project.DoCompileExtensions) { var assembly = DoCompileExtensions(Project.GetCompileDirectory()); if (null != assembly) { foreach (Type ext in assembly.GetTypes()) { if (typeof(IBSharpBuilderExtension).IsAssignableFrom(ext)) { var extension = (IBSharpBuilderExtension)Activator.CreateInstance(ext); Log.Info("Register extension: " + ext.FullName); extension.SetUp(this); } } } } foreach (string ext in Project.Extensions) { foreach (Type type in GetExtensionTypes(ext)) { var extension = (IBSharpBuilderExtension)Activator.CreateInstance(type); Log.Info("Register extension: " + type.FullName); extension.SetUp(this); } } }
public string GetPath(Uri uri) { switch (uri.Scheme) { case "project": return(Path.Combine(_project.GetRootDirectory(), uri.Host + "/" + uri.AbsolutePath).NormalizePath()); case "output": return(Path.Combine(_project.GetOutputDirectory(), uri.Host + "/" + uri.AbsolutePath).NormalizePath()); case "compile": return(Path.Combine(_project.GetCompileDirectory(), uri.Host + "/" + uri.AbsolutePath).NormalizePath()); default: throw new Exception("not supported uri"); } }