@@ -127,7 +127,7 @@ bool xcodeProject::createProjectFile(){
127127 }
128128
129129 // make everything relative the right way.
130- string relRoot = getOFRelPathFS (projectDir).string ();
130+ relRoot = getOFRelPathFS (projectDir).string ();
131131 projectDir = projectDir.lexically_normal ();
132132
133133 // projectDir is always absolute at the moment
@@ -197,7 +197,7 @@ void xcodeProject::renameProject(){ //base
197197 }
198198}
199199
200- string xcodeProject::getFolderUUID (string folder) {
200+ string xcodeProject::getFolderUUID (string folder, bool isFolder ) {
201201 string UUID = " " ;
202202 if ( folderUUID.find (folder) == folderUUID.end () ) { // NOT FOUND
203203 vector < string > folders = ofSplitString (folder, " /" , true );
@@ -217,7 +217,10 @@ string xcodeProject::getFolderUUID(string folder) {
217217
218218 // here we add an UUID for the group (folder) and we initialize an array to receive children (files or folders inside)
219219 commands.emplace_back (" Add :objects:" +thisUUID+" :isa string PBXGroup" );
220- commands.emplace_back (" Add :objects:" +thisUUID+" :name string " +folders[a]);
220+ if (isFolder) {
221+ commands.emplace_back (" Add :objects:" +thisUUID+" :path string " + relRoot + " /" + fullPath);
222+ }
223+ commands.emplace_back (" Add :objects:" +thisUUID+" :name string " + folders[a]);
221224 commands.emplace_back (" Add :objects:" +thisUUID+" :children array" );
222225// commands.emplace_back("Add :objects:"+thisUUID+":sourceTree string <group>");
223226 commands.emplace_back (" Add :objects:" +thisUUID+" :sourceTree string SOURCE_ROOT" );
@@ -452,7 +455,7 @@ void xcodeProject::addFramework(string name, string path, string folder){
452455
453456 // we add one of the build refs to the list of frameworks
454457 // TENTATIVA desesperada aqui...
455- string folderUUID = getFolderUUID (folder);
458+ string folderUUID = getFolderUUID (folder, false );
456459 commands.emplace_back (" Add :objects:" +folderUUID+" :children: string " + UUID);
457460
458461 // commands.emplace_back("Add :objects:"+frameworksUUID+":children array");
@@ -496,7 +499,7 @@ void xcodeProject::addFramework(string name, string path, string folder){
496499 // finally, this is for making folders based on the frameworks position in the addon. so it can appear in the sidebar / file explorer
497500
498501 if (folder.size () > 0 && !ofIsStringInString (folder, " /System/Library/Frameworks" )){
499- string folderUUID = getFolderUUID (folder);
502+ string folderUUID = getFolderUUID (folder, false );
500503 } else {
501504 // FIXME: else what?
502505 }
0 commit comments