Esempio n. 1
0
        IEnumerable <ResponseFileData> ParseResponseFileData(Assembly assembly)
        {
            var systemReferenceDirectories =
                CompilationPipeline.GetSystemAssemblyDirectories(assembly.compilerOptions.ApiCompatibilityLevel);

            Dictionary <string, ResponseFileData> responseFilesData = assembly.compilerOptions.ResponseFiles.ToDictionary(
                x => x, x => m_AssemblyNameProvider.ParseResponseFile(
                    x,
                    ProjectDirectory,
                    systemReferenceDirectories
                    ));

            Dictionary <string, ResponseFileData> responseFilesWithErrors = responseFilesData.Where(x => x.Value.Errors.Any())
                                                                            .ToDictionary(x => x.Key, x => x.Value);

            if (responseFilesWithErrors.Any())
            {
                foreach (var error in responseFilesWithErrors)
                {
                    foreach (var valueError in error.Value.Errors)
                    {
                        Debug.LogError($"{error.Key} Parse Error : {valueError}");
                    }
                }
            }

            return(responseFilesData.Select(x => x.Value));
        }
        IEnumerable <ResponseFileData> ParseResponseFileData(Compilation.Assembly assembly)
        {
            var systemReferenceDirectories = MonoLibraryHelpers.GetSystemReferenceDirectories(assembly.compilerOptions.ApiCompatibilityLevel);

            Dictionary <string, ResponseFileData> responseFilesData = assembly.compilerOptions.ResponseFiles.ToDictionary(x => x, x => m_assemblyNameProvider.ParseResponseFile(
                                                                                                                              x,
                                                                                                                              _projectDirectory,
                                                                                                                              systemReferenceDirectories
                                                                                                                              ));

            Dictionary <string, ResponseFileData> responseFilesWithErrors = responseFilesData.Where(x => x.Value.Errors.Any())
                                                                            .ToDictionary(x => x.Key, x => x.Value);

            if (responseFilesWithErrors.Any())
            {
                foreach (var error in responseFilesWithErrors)
                {
                    foreach (var valueError in error.Value.Errors)
                    {
                        UnityEngine.Debug.LogErrorFormat("{0} Parse Error : {1}", error.Key, valueError);
                    }
                }
            }

            return(responseFilesData.Select(x => x.Value));
        }