예제 #1
0
        public void AddResource(string path, PBXGroup grp = null)
        {
            string       dir = Path.GetDirectoryName(path);
            PBXBuildFile buildFile;

            if (dir.EndsWith(".lproj"))
            {
                string          name    = Path.GetFileName(path);
                PBXVariantGroup variant = GetGroup(name) as PBXVariantGroup;

                if (variant == null)
                {
                    variant = new PBXVariantGroup(name);
                    groups.Add(variant);

                    if (grp == null)
                    {
                        projectGroup.AddChild(variant);
                    }
                    else
                    {
                        grp.AddChild(variant);
                    }

                    buildFile = new PBXBuildFile(variant);
                    resourcesBuildPhase.AddResource(buildFile);
                }

                string lang = dir.Substring(0, dir.LastIndexOf('.'));
                project.KnownRegions.Add(lang);

                var fileref = new PBXFileReference(path, "\"<group>\"");
                variant.AddChild(fileref);
                files.Add(fileref);
            }
            else
            {
                if (grp == null)
                {
                    grp = CreateGroupFromPath(path);
                }

                buildFile = AddFile(path, "\"<group>\"", grp);
                resourcesBuildPhase.AddResource(buildFile);
            }
        }
예제 #2
0
 public PBXBuildFile(PBXVariantGroup fileRef)
 {
     FileReference = fileRef;
 }
예제 #3
0
		public PBXBuildFile (PBXVariantGroup fileRef)
		{
			FileReference = fileRef;
		}
예제 #4
0
		public void AddResource (string path, PBXGroup grp = null)
		{
			string dir = Path.GetDirectoryName (path);
			PBXBuildFile buildFile;
			
			if (dir.EndsWith (".lproj")) {
				string name = Path.GetFileName (path);
				PBXVariantGroup variant = GetGroup (name) as PBXVariantGroup;
				
				if (variant == null) {
					variant = new PBXVariantGroup (name);
					groups.Add (variant);
					
					if (grp == null)
						projectGroup.AddChild (variant);
					else
						grp.AddChild (variant);
					
					buildFile = new PBXBuildFile (variant);
					resourcesBuildPhase.AddResource (buildFile);
				}
				
				string lang = dir.Substring (0, dir.LastIndexOf ('.'));
				project.KnownRegions.Add (lang);
				
				var fileref = new PBXFileReference (path, "\"<group>\"");
				variant.AddChild (fileref);
				files.Add (fileref);
			} else {
				if (grp == null)
					grp = CreateGroupFromPath (path);
				
				buildFile = AddFile (path, "\"<group>\"", grp);
				resourcesBuildPhase.AddResource (buildFile);
			}
		}