Esempio n. 1
0
        private List <string> GetAllInstallFiles(string module)
        {
            if (!File.Exists(Path.Combine(Helper.CurrentWorkspace, module, Helper.YamlSpecFile)))
            {
                return(new List <string>());
            }
            var configs = Yaml.ConfigurationParser(module).GetConfigurations();
            var result  = configs.Select(config => Yaml.InstallParser(module).Get(config)).SelectMany(parser => parser.Artifacts);

            return(result.Distinct().Select(file => Path.Combine(module, file)).ToList());
        }
Esempio n. 2
0
        public static bool HasAllOutput(string moduleName, string configuration, bool requireYaml)
        {
            var path = Path.Combine(Helper.CurrentWorkspace, moduleName, Helper.YamlSpecFile);

            if (!File.Exists(path))
            {
                return(!requireYaml);
            }
            var artifacts = Yaml.InstallParser(moduleName).Get(configuration).Artifacts;

            return(artifacts.Select(Helper.FixPath).All(art => File.Exists(Path.Combine(Helper.CurrentWorkspace, moduleName, art))));
        }
Esempio n. 3
0
        private void TryAddToDeps(string reference, string project)
        {
            var moduleDep = Helper.GetRootFolder(reference);

            var configs             = Yaml.ConfigurationParser(moduleDep).GetConfigurations();
            var configsWithArtifact =
                configs.Where(c =>
                              Yaml.InstallParser(moduleDep).GetAllInstallFilesFromConfig(c)
                              .Select(file => Path.Combine(moduleDep, file)).Any(file => Path.GetFullPath(file) == Path.GetFullPath(reference))).ToList();

            var toAdd = DepsPatcherProject.GetSmallerCementConfigs(Path.Combine(Helper.CurrentWorkspace, moduleDep), configsWithArtifact);

            foreach (var configDep in toAdd)
            {
                DepsPatcherProject.PatchDepsForProject(Directory.GetCurrentDirectory(), new Dep(moduleDep, null, configDep), project);
            }
        }
Esempio n. 4
0
        private void CheckHasInstall(Dep dep)
        {
            if (!Yaml.Exists(dep.Name))
            {
                return;
            }

            var artifacts = Yaml.InstallParser(dep.Name).Get(dep.Configuration).Artifacts;

            foreach (var artifact in artifacts)
            {
                var fixedPath = Helper.FixPath(artifact);
                if (!File.Exists(Path.Combine(Helper.CurrentWorkspace, dep.Name, fixedPath)))
                {
                    ConsoleWriter.WriteError($"{artifact} not found in {dep.Name}. Check install section.");
                    log.Warn($"{artifact} not found in {dep.Name}");
                }
            }
        }