Inheritance: PBXElement
Exemplo n.º 1
0
        /// <summary>
        ///   Adds the file.
        /// </summary>
        /// <param name = "groups">The groups.</param>
        /// <param name = "file">The file.</param>
        /// <param name = "targetName">Name of the target.</param>
        /// <returns></returns>
        public PBXBuildFile AddFile(String groups, String file, String targetName)
        {
            lock (this.syncRoot) {
                PBXFileElement fileElement = this.AddFile(groups, file);

                PBXTarget target = this.GetTarget(targetName);
                if (target == null)
                {
                    return(null);
                }

                PBXBuildPhase phase = GetTargetPhase(target, file);
                if (phase == null)
                {
                    return(null);
                }

                PBXBuildFile buildFile = phase.FindFile(fileElement);
                if (buildFile == null)
                {
                    buildFile = new PBXBuildFile(fileElement);
                    phase.AddFile(buildFile);
                }

                return(buildFile);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///   Adds the framework.
        /// </summary>
        /// <param name = "groups">The groups.</param>
        /// <param name = "framework">The framework.</param>
        /// <param name = "targetName">Name of the target.</param>
        /// <returns></returns>
        public PBXBuildFile AddFramework(String groups, String framework, String targetName)
        {
            lock (this.syncRoot) {
                // Test for presence in System
                String path = String.Format(CultureInfo.CurrentCulture, "/System/Library/Frameworks/{0}.framework/{0}", framework);
                if (File.Exists(path))
                {
                    goto bail;
                }

                // Test for presence in Library
                path = String.Format(CultureInfo.CurrentCulture, "/Library/Frameworks/{0}.framework/{0}", framework);
                if (File.Exists(path))
                {
                    goto bail;
                }

                // Fallback: Assume it is a system framework
                path = String.Format(CultureInfo.CurrentCulture, "/System/Library/Frameworks/{0}.framework/{0}", framework);

bail:
                String file = Path.GetDirectoryName(path);
                PBXTarget      target      = this.GetTarget(targetName);
                PBXBuildPhase  phase       = GetTargetPhase <PBXFrameworksBuildPhase> (target);
                PBXFileElement fileElement = this.AddFile(groups, file, PBXSourceTree.Absolute);
                PBXBuildFile   buildFile   = phase.FindFile(fileElement);
                if (buildFile == null)
                {
                    buildFile = new PBXBuildFile(fileElement);
                    phase.AddFile(buildFile);
                }
                return(buildFile);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 ///   Adds the library.
 /// </summary>
 /// <param name = "groups">The groups.</param>
 /// <param name = "library">The library.</param>
 /// <param name = "targetName">Name of the target.</param>
 /// <returns></returns>
 public PBXBuildFile AddLibrary(String groups, String library, String targetName)
 {
     lock (this.syncRoot) {
         PBXTarget      target      = this.GetTarget(targetName);
         PBXBuildPhase  phase       = GetTargetPhase <PBXFrameworksBuildPhase> (target);
         PBXFileElement fileElement = this.AddFile(groups, library, PBXSourceTree.Group);
         PBXBuildFile   buildFile   = phase.FindFile(fileElement);
         if (buildFile == null)
         {
             buildFile = new PBXBuildFile(fileElement);
             phase.AddFile(buildFile);
         }
         return(buildFile);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 ///   Adds the file.
 /// </summary>
 /// <param name = "file">The file.</param>
 public void AddFile(PBXBuildFile file)
 {
     file.BuildPhase = this;
     this.files.Add(file);
 }
Exemplo n.º 5
0
 /// <summary>
 ///   Removes the file.
 /// </summary>
 /// <param name = "file">The file.</param>
 public void RemoveFile(PBXBuildFile file)
 {
     file.BuildPhase = null;
     this.files.Remove(file);
 }
Exemplo n.º 6
0
 /// <summary>
 ///   Removes the file.
 /// </summary>
 /// <param name = "file">The file.</param>
 public void RemoveFile(PBXBuildFile file)
 {
     file.BuildPhase = null;
     this.files.Remove(file);
 }
Exemplo n.º 7
0
 /// <summary>
 ///   Adds the file.
 /// </summary>
 /// <param name = "file">The file.</param>
 public void AddFile(PBXBuildFile file)
 {
     file.BuildPhase = this;
     this.files.Add(file);
 }