Пример #1
0
        public static BuildResult BuildProject(DubProject prj, IProgressMonitor mon, ConfigurationSelector sel)
        {
            var br = new BuildResult();

            // Skip building sourceLibraries
            string targetType = null;
            var    cfg        = prj.GetConfiguration(sel) as DubProjectConfiguration;

            if (cfg != null)
            {
                cfg.BuildSettings.TryGetTargetTypeProperty(prj, sel, ref targetType);
                if (string.IsNullOrWhiteSpace(targetType))
                {
                    prj.CommonBuildSettings.TryGetTargetTypeProperty(prj, sel, ref targetType);
                }

                if (targetType != null && targetType.ToLower().Contains("sourcelibrary"))
                {
                    br.BuildCount = 1;
                    return(br);
                }
            }

            var args = new StringBuilder("build");

            BuildCommonArgAppendix(args, prj, sel);

            string output;
            string errDump;

            int status = ProjectBuilder.ExecuteCommand(DubSettings.Instance.DubCommand, args.ToString(), prj.BaseDirectory,
                                                       mon, out errDump, out output);

            br.CompilerOutput = output;

            ErrorExtracting.HandleReturnCode(mon, br, status);
            ErrorExtracting.HandleCompilerOutput(prj, br, output);
            ErrorExtracting.HandleCompilerOutput(prj, br, errDump);

            return(br);
        }
Пример #2
0
        public static BuildResult BuildProject(DubProject prj, IProgressMonitor mon, ConfigurationSelector sel)
        {
            var br = new BuildResult();

            var args = new StringBuilder("build");

            Instance.BuildCommonArgAppendix(args, prj, sel);

            string output;
            string errDump;

            int status = ProjectBuilder.ExecuteCommand(Instance.DubExecutable, args.ToString(), prj.BaseDirectory,
                                                       mon, out errDump, out output);

            br.CompilerOutput = output;

            ErrorExtracting.HandleReturnCode(mon, br, status);
            ErrorExtracting.HandleCompilerOutput(prj, br, output);
            ErrorExtracting.HandleCompilerOutput(prj, br, errDump);

            return(br);
        }