Exemple #1
0
 /// <summary>
 ///   Removes the build configuration settings.
 /// </summary>
 /// <param name = "configurationName">Name of the configuration.</param>
 /// <param name = "targetName">Name of the target.</param>
 /// <param name = "key">The key.</param>
 public void RemoveBuildConfigurationSettings(String configurationName, String targetName, String key)
 {
     lock (this.syncRoot) {
         PBXTarget            target             = this.GetTarget(targetName);
         XCBuildConfiguration buildConfiguration = this.GetBuildConfiguration(configurationName, target);
         buildConfiguration.BuildSettings.Remove(key);
     }
 }
Exemple #2
0
 /// <summary>
 ///   Adds the build configuration settings.
 /// </summary>
 /// <param name = "configurationName">Name of the configuration.</param>
 /// <param name = "targetName">Name of the target.</param>
 /// <param name = "key">The key.</param>
 /// <param name = "value">The value.</param>
 public void AddBuildConfigurationSettings(String configurationName, String targetName, String key, Object value)
 {
     lock (this.syncRoot) {
         PBXTarget            target             = this.GetTarget(targetName);
         XCBuildConfiguration buildConfiguration = this.GetBuildConfiguration(configurationName, target);
         buildConfiguration.BuildSettings.Add(new KeyValuePair <String, Object> (key, value));
     }
 }
Exemple #3
0
        /// <summary>
        /// Gets the build configuration.
        /// </summary>
        /// <returns>
        /// The build configuration.
        /// </returns>
        /// <param name="configurationName">The configuration.</param>
        /// <param name="target">The target.</param>
        private XCBuildConfiguration GetBuildConfiguration(String configurationName, PBXTarget target)
        {
            XCConfigurationList  configurationList  = target != null ? target.BuildConfigurationList : this.Project.BuildConfigurationList;
            XCBuildConfiguration buildConfiguration = configurationList.FindConfiguration(configurationName);

            if (buildConfiguration == null)
            {
                buildConfiguration      = new XCBuildConfiguration();
                buildConfiguration.Name = configurationName;
                configurationList.AddBuildConfiguration(buildConfiguration);
                if (configurationList.BuildConfigurations.Count() == 1)
                {
                    configurationList.DefaultConfigurationName = configurationName;
                }
            }
            return(buildConfiguration);
        }
 /// <summary>
 ///   Removes the build configuration.
 /// </summary>
 /// <param name = "configuration">The configuration.</param>
 public void RemoveBuildConfiguration(XCBuildConfiguration configuration)
 {
     this.buildConfigurations.Remove(configuration);
 }
 /// <summary>
 ///   Adds the build configuration.
 /// </summary>
 /// <param name = "configuration">The configuration.</param>
 public void AddBuildConfiguration(XCBuildConfiguration configuration)
 {
     this.buildConfigurations.Add(configuration);
 }
        public void TestProjectGeneration001()
        {
            // Create the document
            PBXDocument document = new PBXDocument();
            PBXProject project = document.Project;

            PBXFileReference file1 = new PBXFileReference();
            file1.LastKnownFileType = PBXFileType.WrapperFramework;
            file1.Name = "Cocoa.framework";
            file1.Path = "/System/Library/Frameworks/Cocoa.framework";
            file1.LastKnownFileType = PBXFileType.WrapperFramework;
            file1.SourceTree = PBXSourceTree.SdkRoot;

            PBXFileReference file2 = new PBXFileReference();
            file2.LastKnownFileType = PBXFileType.WrapperFramework;
            file2.Name = "SurrogateTestAppDelegate.h";
            file2.Path = "SurrogateTestAppDelegate.h";
            file2.LastKnownFileType = PBXFileType.SourcecodeCH;
            file2.SourceTree = PBXSourceTree.Group;

            PBXFileReference file3 = new PBXFileReference();
            file3.LastKnownFileType = PBXFileType.WrapperFramework;
            file3.Name = "en";
            file3.Path = "en.lproj/MainMenu.xib";
            file3.LastKnownFileType = PBXFileType.FileXib;
            file3.SourceTree = PBXSourceTree.Group;

            PBXFileReference file4 = new PBXFileReference();
            file4.LastKnownFileType = PBXFileType.WrapperFramework;
            file4.Name = "fr";
            file4.Path = "fr.lproj/MainMenu.xib";
            file4.LastKnownFileType = PBXFileType.FileXib;
            file4.SourceTree = PBXSourceTree.Group;

            PBXVariantGroup variantGroup = new PBXVariantGroup("MainMenu.xib");
            variantGroup.SourceTree = PBXSourceTree.Group;
            variantGroup.AddChild(file3);
            variantGroup.AddChild(file4);

            PBXGroup group1 = new PBXGroup("Products");
            group1.SourceTree = PBXSourceTree.Group;

            PBXGroup group2 = new PBXGroup("Frameworks");
            group2.SourceTree = PBXSourceTree.Group;
            group2.AddChild(file1);

            PBXGroup group3 = new PBXGroup("Classes");
            group3.SourceTree = PBXSourceTree.Group;
            group3.AddChild(file2);

            PBXGroup group4 = new PBXGroup("Resources");
            group4.SourceTree = PBXSourceTree.Group;
            group4.AddChild(variantGroup);

            PBXGroup group5 = document.Project.MainGroup;
            group5.SourceTree = PBXSourceTree.Group;
            group5.AddChild(group3);
            group5.AddChild(group4);
            group5.AddChild(group2);
            group5.AddChild(group1);

            document.Project.ProductRefGroup = group1;

            // Add build configuration "Release"
            XCBuildConfiguration releaseConfiguration = new XCBuildConfiguration();
            releaseConfiguration.Name = "Release";
            project.BuildConfigurationList.AddBuildConfiguration(releaseConfiguration);
            project.BuildConfigurationList.DefaultConfigurationName = "Release";

            document.WriteToFile("project-001.pbxproj");
        }
 /// <summary>
 ///   Removes the build configuration.
 /// </summary>
 /// <param name = "configuration">The configuration.</param>
 public void RemoveBuildConfiguration(XCBuildConfiguration configuration)
 {
     this.buildConfigurations.Remove (configuration);
 }
 /// <summary>
 ///   Adds the build configuration.
 /// </summary>
 /// <param name = "configuration">The configuration.</param>
 public void AddBuildConfiguration(XCBuildConfiguration configuration)
 {
     this.buildConfigurations.Add (configuration);
 }