private static void addHtmlPathToPackage(JsPackage package) { var path = System.Web.VirtualPathUtility.ToAbsolute("~/Scripts/" + package.Name + "/" + package.Name + ".html"); if (System.IO.File.Exists(System.Web.HttpContext.Current.Server.MapPath(path))) { package.HtmlPath = path; } }
static JsPackageRepository() { var reglist = JsPackageRegistrationProvider.Packages.OrderBy(p => p.Name); foreach (var reg in reglist) { var package = new JsPackage { Name = reg.Name, Description = reg.Description }; var config = new JsPackageConfig(package); reg.ConfigureJsPackage(config); addTestScriptsToPackage(package); addScriptPathToPackage(package); addHtmlPathToPackage(package); packages.Add(config.Package); } }
private static void addTestScriptsToPackage(JsPackage package) { package.TestScripts = new List<string>(); package.TestScripts.AddRange(getTestScriptsInFolder("~/Scripts/" + package.Name + "/")); package.TestScripts.AddRange(getTestScriptsInFolder("~/Scripts/" + package.Name + "/tests/")); }
private static void addScriptPathToPackage(JsPackage package) { var path = System.Web.VirtualPathUtility.ToAbsolute("~/Scripts/" + package.Name + "/" + package.JsName); package.ScriptPath = path; }