/// <summary>
 ///   Compiles the XIB files.
 /// </summary>
 /// <param name = 'monitor'>The progress monitor.</param>
 /// <param name = 'project'>The project.</param>
 /// <param name = 'maker'>The bundle maker.</param>
 /// <param name = 'result'>The build result.</param>
 public static void CompileXIBFiles(IProgressMonitor monitor, MonobjcProject project, BundleMaker maker, BuildResult result)
 {
     XibCompiler xibCompiler = new XibCompiler ();
     IEnumerable<FilePair> files = project.GetIBFiles (Constants.InterfaceDefinition, maker.ResourcesFolder);
     if (files == null || files.Count() == 0) {
         return;
     }
     List<FilePair> pairs = new List<FilePair> (files);
     monitor.BeginTask (GettextCatalog.GetString ("Compiling XIB files..."), files.Count ());
     foreach (FilePair pair in pairs) {
         monitor.Log.WriteLine (GettextCatalog.GetString ("Compiling {0}", pair.Source.ToRelative (project.BaseDirectory)));
         xibCompiler.Logger = new BuildLogger (pair.Source, monitor, result);
         xibCompiler.Compile (pair.Source, pair.DestinationDir);
         monitor.Step (1);
     }
     monitor.EndTask ();
 }
        /// <summary>
        ///   Embeds the XIB files.
        /// </summary>
        /// <param name = 'monitor'>The progress monitor.</param>
        /// <param name = 'project'>The project.</param>
        /// <param name = 'maker'>The bundle maker.</param>
        /// <param name = 'result'>The build result.</param>
        public static void EmbedXIBFiles(IProgressMonitor monitor, MonobjcProject project, BuildResult result)
        {
            XibCompiler xibCompiler = new XibCompiler ();
            IEnumerable<FilePair> files = project.GetIBFiles (Constants.EmbeddedInterfaceDefinition, null);
            if (files == null || files.Count() == 0) {
                return;
            }

            monitor.BeginTask (GettextCatalog.GetString ("Embed XIB files..."), files.Count ());
            foreach (FilePair pair in files) {
                // If the destination file is a place-holder, change its dates
                FileInfo sourceInfo = new FileInfo (pair.Source);
                FileInfo destInfo = new FileInfo (pair.Destination);
                if (destInfo.Length == 0) {
                    DateTime dateTime = sourceInfo.CreationTime.Subtract (new TimeSpan (0, 0, 1));
                    File.SetCreationTime (pair.Destination, dateTime);
                    File.SetLastAccessTime (pair.Destination, dateTime);
                    File.SetLastWriteTime (pair.Destination, dateTime);
                }

                FilePath relativeFile = pair.Source.ToRelative (project.BaseDirectory);
                monitor.Log.WriteLine (GettextCatalog.GetString ("Compiling {0}", relativeFile));
                xibCompiler.Logger = new BuildLogger (pair.Source, monitor, result);
                xibCompiler.Compile (pair.Source, pair.DestinationDir);

                monitor.Step (1);
            }
            monitor.EndTask ();
        }