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); } }
public PBXBuildFile(PBXVariantGroup fileRef) { FileReference = fileRef; }
public PBXBuildFile (PBXVariantGroup fileRef) { FileReference = fileRef; }
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); } }