Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion commandLine/src/defines.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define OFPROJECTGENERATOR_MAJOR_VERSION "0"
#define OFPROJECTGENERATOR_MINOR_VERSION "120"
#define OFPROJECTGENERATOR_MINOR_VERSION "121"
#define OFPROJECTGENERATOR_PATCH_VERSION "0"

#define PG_VERSION (OFPROJECTGENERATOR_MAJOR_VERSION "." OFPROJECTGENERATOR_MINOR_VERSION "." OFPROJECTGENERATOR_PATCH_VERSION)
Expand Down
21 changes: 18 additions & 3 deletions commandLine/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ constexpr option::Descriptor usage[] = {
{ SRCEXTERNAL, 0, "s", "source", option::Arg::Optional, " --source, -s \trelative or absolute path to source or include folders external to the project (such as ../../../../common_utils/" },
{ VERSION, 0, "w", "version", option::Arg::None, " --version, -w \treturn the current version" },
{ GET_OFPATH, 0, "g", "getofpath", option::Arg::None, " --getofpath, -g \treturn the current ofPath" },
{ GET_HOST_PLATFORM, 0, "i", "platform", option::Arg::None, " --getplatform, -i \treturn the current host platform" },
{ GET_HOST_PLATFORM, 0, "i", "getplatform", option::Arg::None, " --getplatform, -i \treturn the current host platform" },
{ GET_EMSDK, 0, "e", "getemsdk", option::Arg::None, " --getemsdk, -e \tdetect the Emscripten SDK (EMSDK env var, PATH, or a Homebrew install) and return its location" },
{ OFMENU, 0, "m", "ofmenu", option::Arg::Optional, " --ofmenu, -m \trun an oF Menu (scripts/of.sh) command: status | update-libs" },
{ COMMAND, 0, "c", "command", option::Arg::None, " --command, -c \truns command" },
Expand Down Expand Up @@ -482,8 +482,9 @@ int pgMain(int argc, char ** argv) {
std::string a { argv[i] };
bool isValueOption = (a.size() == 2 && a[0] == '-' && valueShort.find(a[1]) != std::string::npos)
|| (a.rfind("--", 0) == 0 && std::find(valueLong.begin(), valueLong.end(), a.substr(2)) != valueLong.end());
bool keyword = a == "-m" || a == "--ofmenu"; // status / update-libs, no project path after it
if (isValueOption && i + 1 < argc && argv[i + 1][0] != '-' && (i + 2 < argc || keyword)) {
// only -f / --frameworks / --system-libs mean something empty (remove), so -f <path> keeps the path
bool emptyMeansRemove = a == "-f" || a == "--frameworks" || a == "--system-libs";
if (isValueOption && i + 1 < argc && argv[i + 1][0] != '-' && (i + 2 < argc || !emptyMeansRemove)) {
joinedArgs.emplace_back(a + (a.size() == 2 ? "" : "=") + argv[i + 1]);
i++;
} else {
Expand All @@ -505,6 +506,12 @@ int pgMain(int argc, char ** argv) {
messageError("Parse error for arguments");
return 1;
}
if (options[UNKNOWN].count() > 0) {
std::string unknown;
for (option::Option * o = options[UNKNOWN]; o; o = o->next()) unknown += std::string(unknown.empty() ? "" : ", ") + o->name;
messageError("Unknown option: " + unknown + " - see --help");
return EXIT_USAGE;
}

if (options[VERBOSE].count() > 0) {
bVerbose = true;
Expand Down Expand Up @@ -612,6 +619,14 @@ int pgMain(int argc, char ** argv) {
}
}

// getTargetProject has no project for these, which crashed (-p bogus, or no host platform)
for (auto & t : targets) {
if (!getTargetProject(t)) {
messageError("Unknown platform: \"" + t + "\" - see --help");
return EXIT_USAGE;
}
}

if (options[MSYS2ENV].count() > 0 && options[MSYS2ENV].arg != NULL) {
std::string env = ofToLower(ofTrim(options[MSYS2ENV].arg));
if (env == "ucrt64" || env == "mingw64" || env == "clang64" || env == "clangarm64") {
Expand Down
2 changes: 1 addition & 1 deletion commandLine/src/utils/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ std::string getPlatformString() {
else {
return "linux64";
}
#elif defined(__WIN32__)
#elif defined(_WIN32) || defined(__WIN32__)
#if defined(__MINGW32__) || defined(__MINGW64__)
return "msys2";
#else
Expand Down
4 changes: 2 additions & 2 deletions frontend/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "projectGenerator",
"productName": "projectGenerator",
"version": "0.114.0",
"version": "0.115.0",
"description": "Build electron GUI openFrameworks projectGenerator",
"license": "MIT",
"main": "index.js",
Expand Down
3 changes: 3 additions & 0 deletions scripts/linux/test_cmdline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,7 @@ errorcode=$?
if [[ $errorcode -ne 0 ]]; then
exit $errorcode
fi
echo "Test command line arguments"
"${CURRENT_DIR}/../test_cmdline_args.sh" ./projectGenerator ../../../../ linux64

echo "Successful projectGenerator tests for [linux64]";
7 changes: 5 additions & 2 deletions scripts/osx/test_cmdline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,21 @@ fi

echo "Test: projectGenerator building"
echo "Test 1: test examples templates - auto path to openFrameworks core"
./projectGenerator --recursive -posx ../../examples/templates
./projectGenerator --recursive -posx ../../examples/templates || exit 1
echo "Test 1: test examples templates - success"

echo "Test: projectGenerator building"
echo "Test 2: all examples - defined core openFrameworks path ../../"
./projectGenerator --recursive -posx -o../../ ../../examples/ ./projectGenerator
./projectGenerator --recursive -posx -o../../ ../../examples/ || exit 1
echo "Test 2: all examples - success"

echo "Test 3: addon defines / cflags / sources in every Xcode app target (osx, macos, ios, tvos)"
"${CURRENT_DIR}/test_xcode_addon_flags.sh" ./projectGenerator "${PG_DIR}/../.." || exit 1
echo "Test 3: addon defines / cflags / sources - success"

echo "Test 4: command line arguments"
"${CURRENT_DIR}/../test_cmdline_args.sh" ./projectGenerator "${PG_DIR}/../.." osx || exit 1

# echo "test out of folder -o [vs]";
# rm -rf ../../../../../pg2
# mkdir -p ../../../../../pg2
Expand Down
Loading
Loading