Example #1
0
        public void Execute(string pchFile, IEnumerable <string> assemblyNames)
        {
            var managed_reader = new AssemblyReader()
            {
                new ReleaseAttributeCheck(),
                new DesignatedInitializerCheck(),
                new DllImportCheck(),
                new EnumCheck(),
                new FieldCheck(),
                new ObjCInterfaceCheck(),
                new ObjCProtocolCheck(),
                new SelectorCheck(),
                new SimdCheck(),
                new RequiresSuperCheck(),
                new DeprecatedCheck(),
                new NullabilityCheck(),
                new UIAppearanceCheck(),
//				new ListNative (), // for debug
            };

            foreach (var assemblyName in assemblyNames)
            {
                var name = Path.GetFileNameWithoutExtension(assemblyName);
                if (name.EndsWith(".iOS", StringComparison.Ordinal))
                {
                    Helpers.Platform = Platforms.iOS;
                }
                else if (name.EndsWith(".Mac", StringComparison.Ordinal))
                {
                    Helpers.Platform = Platforms.macOS;
                }
                else if (name.EndsWith(".WatchOS", StringComparison.Ordinal))
                {
                    Helpers.Platform = Platforms.watchOS;
                }
                else if (name.EndsWith(".TVOS", StringComparison.Ordinal))
                {
                    Helpers.Platform = Platforms.tvOS;
                }
                managed_reader.Load(assemblyName);
            }
            managed_reader.Process();

            var reader = new AstReader();

            foreach (var v in managed_reader)
            {
                reader.TranslationUnitParsed += tu => {
                    tu.Accept(v);
                };
            }

            reader.Load(pchFile);

            managed_reader.End();

            Log.Save();
        }
Example #2
0
        public void Execute(string pchFile, IEnumerable <string> assemblyNames)
        {
            var managed_reader = new AssemblyReader()
            {
                new DesignatedInitializerCheck(),
                new DllImportCheck(),
                new EnumCheck(),
                new FieldCheck(),                  // very noisy now, some stuff are still manually bound / harder to detect
                new ObjCInterfaceCheck(),
                new ObjCProtocolCheck(),
                new SelectorCheck(),
                new SimdCheck(),
//				new ListNative (), // for debug
            };

            foreach (var assemblyName in assemblyNames)
            {
                var name = Path.GetFileNameWithoutExtension(assemblyName);
                if (name.EndsWith(".iOS", StringComparison.Ordinal))
                {
                    Helpers.Platform = Helpers.Platforms.iOS;
                }
                else if (name.EndsWith(".Mac", StringComparison.Ordinal))
                {
                    Helpers.Platform = Helpers.Platforms.macOS;
                }
                else if (name.EndsWith(".WatchOS", StringComparison.Ordinal))
                {
                    Helpers.Platform = Helpers.Platforms.watchOS;
                }
                else if (name.EndsWith(".TVOS", StringComparison.Ordinal))
                {
                    Helpers.Platform = Helpers.Platforms.tvOS;
                }
                managed_reader.Load(assemblyName);
            }

            var reader = new AstReader();

            foreach (var v in managed_reader)
            {
                reader.TranslationUnitParsed += tu => {
                    tu.DeclFilter = ModuleExclusionList.DeclFilter;
                    tu.Accept(v);
                };
            }

            reader.Load(pchFile);

            managed_reader.End();
        }