Beispiel #1
0
        private void GetAndBuild(Dep module)
        {
            using (new DirectoryJumper(Helper.CurrentWorkspace))
            {
                ConsoleWriter.WriteInfo("cm get " + module);
                if (new Get().Run(new[] { "get", module.ToYamlString() }) != 0)
                {
                    throw new CementException("Failed get module " + module);
                }
                ConsoleWriter.ResetProgress();
            }

            module.Configuration = module.Configuration ?? Yaml.ConfigurationParser(module.Name).GetDefaultConfigurationName();

            using (new DirectoryJumper(Path.Combine(Helper.CurrentWorkspace, module.Name)))
            {
                ConsoleWriter.WriteInfo("cm build-deps " + module);
                if (new BuildDeps().Run(new[] { "build-deps", "-c", module.Configuration }) != 0)
                {
                    throw new CementException("Failed to build deps for " + dep);
                }
                ConsoleWriter.ResetProgress();
                ConsoleWriter.WriteInfo("cm build " + module);
                if (new Build().Run(new[] { "build", "-c", module.Configuration }) != 0)
                {
                    throw new CementException("Failed to build " + dep);
                }
                ConsoleWriter.ResetProgress();
            }
            Console.WriteLine();
        }