Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electron ^8.0.3 refactor (updated) #240

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
12 changes: 10 additions & 2 deletions commandLine/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "ofMain.h"
#include "optionparser.h"
enum optionIndex { UNKNOWN, HELP, PLUS, RECURSIVE, LISTTEMPLATES, PLATFORMS, ADDONS, OFPATH, VERBOSE, TEMPLATE, DRYRUN };
enum optionIndex { UNKNOWN, HELP, PLUS, RECURSIVE, LISTTEMPLATES, PLATFORMS, ADDONS, OFPATH, VERBOSE, TEMPLATE, DRYRUN, ADDONDEFINES };
constexpr option::Descriptor usage[] =
{
{UNKNOWN, 0, "", "",option::Arg::None, "Options:\n" },
Expand All @@ -13,6 +13,7 @@ constexpr option::Descriptor usage[] =
{VERBOSE, 0,"v","verbose",option::Arg::None, " --verbose, -v \trun verbose" },
{TEMPLATE, 0,"t","template",option::Arg::Optional, " --template, -t \tproject template" },
{DRYRUN, 0,"d","dryrun",option::Arg::None, " --dryrun, -d \tdry run, don't change files" },
{ADDONDEFINES, 0,"D","addondefines",option::Arg::None, " --addondefines, -D \tadd preprocessor defines for each addon" },
{0,0,0,0,0,0}
};

Expand Down Expand Up @@ -70,6 +71,7 @@ bool bRecursive; // do we recurse in update mode?
bool bHelpRequested; // did we request help?
bool bListTemplates; // did we request help?
bool bDryRun; // do dry run (useful for debugging recursive update)
bool bAddonDefines; // add preprocessor defines for addons



Expand Down Expand Up @@ -236,7 +238,6 @@ bool isGoodOFPath(std::string path) {
}



void updateProject(std::string path, ofTargetPlatform target, bool bConsiderParameterAddons = true) {

// bConsiderParameterAddons = do we consider that the user could call update with a new set of addons
Expand All @@ -258,6 +259,8 @@ void updateProject(std::string path, ofTargetPlatform target, bool bConsiderPara
project->parseAddons();
}

if (bAddonDefines) project->addAddonDefineFlags();

if (!bDryRun) project->save();
}

Expand Down Expand Up @@ -340,6 +343,7 @@ int main(int argc, char* argv[]){
//------------------------------------------- pre-parse
bAddonsPassedIn = false;
bDryRun = false;
bAddonDefines = false;
busingEnvVar = false;
bVerbose = false;
mode = PG_MODE_NONE;
Expand Down Expand Up @@ -386,6 +390,10 @@ int main(int argc, char* argv[]){
bDryRun = true;
}

if (options[ADDONDEFINES].count() > 0){
bAddonDefines = true;
}

if (options[VERBOSE].count() > 0){
bVerbose = true;
}
Expand Down
Loading