/// <summary>
        /// Returns a list of tuples that contains the name of the assembly and the required hint path. If the
        /// path is null it means that the assembly is part of the distribution.
        /// </summary>
        /// <param name="monoRootPath">The root path of the mono checkout.</param>
        /// <param name="platform">The platform we are working with.</param>
        /// <returns>The list of tuples (assembly name, path hint) for all the assemblies in the project.</returns>
        public List <(string assembly, string hintPath)> GetAssemblyInclusionInformation(string monoRootPath,
                                                                                         Platform platform, bool wasDownloaded)
        {
            if (monoRootPath == null)
            {
                throw new ArgumentNullException(nameof(monoRootPath));
            }

            return(GetProjectAssemblyReferences(monoRootPath, platform, wasDownloaded).Select(
                       a => (assembly: a,
                             hintPath: BCLTestAssemblyDefinition.GetHintPathForRefenreceAssembly(a, monoRootPath, platform))).Union(
                       TestAssemblies.Select(
                           definition => (assembly: definition.Name,
                                          hintPath: definition.GetPath(monoRootPath, platform, wasDownloaded))))
                   .ToList());
        }
示例#2
0
        /// <summary>
        /// Returns a list of tuples that contains the name of the assembly and the required hint path. If the
        /// path is null it means that the assembly is part of the distribution.
        /// </summary>
        /// <param name="monoRootPath">The root path of the mono checkout.</param>
        /// <param name="platform">The platform we are working with.</param>
        /// <returns>The list of tuples (assembly name, path hint) for all the assemblies in the project.</returns>
        public (string FailureMessage, List <(string assembly, string hintPath)> Assemblies) GetAssemblyInclusionInformation(string monoRootPath,
                                                                                                                             Platform platform, bool wasDownloaded)
        {
            if (monoRootPath == null)
            {
                throw new ArgumentNullException(nameof(monoRootPath));
            }

            var references = GetProjectAssemblyReferences(monoRootPath, platform, wasDownloaded);

            if (!string.IsNullOrEmpty(references.FailureMessage))
            {
                return(references.FailureMessage, null);
            }
            var asm = references.References.Select(
                a => (assembly: a,
                      hintPath: BCLTestAssemblyDefinition.GetHintPathForRefenreceAssembly(a, monoRootPath, platform, wasDownloaded))).Union(
                TestAssemblies.Select(
                    definition => (assembly: definition.GetName(platform),
                                   hintPath: definition.GetPath(monoRootPath, platform, wasDownloaded))))
                      .ToList();

            return(null, asm);
        }