Exemplo n.º 1
0
 public void Add(string command, string name, CMakeParser.State state, IEnumerable <string> filePaths)
 {
     foreach (var filePath in filePaths)
     {
         if (System.IO.File.Exists(filePath))
         {
             _logger.Info(string.Format("[{0}] Adding {1} to {2}", state.Variables["${CMAKE_CURRENT_SOURCE_DIR}"], filePath, name));
         }
         else
         {
             _logger.Warn(string.Format("[{0}] Not adding {1} to {2}", state.Variables["${CMAKE_CURRENT_SOURCE_DIR}"], filePath, name));
         }
     }
 }
Exemplo n.º 2
0
        public void DotNetCompiles(Proj project, List <string> files, Core.ILogger logger, Core.Paths filePath)
        {
            var list  = Compiles("Compile");
            var direc = System.IO.Path.GetDirectoryName(project.FilePath);

            filePath.Add("ProjectDir", direc);
            foreach (var link in list)
            {
                var trimmed = link;
                trimmed = trimmed.Replace("$(MSBuildThisFileDirectory)", direc + "\\");
                var file = filePath.RemoveAliases(trimmed);

                if (!System.IO.Path.IsPathRooted(file))
                {
                    file = System.IO.Path.Combine(direc, trimmed);
                }

                if (file.Contains("*"))
                {
                    var directory = System.IO.Path.GetDirectoryName(file);
                    var pattern   = System.IO.Path.GetFileName(file);
                    try
                    {
                        foreach (var name in System.IO.Directory.GetFiles(directory, pattern))
                        {
                            logger.Info("Appended \"{0}\"", name);
                            files.Add(name);
                        }
                    }
                    catch
                    {
                    }
                }
                else if (file.Length > 0)
                {
                    if (!System.IO.File.Exists(file))
                    {
                        logger.Warn("Cannot find \"{0}\"", file);
                        continue;
                    }

                    logger.Info("Appended \"{0}\"", file);
                    files.Add(file);
                }
            }

            filePath.Remove("ProjectDir");
        }
Exemplo n.º 3
0
 public void Warn(string message)
 {
     _logger.Warn(string.Format("[{0}] {1}", Variables["${CMAKE_CURRENT_SOURCE_DIR}"], message));
 }