public BundleBundler(IToolsDir tools, MainBuildResult mainBuildResult, ProjectOptions project, BuildResult buildResult) { _tools = tools; _mainBuildResult = mainBuildResult; _project = project; _buildResult = buildResult; }
public CompilerPool(IToolsDir toolsDir, ILogger logger, int parallelCompilations = 1) { _toolsDir = toolsDir; _logger = logger; _semaphore = new System.Threading.SemaphoreSlim(parallelCompilations); _semaphoreCss = new System.Threading.SemaphoreSlim(parallelCompilations); }
public NjsastBundleBundler(IToolsDir tools, ILogger logger, MainBuildResult mainBuildResult, ProjectOptions project, BuildResult buildResult) { _tools = tools; _logger = logger; _mainBuildResult = mainBuildResult; _project = project; _buildResult = buildResult; }
public BundlerImpl(IToolsDir toolsDir) { _toolsDir = toolsDir; Compress = true; Mangle = true; Beautify = false; Defines = new Dictionary <string, object>(); _bbCallbacks = new BBCallbacks(this); }
public void BuildTranslationJs(IToolsDir tools, Dictionary <string, object> filesContent, string versionDir) { if (_changed) { _outputJsCache.Clear(); foreach (var p in Lang2ValueList) { var langInit = tools.GetLocaleDef(p.Key); if (langInit == null) { continue; } var sw = new StringWriter(); var posLoc1 = langInit.IndexOf("bobrilRegisterTranslations(") + "bobrilRegisterTranslations(".Length; var posLoc2 = langInit.IndexOf(",", posLoc1); langInit = langInit.Substring(0, posLoc1) + "\'" + p.Key + "\'" + langInit.Substring(posLoc2); sw.Write(langInit); var jw = new JsonTextWriter(sw); jw.WriteStartArray(); for (var i = 0; i < UsedIds.Count; i++) { var idx = (int)UsedIds[i]; jw.WriteValue(((idx < p.Value.Count) ? p.Value[idx] : null) ?? Id2Key[idx].Message); } jw.WriteEndArray(); sw.Write(")"); _outputJsCache[p.Key.ToLowerInvariant() + ".js"] = sw.ToString(); } // scope { var sw = new StringWriter(); sw.Write("bobrilRegisterTranslations(\"\",[],"); var jw = new JsonTextWriter(sw); jw.WriteStartArray(); for (var i = 0; i < UsedIds.Count; i++) { var idx = (int)UsedIds[i]; var key = Id2Key[idx]; var val = key.Message + "\x9" + (key.WithParams ? "1" : "0") + (key.Hint ?? ""); jw.WriteValue(val); } jw.WriteEndArray(); sw.Write(")"); _outputJsCache["l10nkeys.js"] = sw.ToString(); } _changed = false; } foreach (var i in _outputJsCache) { var outfn = i.Key; if (versionDir != null) { outfn = versionDir + "/" + outfn; } filesContent[outfn] = i.Value; } }
public FastBundleBundler(IToolsDir tools) { _tools = tools; }
public CssProcessor(IToolsDir toolsDir) { _toolsDir = toolsDir; _callbacks = new BBCallbacks(this); }
public TsCompiler(IToolsDir toolsDir, ILogger logger) { Logger = logger; _toolsDir = toolsDir; _callbacks = new BBCallbacks(this); }
public TsCompiler(IToolsDir toolsDir) { _toolsDir = toolsDir; _callbacks = new BBCallbacks(this); }