예제 #1
0
        private ExtractMetadataInputModel ConvertToInputModel(MetadataJsonItemConfig configModel)
        {
            var projects = configModel.Source;
            // If Root Output folder is specified from command line, use it instead of the base directory
            var outputFolder = Path.Combine(Config.OutputFolder ?? Config.BaseDirectory ?? string.Empty, configModel.Destination ?? DocAsCode.Constants.DefaultMetadataOutputFolderName);
            var inputModel   = new ExtractMetadataInputModel
            {
                PreserveRawInlineComments = configModel?.Raw ?? false,
                ForceRebuild             = configModel?.Force ?? false,
                ShouldSkipMarkup         = configModel?.ShouldSkipMarkup ?? false,
                ApiFolderName            = string.Empty,
                FilterConfigFile         = configModel?.FilterConfigFile,
                GlobalNamespaceId        = configModel?.GlobalNamespaceId,
                UseCompatibilityFileName = configModel?.UseCompatibilityFileName ?? false,
                MSBuildProperties        = configModel?.MSBuildProperties
            };

            var expandedFileMapping = GlobUtility.ExpandFileMapping(Config.BaseDirectory, projects);

            inputModel.Items = new Dictionary <string, List <string> >
            {
                [outputFolder] = expandedFileMapping.Items.SelectMany(s => s.Files).ToList(),
            };

            return(inputModel);
        }
예제 #2
0
        private ExtractMetadataInputModel ConvertToInputModel(MetadataJsonItemConfig configModel)
        {
            var projects     = configModel.Source;
            var references   = configModel.References;
            var outputFolder = configModel.Destination ?? Constants.DefaultMetadataOutputFolderName;
            var inputModel   = new ExtractMetadataInputModel
            {
                PreserveRawInlineComments = configModel?.Raw ?? false,
                ForceRebuild             = configModel?.Force ?? false,
                ShouldSkipMarkup         = configModel?.ShouldSkipMarkup ?? false,
                FilterConfigFile         = configModel?.FilterConfigFile,
                GlobalNamespaceId        = configModel?.GlobalNamespaceId,
                UseCompatibilityFileName = configModel?.UseCompatibilityFileName ?? false,
                MSBuildProperties        = configModel?.MSBuildProperties,
                OutputFolder             = outputFolder,
                CodeSourceBasePath       = configModel?.CodeSourceBasePath,
                DisableDefaultFilter     = configModel?.DisableDefaultFilter ?? false,
            };

            var expandedFiles      = GlobUtility.ExpandFileMapping(EnvironmentContext.BaseDirectory, projects);
            var expandedReferences = GlobUtility.ExpandFileMapping(EnvironmentContext.BaseDirectory, references);

            inputModel.Files      = expandedFiles.Items.SelectMany(s => s.Files).ToList();
            inputModel.References = expandedReferences?.Items.SelectMany(s => s.Files).ToList();

            return(inputModel);
        }
예제 #3
0
        private ExtractMetadataInputModel ConvertToInputModel(MetadataJsonItemConfig configModel)
        {
            var projects = configModel.Source;
            // If Root Output folder is specified from command line, use it instead of the base directory
            var outputFolder = Path.Combine(Config.OutputFolder ?? Config.BaseDirectory ?? string.Empty, configModel.Destination ?? Constants.DefaultMetadataOutputFolderName);
            var inputModel   = new ExtractMetadataInputModel
            {
                PreserveRawInlineComments = configModel.Raw,
                ForceRebuild  = configModel.Force,
                ApiFolderName = string.Empty,
            };

            var expandedFileMapping = GlobUtility.ExpandFileMapping(Config.BaseDirectory, projects);

            inputModel.Items = new Dictionary <string, List <string> >
            {
                [outputFolder] = expandedFileMapping.Items.SelectMany(s => s.Files).ToList(),
            };

            return(inputModel);
        }