From 2f1c3c96daf61594042684127f1967e7dcbd6885 Mon Sep 17 00:00:00 2001 From: Dimitre Date: Fri, 28 Mar 2025 15:44:50 -0300 Subject: [PATCH] v101, fix addons and of folder if project path is unrelated to of --- commandLine/src/defines.h | 4 ++-- commandLine/src/projects/xcodeProject.cpp | 28 ++++++++++++++--------- commandLine/src/projects/xcodeProject.h | 1 - 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/commandLine/src/defines.h b/commandLine/src/defines.h index 92e3fe42..ba4c9fd3 100644 --- a/commandLine/src/defines.h +++ b/commandLine/src/defines.h @@ -1,5 +1,5 @@ -#define OFPROJECTGENERATOR_MAJOR_VERSION "1" -#define OFPROJECTGENERATOR_MINOR_VERSION "0" +#define OFPROJECTGENERATOR_MAJOR_VERSION "0" +#define OFPROJECTGENERATOR_MINOR_VERSION "101" #define OFPROJECTGENERATOR_PATCH_VERSION "0" #define PG_VERSION (OFPROJECTGENERATOR_MAJOR_VERSION "." OFPROJECTGENERATOR_MINOR_VERSION "." OFPROJECTGENERATOR_PATCH_VERSION) diff --git a/commandLine/src/projects/xcodeProject.cpp b/commandLine/src/projects/xcodeProject.cpp index 2206a7bb..49eb0443 100644 --- a/commandLine/src/projects/xcodeProject.cpp +++ b/commandLine/src/projects/xcodeProject.cpp @@ -210,22 +210,27 @@ bool xcodeProject::loadProjectFile() { //base addCommand("# ---- PG VERSION " + getPGVersion()); addCommand("Add :_OFProjectGeneratorVersion string " + getPGVersion()); - renameProject(); - // MARK: just to return something. - return true; -} - -// FIXME: mover pra dentro do loadProjectfile -void xcodeProject::renameProject() { //base - // FIXME: review BUILT_PRODUCTS_DIR - addCommand("Set :objects:" + buildConfigurationListUUID + ":name " + projectName); + // Rename Project + addCommand("Set :objects:" + buildConfigurationListUUID + ":name string " + projectName); // Just OSX here, debug app naming. if (target == "osx") { // TODO: Hardcode to variable // FIXME: Debug needed in name? - addCommand("Set :objects:E4B69B5B0A3A1756003C02F2:path " + projectName + "Debug.app"); + addCommand("Set :objects:E4B69B5B0A3A1756003C02F2:path string " + projectName + "Debug.app"); } + + // if ofRoot is not relative to the project path, + // set correct addons and openFrameworks folders + if (!ofIsPathInPath(fs::current_path(), getOFRoot())) { + addCommand("Set :objects:" + folderUUID["openFrameworks"] + ":path string " + getOFRoot().string() + "/libs/openFrameworks"); + addCommand("Set :objects:" + folderUUID["openFrameworks"] + ":sourceTree string "); + + addCommand("Set :objects:" + folderUUID["addons"] + ":path string " + getOFRoot().string() + "/addons"); + addCommand("Set :objects:" + folderUUID["addons"] + ":sourceTree string "); + } + + return true; } fs::path getPathTo(fs::path path, string limit) { @@ -916,6 +921,7 @@ bool xcodeProject::saveProjectFile() { //if (cols[0] == "Set") { try { json::json_pointer p { json::json_pointer(thispath) }; +// alert (thispath, 95); if (cols[2] == "string") { // find position after find word @@ -947,7 +953,7 @@ bool xcodeProject::saveProjectFile() { } else { thispath = thispath.substr(0, thispath.length() - 1); - // cout << thispath << endl; +// alert (thispath, 95); json::json_pointer p = json::json_pointer(thispath); try { // Fixing XCode one item array issue diff --git a/commandLine/src/projects/xcodeProject.h b/commandLine/src/projects/xcodeProject.h index d8b61784..4a6cc0d5 100644 --- a/commandLine/src/projects/xcodeProject.h +++ b/commandLine/src/projects/xcodeProject.h @@ -61,7 +61,6 @@ class xcodeProject : public baseProject { bool containsObjectiveCPlusPlus(const fs::path &filePath); void saveScheme(); - void renameProject(); string addFile(const fs::path & path, const fs::path & folder, const fileProperties & fp); void addCommand(const string & command);