コード例 #1
0
        public static int ExecuteForVsix(string VsixPath, string VsixExtractPath, string OutputPath, string CommentsPath)
        {
            var vsixPath           = VsixPath;
            var extractedVsixPath  = VsixExtractPath;
            var logPath            = OutputPath;
            var lciCommentsDirPath = CommentsPath;

            lock (_resultSummaryLock)
            {
                _resultSummary.ExecutionType      = ExecutionType.Vsix;
                _resultSummary.VsixPath           = VsixPath;
                _resultSummary.VsixExtractionPath = VsixExtractPath;
                _resultSummary.OutputPath         = OutputPath;
            }

            WarnIfNoLciDirectory(lciCommentsDirPath);

            VsixUtility.ExtractVsix(vsixPath, extractedVsixPath);

            var englishDlls = FileUtility.GetDlls(extractedVsixPath);

            Execute(lciCommentsDirPath, englishDlls);

            var lockedStringsFalttened = _lockedStrings
                                         .SelectMany(d => d.Value.Select(s => s.Value))
                                         .ToList();

            var exitCode = GetExitCode();

            lock (_resultSummaryLock)
            {
                _resultSummary.ExitCode = exitCode;
            }

            LoggingUtility.LogErrors(
                logPath,
                _identicalLocalizedStrings,
                _mismatchErrors,
                _missingLocalizedErrors,
                lockedStringsFalttened,
                _identicalLocalizedStringDeduped,
                _localizedDlls,
                _resultSummary);

            return(exitCode);
        }
コード例 #2
0
        public static int ExecuteForArtifacts(string ArtifactsPath, string OutputPath, string CommentsPath, string filterPathsContaining)
        {
            var artifactsPath      = ArtifactsPath;
            var logPath            = OutputPath;
            var lciCommentsDirPath = CommentsPath;

            lock (_resultSummaryLock)
            {
                _resultSummary.ExecutionType = ExecutionType.Artifacts;
                _resultSummary.ArtifactsPath = artifactsPath;
                _resultSummary.OutputPath    = OutputPath;
            }

            WarnIfNoLciDirectory(lciCommentsDirPath);

            var englishDlls = FileUtility.GetDlls(artifactsPath,
                                                  isArtifacts: true,
                                                  filterPathsContaining: filterPathsContaining);

            Execute(lciCommentsDirPath, englishDlls);

            var lockedStringsFalttened = _lockedStrings
                                         .SelectMany(d => d.Value.Select(s => s.Value))
                                         .ToList();

            var exitCode = GetExitCode();

            lock (_resultSummaryLock)
            {
                _resultSummary.ExitCode = exitCode;
            }

            LoggingUtility.LogErrors(
                logPath,
                _identicalLocalizedStrings,
                _mismatchErrors,
                _missingLocalizedErrors,
                lockedStringsFalttened,
                _identicalLocalizedStringDeduped,
                _localizedDlls,
                _resultSummary);

            return(exitCode);
        }
コード例 #3
0
        public static int ExecuteForFiles(IList <string> Files, string OutputPath, string CommentsPath)
        {
            var files              = Files;
            var logPath            = OutputPath;
            var lciCommentsDirPath = CommentsPath;

            lock (_resultSummaryLock)
            {
                _resultSummary.ExecutionType = ExecutionType.Files;
                _resultSummary.InputFiles.AddRange(files);
                _resultSummary.OutputPath = OutputPath;
            }

            WarnIfNoLciDirectory(lciCommentsDirPath);

            Execute(lciCommentsDirPath, files.ToArray());

            var lockedStringsFalttened = _lockedStrings
                                         .SelectMany(d => d.Value.Select(s => s.Value))
                                         .ToList();

            var exitCode = GetExitCode();

            lock (_resultSummaryLock)
            {
                _resultSummary.ExitCode = exitCode;
            }

            LoggingUtility.LogErrors(
                logPath,
                _identicalLocalizedStrings,
                _mismatchErrors,
                _missingLocalizedErrors,
                lockedStringsFalttened,
                _identicalLocalizedStringDeduped,
                _localizedDlls,
                _resultSummary);

            return(exitCode);
        }