Пример #1
0
        public ModuleDefinition GetModuleDefinitionFromContent(
            ModuleDescriptor moduleDescriptor,
            ModuleRepository moduleRepository)
        {
            if (m_nameResolutionSemantics == NameResolutionSemantics.ImplicitProjectReferences && moduleDescriptor.Name != PreludeName)
            {
                var moduleConfigurationPath = moduleRepository.RootDir.Combine(moduleRepository.PathTable, Names.ModuleConfigBm);

                return(ModuleDefinition.CreateModuleDefinitionWithImplicitReferences(
                           moduleDescriptor,
                           moduleRepository.RootDir,
                           moduleConfigurationPath,
                           moduleRepository.GetAllPathsForModule(moduleDescriptor),
                           allowedModuleDependencies: null,
                           cyclicalFriendModules: moduleRepository.GetAllModules().Select(
                               descriptor => ModuleReferenceWithProvenance.FromNameAndPath(descriptor.Name, moduleConfigurationPath.ToString(PathTable))),
                           mounts: null));
            }

            return(ModuleDefinition.CreateModuleDefinitionWithExplicitReferencesWithEmptyQualifierSpace(
                       moduleDescriptor,
                       moduleRepository.RootDir.Combine(moduleRepository.PathTable, "FakeMainFile.dsc"),
                       moduleRepository.RootDir.Combine(moduleRepository.PathTable, Names.ModuleConfigBm),
                       moduleRepository.GetAllPathsForModule(moduleDescriptor),
                       PathTable));
        }