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

Added --quit and --build-solutions cmd line options to make CI pipelines possible #16098

Merged
merged 1 commit into from
Feb 19, 2018

Conversation

NathanWarden
Copy link
Contributor

This adds the ability to use the following command line arguments:

-q/--quit
--build-solutions

-q/--quit auto quits the editor after one iteration through the main loop. This allows for assets to be imported and any other command line arguments to be run without hackish solutions such as @brainsick and I were discussing on this thread: #15957

The --build-solutions flag allows for C# to be built (and any other language someone might implement).

Both of these combined make it very easy to integrate and create a CI solution for game projects.

An example of how this looks in bash is:

$GODOT=/path/to/godot
$GODOT -e -q --build-solutions
$GODOT TestRunner.tscn

@brainsick
Copy link
Contributor

You made that look downright easy! You didn't even need an alternative. LOL.

@ghost ghost added the enhancement label Jan 27, 2018
@ghost ghost added this to the 3.1 milestone Jan 27, 2018
@ghost ghost added the topic:editor label Jan 27, 2018
@NathanWarden NathanWarden force-pushed the ci_command_options branch 2 times, most recently from ccd9c83 to ff64db6 Compare January 27, 2018 13:57
@NathanWarden
Copy link
Contributor Author

@brainsick Thanks, I suppose if this PR is accepted I'll take a look and see if I can get this thing running headless next. There's a --no-window flag, but it looks like it only works on Windows.

@NathanWarden
Copy link
Contributor Author

NathanWarden commented Jan 27, 2018

Okay, I updated this pr to call build for the solutions outside of the main loop so as to not have an extra if statement in the main loop.

edit: Put it back in the main loop since it was showing various errors (probably related to the progress bar).

@NathanWarden NathanWarden force-pushed the ci_command_options branch 4 times, most recently from 55aae12 to 4d2a261 Compare January 27, 2018 15:09
main/main.cpp Outdated
}
#endif

return exit | auto_quit;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be ||?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I'm not sure why I did that. Should be logical instead of bitwise now :)

main/main.cpp Outdated
@@ -545,6 +548,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
}
} else if (I->get() == "-u" || I->get() == "--upwards") { // scan folders upwards
upwards = true;
} else if (I->get() == "--build-solutions") { // Build the scripting solution such C#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this one should also be enclosed in #ifdef TOOLS_ENABLED.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be happy to add it. The main reason I didn't is because there aren't any other command line flags, including for --editor, --project-manager, etc, that have the TOOLS_ENABLED compiler flag. Up to you :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually if you rebase, they should have by now :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks for letting me know. They're now moved into the compiler flag :)

@akien-mga akien-mga merged commit ad5ac05 into godotengine:master Feb 19, 2018
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants