public void SearchInputs()
        {
            foreach (var path in AssemblyDirs)
            {
                if (!Directory.Exists(path))
                {
                    continue;
                }

                var files = Directory.EnumerateFiles(path, "*.dll");

                foreach (var file in files)
                {
                    var matches = false;
                    foreach (var assembly in Assemblies)
                    {
                        matches |= Regex.IsMatch(Path.GetFileName(file), assembly);
                    }

                    if (!matches)
                    {
                        continue;
                    }

                    var input = new ProjectInput
                    {
                        BasePath = path,
                        FullPath = file,
                    };

                    AssemblyInputs.Add(input);
                }
            }
        }
Exemple #2
0
        ParserResult <IKVM.Reflection.Assembly> ParseAssembly(ProjectInput input)
        {
            var result = new ParserResult <IKVM.Reflection.Assembly>
            {
                Input = input
            };

            if (!File.Exists(input.FullPath))
            {
                result.Kind = ParserResultKind.FileNotFound;
                return(result);
            }

            try
            {
                var res = Universe.LoadFile(input.FullPath);
                result.Output = res;
            }
            catch (Exception ex)
            {
                result.Message = ex.ToString();
                result.Kind    = ParserResultKind.Error;
            }
            finally
            {
                OnAssemblyParsed(result);
            }

            return(result);
        }
        public void BuildInputs()
        {
            foreach (var assembly in Assemblies)
            {
                var file = Path.GetFullPath(assembly);

                if (!File.Exists(file))
                {
                    continue;
                }

                var input = new ProjectInput
                {
                    BasePath = Path.GetDirectoryName(file),
                    FullPath = file
                };

                AssemblyInputs.Add(input);
            }
        }