Skip to content

Commit 6ac0d5a

Browse files
authored
indent changes (#428)
1 parent dc72445 commit 6ac0d5a

18 files changed

Lines changed: 161 additions & 178 deletions

commandLine/src/addons/ofAddon.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ void ofAddon::addReplaceStringVector(vector<LibraryBinary> & variable, string va
223223
}
224224
}
225225

226-
226+
227227
if (prefix == "" || v.find(pathToOF.string()) == 0 || fs::path{v}.is_absolute()) {
228228
variable.push_back( { v, "", "" } );
229229
} else {
@@ -399,7 +399,7 @@ void ofAddon::parseConfig(){
399399
if (!fs::exists(fileName)) return;
400400

401401
int lineNum = 0;
402-
402+
403403
for (auto & originalLine : fileToStrings(fileName)) {
404404
lineNum++;
405405
string line = originalLine;
@@ -471,8 +471,8 @@ void ofAddon::parseConfig(){
471471

472472

473473
bool ofAddon::fromFS(const fs::path & path, const string & platform){
474-
// alert("ofAddon::fromFS path : " + path.string());
475-
474+
// alert("ofAddon::fromFS path : " + path.string());
475+
476476
clear();
477477
this->platform = platform;
478478

@@ -494,17 +494,17 @@ bool ofAddon::fromFS(const fs::path & path, const string & platform){
494494

495495
// MARK: srcFiles to fs::path
496496
// not possible today because there are string based exclusion functions
497-
497+
498498
fs::path parentFolder = path.parent_path();
499-
499+
500500
for (auto & s : srcFiles) {
501501
fs::path sFS { s };
502502
fs::path folder;
503503
if (isLocalAddon) {
504504
// folder = sFS.parent_path();
505505
// folder = fs::path { "local_addons" } / sFS.parent_path().filename();
506506
folder = fs::path { "local_addons" } / fs::relative(sFS.parent_path(), parentFolder);
507-
// alert ("isLocal folder=" + folder.string(), 36);
507+
// alert ("isLocal folder=" + folder.string(), 36);
508508
} else {
509509
sFS = fixPath(s);
510510
s = sFS.string();
@@ -517,7 +517,7 @@ bool ofAddon::fromFS(const fs::path & path, const string & platform){
517517
// here addonPath is the same as path.
518518
getPropsRecursively(addonPath, propsFiles, platform);
519519
}
520-
520+
521521
// TODO: Remove comments
522522
// int i = 0;
523523
// for (auto & s : propsFiles) {
@@ -536,18 +536,18 @@ bool ofAddon::fromFS(const fs::path & path, const string & platform){
536536

537537
fs::path libsPath = path / "libs";
538538
vector < fs::path > libFiles;
539-
539+
540540
// alert ("libsPath " + libsPath.string());
541541
if (fs::exists(libsPath)) {
542542
// alert ("exists");
543543
getLibsRecursively(libsPath, libFiles, libs, platform);
544544
if (platform == "osx" || platform == "ios"){
545545
getFrameworksRecursively(libsPath, frameworks, platform);
546-
546+
547547

548548
}
549549
// if(platform == "vs" || platform == "msys2"){
550-
if(platform == "vs" || platform == "msys2"
550+
if(platform == "vs" || platform == "msys2"
551551
|| platform == "vscode"
552552
|| platform == "linux"
553553
|| platform == "linux64"
@@ -558,7 +558,7 @@ bool ofAddon::fromFS(const fs::path & path, const string & platform){
558558
getDllsRecursively(libsPath, dllsToCopy, platform);
559559
}
560560
}
561-
561+
562562
// TODO: this is not needed even if it is local addon but project is outside OF root path
563563
// Absolute paths will be used in this case too.
564564
// Maybe it is the same situation for all others fixPath occurences?
@@ -582,7 +582,7 @@ bool ofAddon::fromFS(const fs::path & path, const string & platform){
582582
srcFiles.emplace_back(s.string());
583583
filesToFolders[s.string()] = folder.string();
584584
}
585-
585+
586586
// FIXME: This is flawed logic, frameworks acquired here will always come from filesystem, config is not yet parsed
587587
// so addons will never be system.
588588
for (const auto & f : frameworks) {
@@ -600,7 +600,7 @@ bool ofAddon::fromFS(const fs::path & path, const string & platform){
600600
; // do we need to do anything here?
601601
} else {
602602
// if addon is local, it is relative to the project folder, and if it is not, it is related to the project folder, ex: addons/ofxSvg
603-
603+
604604
// FIXME:: Cleanup the mess
605605
fs::path rel = fs::relative (f, isLocalAddon ? pathToProject : pathToOF);
606606
fs::path folder = rel.parent_path();
@@ -609,16 +609,16 @@ bool ofAddon::fromFS(const fs::path & path, const string & platform){
609609
fs::path fFS { f };
610610
folder = fs::path { "local_addons" } / fs::relative(fFS.parent_path(), parentFolder);
611611
}
612-
612+
613613
// alert (f);
614614
// alert (folder.string());
615615
filesToFolders[f] = folder.string();
616616
}
617617
}
618618

619-
620619

621-
620+
621+
622622
// paths that are needed for the includes.
623623
std::list < fs::path > paths;
624624

@@ -638,18 +638,18 @@ bool ofAddon::fromFS(const fs::path & path, const string & platform){
638638
paths.emplace_back( isLocalAddon ? path : fixPath(path) );
639639
}
640640
}
641-
642641

643642

644-
643+
644+
645645
paths.sort();
646646

647647
for (auto & p : paths) {
648648
includePaths.emplace_back(p.string());
649649
}
650-
650+
651651
parseConfig();
652-
652+
653653
// alert ("--- LIST LIBS", 35);
654654
// for (auto & l : libs) {
655655
// alert (l.path, 35);

commandLine/src/addons/ofAddon.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,6 @@ class ofAddon {
181181
vector<string> excludeSources;
182182
vector<string> excludeIncludes;
183183
vector<string> excludeFrameworks;
184-
184+
185185
fs::path fixPath(const fs::path & path);
186186
};

commandLine/src/main.cpp

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,10 @@
33

44
#include "optionparser.h"
55
#include "defines.h"
6-
7-
#include <string>
8-
9-
106
#include "Utils.h"
7+
#include <string>
118
#include <set>
129

13-
14-
1510
enum optionIndex { UNKNOWN, HELP, PLUS, RECURSIVE, LISTTEMPLATES, PLATFORMS, ADDONS, OFPATH, VERBOSE, TEMPLATE, DRYRUN, SRCEXTERNAL, VERSION };
1611

1712
constexpr option::Descriptor usage[] =
@@ -129,7 +124,7 @@ bool printTemplates() {
129124
void addPlatforms(const string & value) {
130125
targets.clear();
131126
vector < string > platforms = ofSplitString(value, ",", true, true);
132-
127+
133128
for (auto & p : platforms) {
134129
if (p == "allplatforms") {
135130
for (auto & option : platformsOptions) {
@@ -202,7 +197,7 @@ void updateProject(const fs::path & path, const string & target, bool bConsiderP
202197
}
203198

204199
void recursiveUpdate(const fs::path & path, const string & target) {
205-
// FIXME: remove
200+
// FIXME: remove
206201
alert("recursiveUpdate " + path.string() );
207202
if (!fs::is_directory(path)) return;
208203
vector <fs::path> folders;
@@ -226,7 +221,7 @@ void recursiveUpdate(const fs::path & path, const string & target) {
226221
}
227222

228223
fs::path ofCalcPath = fs::weakly_canonical(fs::current_path() / ofPath);
229-
224+
230225
for (auto & path : folders) {
231226
// cout << "------" << endl;
232227
// cout << path << endl;
@@ -241,8 +236,8 @@ void recursiveUpdate(const fs::path & path, const string & target) {
241236
}
242237
setOFRoot(ofPath);
243238
fs::current_path(path);
244-
//alert ("ofRoot " + ofPath.string());
245-
//alert ("cwd " + path.string());
239+
//alert ("ofRoot " + ofPath.string());
240+
//alert ("cwd " + path.string());
246241

247242
updateProject(path, target, false);
248243
}
@@ -404,7 +399,7 @@ int main(int argc, char** argv){
404399
of::priv::initutils();
405400
startTime = ofGetElapsedTimef();
406401
consoleSpace();
407-
402+
408403
// try to get the OF_PATH as an environt variable
409404
char* pPath;
410405
pPath = getenv("PG_OF_PATH");
@@ -416,7 +411,7 @@ int main(int argc, char** argv){
416411
busingEnvVar = true;
417412
ofPath = ofPathEnv;
418413
}
419-
414+
420415
fs::path projectPath = fs::weakly_canonical(fs::current_path() / projectName);
421416
if (!fs::exists(projectPath)) {
422417
mode = PG_MODE_CREATE;
@@ -449,19 +444,19 @@ int main(int argc, char** argv){
449444
if (!isGoodOFPath(ofPath)) {
450445
return EXIT_USAGE;
451446
}
452-
447+
453448
// alert ("ofPath before " + ofPath.string());
454449
// alert ("projectPath " + projectPath.string());
455450
if (ofPath.is_relative()) {
456451
ofPath = fs::canonical(fs::current_path() / ofPath);
457-
//alert ("ofPath canonical " + ofPath.string());
452+
//alert ("ofPath canonical " + ofPath.string());
458453
}
459-
454+
460455
if (ofIsPathInPath(projectPath, ofPath)) {
461456
ofPath = fs::relative(ofPath, projectPath);
462457
}
463458
fs::current_path(projectPath);
464-
//alert ("ofPath after " + ofPath.string());
459+
//alert ("ofPath after " + ofPath.string());
465460
setOFRoot(ofPath);
466461
}
467462

commandLine/src/projects/CBLinuxProject.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ bool CBLinuxProject::createProjectFile(){
2424
{ templatePath / "Makefile", projectDir / "Makefile" },
2525
{ templatePath / "config.make", projectDir / "config.make" },
2626
};
27-
27+
2828
for (auto & p : fromTo) {
2929
try {
3030
fs::copy_file(p.first, p.second, fs::copy_options::overwrite_existing);
@@ -33,24 +33,24 @@ bool CBLinuxProject::createProjectFile(){
3333
return false;
3434
}
3535
}
36-
36+
3737
// fromTo[0].second is cbp project in destination path.
3838
findandreplaceInTexfile(fromTo[0].second, "emptyExample", projectName);
3939
findandreplaceInTexfile(fromTo[1].second, "emptyExample", projectName);
4040

4141
// Calculate OF Root in relation to each project (recursively);
4242
auto relRoot = fs::relative((fs::current_path() / getOFRoot()), projectDir);
43-
43+
4444
if (!fs::equivalent(relRoot, "../../..")) {
4545
string root = relRoot.string();
4646

4747
std::string root2 = root;
48-
48+
4949
// TODO: check this
5050
// root2.erase(root2.end()-1);
5151
findandreplaceInTexfile(projectDir / "Makefile", "../../..", root2);
5252
findandreplaceInTexfile(projectDir / "config.make", "../../..", root2);
53-
53+
5454
findandreplaceInTexfile(projectDir / (projectName + ".workspace"), "../../../", root);
5555
findandreplaceInTexfile(projectDir / (projectName + ".cbp"), "../../../", root);
5656
}

commandLine/src/projects/CBWinProject.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ bool CBWinProject::createProjectFile(){
1616

1717
auto project = projectDir / (projectName + ".cbp");
1818
auto workspace = projectDir / (projectName + ".workspace");
19-
19+
2020
vector < std::pair <fs::path, fs::path > > fromTo {
2121
{ templatePath / "emptyExample.cbp", projectDir / (projectName + ".cbp") },
2222
{ templatePath / "emptyExample.workspace", projectDir / (projectName + ".workspace") },
2323
{ templatePath / "icon.rc", projectDir / "icon.rc" },
2424
};
25-
25+
2626
for (auto & p : fromTo) {
2727
try {
2828
fs::copy_file(p.first, p.second, fs::copy_options::overwrite_existing);
@@ -31,10 +31,10 @@ bool CBWinProject::createProjectFile(){
3131
return false;
3232
}
3333
}
34-
34+
3535
// Calculate OF Root in relation to each project (recursively);
3636
auto relRoot = fs::relative((fs::current_path() / getOFRoot()), projectDir);
37-
37+
3838
if (!fs::equivalent(relRoot, "../../..")) {
3939
string root = relRoot.string();
4040

commandLine/src/projects/CBWinProject.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include "baseProject.h"
1111

12-
class CBWinProject: public baseProject {
12+
class CBWinProject: public baseProject {
1313
public:
1414
CBWinProject(const std::string & target) : baseProject(target) {};
1515

@@ -22,7 +22,4 @@ class CBWinProject: public baseProject {
2222
void addLibrary(const LibraryBinary & lib);
2323

2424
static std::string LOG_NAME;
25-
26-
private:
27-
2825
};

0 commit comments

Comments
 (0)