From 6399e58d12f3e54505c141fe424ed52a19e3d62d Mon Sep 17 00:00:00 2001 From: Dimitre Date: Wed, 12 Jul 2023 18:49:03 -0300 Subject: [PATCH 1/5] fix additional sources issue --- commandLine/src/main.cpp | 5 +++++ commandLine/src/projects/baseProject.cpp | 8 +++++--- scripts/osx/buildPG.sh | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/commandLine/src/main.cpp b/commandLine/src/main.cpp index 2776bb25..6fdd4860 100644 --- a/commandLine/src/main.cpp +++ b/commandLine/src/main.cpp @@ -405,8 +405,13 @@ int main(int argc, char** argv){ string srcString(options[SRCEXTERNAL].arg); // TODO: TEST for (auto & s : ofSplitString(srcString, ",", true, true)) { + s = ofFilePath::removeTrailingSlash(s); srcPaths.emplace_back(s); } + + for (auto & s : srcPaths) { + alert ("additional src folder : " + s.string()); + } // srcPaths = ofSplitString(srcString, ",", true, true); } } diff --git a/commandLine/src/projects/baseProject.cpp b/commandLine/src/projects/baseProject.cpp index a04240fe..82d304d2 100644 --- a/commandLine/src/projects/baseProject.cpp +++ b/commandLine/src/projects/baseProject.cpp @@ -273,8 +273,6 @@ void baseProject::addAddon(string addonName){ fixSlashOrder(addonName); #endif - - ofAddon addon; // MARK: Review this path here. EDIT: I think it is finally good @@ -357,6 +355,8 @@ void baseProject::addAddon(string addonName){ } void baseProject::addSrcRecursively(const fs::path & srcPath){ + ofLog() << "using additional source folder " << srcPath.string(); +// alert("--"); // alert("addSrcRecursively " + srcPath.string()); fs::path base = srcPath.parent_path(); // alert("base = " + base.string()); @@ -367,10 +367,12 @@ void baseProject::addSrcRecursively(const fs::path & srcPath){ // bool isRelative = ofIsPathInPath(fs::absolute(srcPath), getOFRoot()); std::unordered_set uniqueIncludeFolders; + for( auto & src : srcFilesToAdd){ fs::path parent = src.parent_path(); fs::path folder = parent.lexically_relative(base); -// alert ("addSrc " + src.string() + " : " + folder.string()); + + // alert ("addSrc file:" + src.string() + " -- folder:" + folder.string(), 35); addSrc(src.string(), folder.string()); if (parent.string() != "") { uniqueIncludeFolders.insert(parent.string()); diff --git a/scripts/osx/buildPG.sh b/scripts/osx/buildPG.sh index 03e6407d..e8daa098 100755 --- a/scripts/osx/buildPG.sh +++ b/scripts/osx/buildPG.sh @@ -196,6 +196,7 @@ if [[ $errorcode -ne 0 ]]; then fi # install electron sign globally +# sudo npx create-react-app electron-osx-sign sudo npm install -g electron-osx-sign if [ -d "/Users/runner/" ]; then From 846bb5e7b634e41e4bb5f778535fcc80fabe4040 Mon Sep 17 00:00:00 2001 From: Dimitre Date: Wed, 12 Jul 2023 22:42:32 -0300 Subject: [PATCH 2/5] fix one issue while creating a folder outside of OF path was returning relative instead of absolute --- commandLine/src/projects/xcodeProject.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/commandLine/src/projects/xcodeProject.cpp b/commandLine/src/projects/xcodeProject.cpp index d5eb713f..9797ca12 100644 --- a/commandLine/src/projects/xcodeProject.cpp +++ b/commandLine/src/projects/xcodeProject.cpp @@ -13,6 +13,7 @@ xcodeProject::xcodeProject(string target) folderUUID = { { "src", "E4B69E1C0A3A1BDC003C02F2" }, { "addons", "BB4B014C10F69532006C3DED" }, + { "openFrameworks", "191EF70929D778A400F35F26" }, // { "localAddons", "6948EE371B920CB800B5AC1A" }, { "", "E4B69B4A0A3A1720003C02F2" } }; @@ -127,10 +128,14 @@ bool xcodeProject::createProjectFile(){ } // Calculate OF Root in relation to each project (recursively); - auto relRoot = fs::relative((fs::current_path() / getOFRoot()), projectDir); + fs::path relRoot; + if (ofIsPathInPath(fs::current_path(), getOFRoot())) { + auto relRoot = fs::relative((fs::current_path() / getOFRoot()), projectDir); + } if (!fs::equivalent(relRoot, "../../..")) { string root = relRoot.string(); + alert ("root = " + root); findandreplaceInTexfile(projectDir / (projectName + ".xcodeproj/project.pbxproj"), "../../..", root); findandreplaceInTexfile(projectDir / "Project.xcconfig", "../../..", root); if( target == "osx" ){ @@ -870,7 +875,7 @@ bool xcodeProject::saveProjectFile(){ } } -// for (auto & c : commands) cout << c << endl +// for (auto & c : commands) cout << c << endl; return true; } From a8536ad811a9f05ef345b49b7e28cfdbefe5b786 Mon Sep 17 00:00:00 2001 From: Dimitre Date: Thu, 13 Jul 2023 11:08:59 -0300 Subject: [PATCH 3/5] remove alert --- commandLine/src/main.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/commandLine/src/main.cpp b/commandLine/src/main.cpp index 6fdd4860..e0d74dfb 100644 --- a/commandLine/src/main.cpp +++ b/commandLine/src/main.cpp @@ -407,12 +407,8 @@ int main(int argc, char** argv){ for (auto & s : ofSplitString(srcString, ",", true, true)) { s = ofFilePath::removeTrailingSlash(s); srcPaths.emplace_back(s); + //alert ("additional src folder : " + s); } - - for (auto & s : srcPaths) { - alert ("additional src folder : " + s.string()); - } -// srcPaths = ofSplitString(srcString, ",", true, true); } } From 534af5df6079dea0302d2b83e603fb4ea9b4a37a Mon Sep 17 00:00:00 2001 From: Dimitre Date: Thu, 13 Jul 2023 11:24:46 -0300 Subject: [PATCH 4/5] fix relPath --- commandLine/src/main.cpp | 4 ++-- commandLine/src/projects/xcodeProject.cpp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/commandLine/src/main.cpp b/commandLine/src/main.cpp index e0d74dfb..f344e9f7 100644 --- a/commandLine/src/main.cpp +++ b/commandLine/src/main.cpp @@ -272,8 +272,8 @@ void recursiveUpdate(const fs::path & path, ofTargetPlatform target) { } setOFRoot(ofPath); fs::current_path(path); - alert ("ofRoot " + ofPath.string()); - alert ("cwd " + path.string()); +// alert ("ofRoot " + ofPath.string()); +// alert ("cwd " + path.string()); updateProject(path, target, false); } diff --git a/commandLine/src/projects/xcodeProject.cpp b/commandLine/src/projects/xcodeProject.cpp index 9797ca12..b450c8fc 100644 --- a/commandLine/src/projects/xcodeProject.cpp +++ b/commandLine/src/projects/xcodeProject.cpp @@ -128,11 +128,13 @@ bool xcodeProject::createProjectFile(){ } // Calculate OF Root in relation to each project (recursively); - fs::path relRoot; + fs::path relRoot { getOFRoot() }; if (ofIsPathInPath(fs::current_path(), getOFRoot())) { auto relRoot = fs::relative((fs::current_path() / getOFRoot()), projectDir); } + + if (!fs::equivalent(relRoot, "../../..")) { string root = relRoot.string(); alert ("root = " + root); From 3772db36779e493fd47fa73ee0a84d92779fe23b Mon Sep 17 00:00:00 2001 From: Dimitre Date: Thu, 13 Jul 2023 11:25:02 -0300 Subject: [PATCH 5/5] update pg version --- commandLine/src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commandLine/src/main.cpp b/commandLine/src/main.cpp index f344e9f7..eda12abf 100644 --- a/commandLine/src/main.cpp +++ b/commandLine/src/main.cpp @@ -1,4 +1,4 @@ -#define PG_VERSION "PG v010" +#define PG_VERSION "PG v011" #define TARGET_NO_SOUND #define TARGET_NODISPLAY