Esempio n. 1
0
        public override string BuildSrcSrvStream(RepositoryList repositories)
        {
            var builder = new StringBuilder();

            builder.AppendLine("SRCSRV: ini ------------------------------------------------");
            builder.AppendLine("VERSION=1");
            builder.AppendLine("VERCTRL=http");
            builder.AppendLine("SRCSRV: variables------------------------------------------");
            builder.AppendLine("HTTP_ALIAS=https://raw.githubusercontent.com/");
            builder.AppendLine("HTTP_EXTRACT_TARGET=%HTTP_ALIAS%%var2%/%var3%/%var4%/%var5%");
            builder.AppendLine("SRCSRVTRG=%HTTP_EXTRACT_TARGET%");
            builder.AppendLine("SRCSRV: source files ---------------------------------------");
            foreach (var repo in repositories.Repositories)
            {
                string organization = "";
                string project      = "";
                ExtractRepoInfo(repo.RepositoryUrl, ref organization, ref project);
                foreach (var file in repo.SourceFiles)
                {
                    builder.AppendLine(string.Format("{0}*{1}*{2}*{3}*{4}", file.PdbFilePath, organization, project, repo.CurrentId, file.RelativePath));
                }
            }
            builder.AppendLine("SRCSRV: end------------------------------------------------");
            return(builder.ToString());
        }
        public override string BuildSrcSrvStream(RepositoryList repositories)
        {
            var builder = new StringBuilder();

            builder.AppendLine("SRCSRV: ini ------------------------------------------------");
            builder.AppendLine("VERSION=1");
            builder.AppendLine("VERCTRL=GIT");
            builder.AppendLine("SRCSRV: variables------------------------------------------");
            builder.AppendLine(@"SRCLOCATION=%GIT_HUB_SOURCEINDEXER_RESOLVER%");
            builder.AppendLine(@"SRCSRVTRG=%fnbksl%(%targ%\%var4%\%var5%)");
            builder.AppendLine("SRCSRVCMD=%fnvar%(SRCLOCATION) \"%var2%\" \"%var3%\" \"%var4%\" \"%var5%\" %SRCSRVTRG%");
            builder.AppendLine("SRCSRVTRG=%SRCSRVCMD%");
            builder.AppendLine("SRCSRV: source files ---------------------------------------");
            foreach (var repo in repositories.Repositories)
            {
                string organization = "";
                string project      = "";
                ExtractRepoInfo(repo.RepositoryUrl, ref organization, ref project);
                foreach (var file in repo.SourceFiles)
                {
                    builder.AppendLine(string.Format("{0}*{1}*{2}*{3}*{4}", file.PdbFilePath, organization, project, repo.CurrentId, file.RelativePath));
                }
            }
            builder.AppendLine("SRCSRV: end------------------------------------------------");
            return(builder.ToString());
        }
Esempio n. 3
0
 public void CompileSourceRepositories()
 {
     if (FrontEnd.Config == null)
     {
         FrontEnd.Config = Config;
     }
     Repositories = FrontEnd.GetRepositoryList(true);
 }
Esempio n. 4
0
        public RepositoryList Clone()
        {
            var clone = new RepositoryList();

            clone.SourceRoot = SourceRoot;
            foreach (var repo in Repositories)
            {
                Repositories.Add(repo.Clone());
            }
            return(clone);
        }
Esempio n. 5
0
        protected RepositoryList FindRepositories(string sourceRoot)
        {
            var repositories = new RepositoryList();

            repositories.SourceRoot = sourceRoot;

            var repos = Git.FindSubModules(sourceRoot);

            var tasks = new List <Task>();

            foreach (var repo in repos)
            {
                var task = new Task(() =>
                {
                    RepositoryInfo repoInfo = new RepositoryInfo();
                    repoInfo.RepositoryName = Git.GetRepoName(repo, Config.Logger);
                    repoInfo.RepositoryType = "git";
                    repoInfo.RepositoryPath = repo;
                    repoInfo.CurrentId      = Git.GetRevisionSha(repo);
                    repoInfo.RepositoryUrl  = Git.FindRemoteUrl(repo);
                    var gitFiles            = Git.GetFileList(repoInfo.RepositoryPath);

                    Config.Logger.Log(VerbosityLevel.Detailed, string.Format("Git repo '{0}' with remote '{1}' at path '{2}' has file list:", repoInfo.RepositoryName, repoInfo.RepositoryUrl, repoInfo.RepositoryPath));
                    foreach (var relativePath in gitFiles)
                    {
                        var sourceFile = new SourceFile();
                        try
                        {
                            var fullPath            = Path.Combine(repoInfo.RepositoryPath, relativePath);
                            sourceFile.FullPath     = Path.GetFullPath(fullPath);
                            sourceFile.RelativePath = relativePath;
                            sourceFile.PdbFilePath  = sourceFile.FullPath;
                            repoInfo.SourceFiles.Add(sourceFile);


                            Config.Logger.Log(VerbosityLevel.Detailed, string.Format("  {0}", fullPath));
                        }
                        catch (Exception)
                        {
                        }
                    }

                    repositories.Repositories.Add(repoInfo);
                    Config.Logger.Log(VerbosityLevel.Basic, string.Format("Found Git module '{0}' at path '{1}' at sha '{2}' with remote '{3}'", repoInfo.RepositoryName, repoInfo.RepositoryPath, repoInfo.CurrentId, repoInfo.RepositoryUrl));
                });
                task.Start();
                tasks.Add(task);
            }
            Task.WaitAll(tasks.ToArray());
            return(repositories);
        }
Esempio n. 6
0
        public override void EvaluateFiles(List <SourceFile> pdbFiles, RepositoryList repositories)
        {
            foreach (var repo in repositories.Repositories)
            {
                List <SourceFile> remainingPdbFiles = new List <SourceFile>();
                Utilities.FindSourceFileIntersection(pdbFiles, repo.RepositoryPath, repo.SourceFiles, ref repo.SourceFiles, ref remainingPdbFiles, Config.Logger);
                pdbFiles = remainingPdbFiles;


                Config.Logger.Log(VerbosityLevel.Basic, string.Format("Repository {0} found with {1} matching files:", repo.RepositoryUrl, repo.SourceFiles.Count));
                if (Config.Logger.IsVerboseEnough(VerbosityLevel.Detailed))
                {
                    foreach (var file in repo.SourceFiles)
                    {
                        Config.Logger.Log(VerbosityLevel.Detailed, string.Format("  {0}", file.FullPath));
                    }
                }
            }
        }
Esempio n. 7
0
        public override string BuildSrcSrvStream(RepositoryList repositories)
        {
            var builder = new StringBuilder();

            builder.AppendLine("SRCSRV: ini ------------------------------------------------");
            builder.AppendLine("VERSION=1");
            builder.AppendLine("VERCTRL=GIT");
            builder.AppendLine("SRCSRV: variables------------------------------------------");
            builder.AppendLine(@"SRCSRVTRG=%fnbksl%(%targ%\%var2%\%var3%\%var4%)");
            builder.AppendLine("SRCSRVCMD=git.exe -C \"%fnvar%(%var2%)\" show %var3%:%var4% > %SRCSRVTRG%");
            builder.AppendLine("SRCSRV: source files ---------------------------------------");
            foreach (var repo in repositories.Repositories)
            {
                foreach (var file in repo.SourceFiles)
                {
                    builder.AppendLine(string.Format("{0}*{1}*{2}*{3}", file.PdbFilePath, repo.RepositoryName, repo.CurrentId, file.RelativePath));
                }
            }
            builder.AppendLine("SRCSRV: end------------------------------------------------");
            return(builder.ToString());
        }
Esempio n. 8
0
        public override string BuildSrcSrvStream(RepositoryList repositories)
        {
            var builder = new StringBuilder();

            builder.AppendLine("SRCSRV: ini ------------------------------------------------");
            builder.AppendLine("VERSION=1");
            builder.AppendLine("VERCTRL=GIT");
            builder.AppendLine("SRCSRV: variables------------------------------------------");
            builder.AppendLine(@"SRCLOCATION=%CMD_SOURCE_INDEXER_PATH%");
            builder.AppendLine(@"SRCSRVTRG=%fnbksl%(%targ%\%var4%\%var5%)");
            builder.AppendLine("SRCSRVCMD=%fnvar%(SRCLOCATION) \"%var2%\" \"%var3%\" \"%var4%\" \"%var5%\" %SRCSRVTRG%");
            builder.AppendLine("SRCSRV: source files ---------------------------------------");
            foreach (var repo in repositories.Repositories)
            {
                foreach (var file in repo.SourceFiles)
                {
                    builder.AppendLine(string.Format("{0}*{1}*{2}*{3}*{4}", file.PdbFilePath, repo.RepositoryType, repo.RepositoryUrl, repo.CurrentId, file.RelativePath));
                }
            }
            builder.AppendLine("SRCSRV: end------------------------------------------------");
            return(builder.ToString());
        }
Esempio n. 9
0
 public abstract string BuildSrcSrvStream(RepositoryList repositories);
Esempio n. 10
0
 public abstract void EvaluateFiles(List <SourceFile> pdbFiles, RepositoryList repositories);