public override bool Execute() { if (SourceAidlFiles.Length == 0) // nothing to do { return(true); } var opts = new ConverterOptions() { Verbose = true, ParcelableHandling = ParcelableHandling.Ignore, }; if (!string.IsNullOrEmpty(ParcelableHandlingOption)) { opts.ParcelableHandling = ToParcelableHandling(ParcelableHandlingOption); } if (!string.IsNullOrEmpty(OutputNamespace)) { opts.OutputNS = OutputNamespace; } foreach (var file in References) { opts.AddReference(file.ItemSpec); } foreach (var file in SourceAidlFiles) { opts.AddFile(file.ItemSpec); } var tool = new AidlCompiler(); using (var fsw = TextWriter.Null /*File.AppendText (Path.Combine (IntermediateOutputDirectory, "AidlFilesWrittenAbsolute.txt"))*/) { tool.FileWritten += (file, source) => Log.LogDebugMessage("Written ... {0}", file); string outPath = Path.Combine(IntermediateOutputDirectory, "aidl"); var ret = tool.Run(opts, assemblyFile => AssemblyDefinition.ReadAssembly(assemblyFile), (dir, file) => { var dst = Path.GetFullPath(Path.Combine(outPath, Path.ChangeExtension(file, ".cs"))); if (!dst.StartsWith(outPath)) { dst = Path.Combine(outPath, Path.ChangeExtension(Path.GetFileName(file), ".cs")); } string dstdir = Path.GetDirectoryName(dst); if (!Directory.Exists(dstdir)) { Directory.CreateDirectory(dstdir); } fsw.WriteLine(dst); fsw.Flush(); return(dst); }); if (ret.LogMessages.Count > 0) { foreach (var p in ret.LogMessages) { Log.LogError("{0} {1}: {2}", Path.GetFullPath(p.Key), p.Value.Location, p.Value.ToString()); } } } return(true); }