Exemple #1
0
        public BuilderDependencies(BuildContext context, IBazelMsBuildLogger?buildLog = null)
        {
            PathMapper    = new PathMapper(context.Bazel.OutputBase, context.Bazel.ExecRoot);
            Cache         = new BuildCache(context.Bazel.Label, PathMapper, new Files(), context.TargetGraph);
            ProjectLoader = new ProjectLoader(context.ProjectFile, Cache, PathMapper, context.TargetGraph);
            BuildLog      = buildLog ?? new BazelMsBuildLogger(
                m =>
            {
                Console.Out.Write(m);
                Console.Out.Flush();
            },
                context.DiagnosticsEnabled ? LoggerVerbosity.Normal : LoggerVerbosity.Quiet,
                (m) => PathMapper.ToRelative(m));

            Loggers = new List <ILogger>()
            {
                BuildLog
            };
            if (context.DiagnosticsEnabled)
            {
                var path = context.OutputPath(context.Bazel.Label.Name + ".binlog");
                Debug($"added binlog {path}");
                var binlog = new BinaryLogger()
                {
                    Parameters = path
                };
                Loggers.Add(binlog);
            }

            if (context.TargetGraph != null)
            {
                Loggers.Add(new TargetGraphLogger(context.TargetGraph !, PathMapper));
            }
        }
Exemple #2
0
 public Builder(BuildContext context, BuilderDependencies deps)
 {
     _context      = context;
     _deps         = deps;
     _action       = _context.Command.Action.ToLower();
     _buildManager = BuildManager.DefaultBuildManager;
     _targetGraph  = context.TargetGraph;
     _log          = deps.BuildLog;
 }