Skip to content

Commit 5501ffa

Browse files
authored
v101, fix addons and of folder if project path is unrelated to of (#632)
1 parent 3747f24 commit 5501ffa

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

commandLine/src/defines.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#define OFPROJECTGENERATOR_MAJOR_VERSION "1"
2-
#define OFPROJECTGENERATOR_MINOR_VERSION "0"
1+
#define OFPROJECTGENERATOR_MAJOR_VERSION "0"
2+
#define OFPROJECTGENERATOR_MINOR_VERSION "101"
33
#define OFPROJECTGENERATOR_PATCH_VERSION "0"
44

55
#define PG_VERSION (OFPROJECTGENERATOR_MAJOR_VERSION "." OFPROJECTGENERATOR_MINOR_VERSION "." OFPROJECTGENERATOR_PATCH_VERSION)

commandLine/src/projects/xcodeProject.cpp

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -210,22 +210,27 @@ bool xcodeProject::loadProjectFile() { //base
210210
addCommand("# ---- PG VERSION " + getPGVersion());
211211
addCommand("Add :_OFProjectGeneratorVersion string " + getPGVersion());
212212

213-
renameProject();
214-
// MARK: just to return something.
215-
return true;
216-
}
217-
218-
// FIXME: mover pra dentro do loadProjectfile
219-
void xcodeProject::renameProject() { //base
220-
// FIXME: review BUILT_PRODUCTS_DIR
221-
addCommand("Set :objects:" + buildConfigurationListUUID + ":name " + projectName);
213+
// Rename Project
214+
addCommand("Set :objects:" + buildConfigurationListUUID + ":name string " + projectName);
222215

223216
// Just OSX here, debug app naming.
224217
if (target == "osx") {
225218
// TODO: Hardcode to variable
226219
// FIXME: Debug needed in name?
227-
addCommand("Set :objects:E4B69B5B0A3A1756003C02F2:path " + projectName + "Debug.app");
220+
addCommand("Set :objects:E4B69B5B0A3A1756003C02F2:path string " + projectName + "Debug.app");
228221
}
222+
223+
// if ofRoot is not relative to the project path,
224+
// set correct addons and openFrameworks folders
225+
if (!ofIsPathInPath(fs::current_path(), getOFRoot())) {
226+
addCommand("Set :objects:" + folderUUID["openFrameworks"] + ":path string " + getOFRoot().string() + "/libs/openFrameworks");
227+
addCommand("Set :objects:" + folderUUID["openFrameworks"] + ":sourceTree string <absolute>");
228+
229+
addCommand("Set :objects:" + folderUUID["addons"] + ":path string " + getOFRoot().string() + "/addons");
230+
addCommand("Set :objects:" + folderUUID["addons"] + ":sourceTree string <absolute>");
231+
}
232+
233+
return true;
229234
}
230235

231236
fs::path getPathTo(fs::path path, string limit) {
@@ -916,6 +921,7 @@ bool xcodeProject::saveProjectFile() {
916921
//if (cols[0] == "Set") {
917922
try {
918923
json::json_pointer p { json::json_pointer(thispath) };
924+
// alert (thispath, 95);
919925

920926
if (cols[2] == "string") {
921927
// find position after find word
@@ -947,7 +953,7 @@ bool xcodeProject::saveProjectFile() {
947953

948954
} else {
949955
thispath = thispath.substr(0, thispath.length() - 1);
950-
// cout << thispath << endl;
956+
// alert (thispath, 95);
951957
json::json_pointer p = json::json_pointer(thispath);
952958
try {
953959
// Fixing XCode one item array issue

commandLine/src/projects/xcodeProject.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ class xcodeProject : public baseProject {
6161
bool containsObjectiveCPlusPlus(const fs::path &filePath);
6262

6363
void saveScheme();
64-
void renameProject();
6564

6665
string addFile(const fs::path & path, const fs::path & folder, const fileProperties & fp);
6766
void addCommand(const string & command);

0 commit comments

Comments
 (0)