protected override void Run() { // ensure Mono.Cecil.dll will be in the directory where this is built typeof(Mono.Cecil.AssemblyDefinition).ToString(); base.Run(); var pch = PositionalArguments.DequeueOrDefault(); if (pch == null || !File.Exists(pch)) { throw new ExitException("Precompiled header file (pch) must be specified"); } var assemblies = new List <string> (); while (PositionalArguments.Count > 0) { var dll = PositionalArguments.DequeueOrDefault(); if (dll == null || !File.Exists(dll)) { throw new ExitException("Assembly file (dll) must be specified"); } assemblies.Add(dll); } new Runner().Execute(pch, assemblies); }
protected override void Run() { base.Run(); var pchFile = PositionalArguments.DequeueOrDefault(); string xmPath = PositionalArguments.DequeueOrDefault(); if (pchFile == null || !File.Exists(pchFile)) { throw new ExitException("PCH file must be specified"); } if (xmPath == null || !File.Exists(xmPath)) { throw new ExitException("Xamarin.Mac Assembly must be specified"); } XamarinMacAssembly = Assembly.LoadFrom(xmPath); if (XamarinMacAssembly == null) { throw new ExitException("Unable to load Xamarin.Mac Assembly"); } var reader = new AstReader(); reader.TranslationUnitParsed += tu => tu.Accept(new PropertyGetSetMismatchVisitor()); reader.TranslationUnitParsed += tu => tu.Accept(new PropertyArgumentSemanticVisitor()); if (!reader.Load(pchFile)) { throw new ExitException("PCH file failed to load"); } }