Skip to content

Add scaffolding functionality to the Godot binary #9306

@adamscott

Description

@adamscott

Describe the project you are working on

Writing a tutorial for using the godot-cpp-template.

Describe the problem or limitation you are having in your project

The godot-cpp template is somewhat difficult to use. It takes into account that you create a project from scratch with the intent of having a GDExtension, which is quite specific.

Telling people to use the godot-cpp template is somewhat vain, as it would be as difficult to explain as the existing godot-cpp tutorial.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Add a new tool in the Godot binary that setups a project in the current directory.
It could be

  • a new Godot project;
  • a godot-cpp project;
  • any other bindings...

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Here how the Godot binary tool could work:

Tool summon

The tool could be summoned with the scaffold keyword after the binary.

$ godot scaffold

It would differ from other existing tools as --doctool as godot scaffold is intended to be felt as a command line app as its own.

Specific help

godot scaffold --help would display the scaffold help, not the general help.

The help could list all the parameters needed for each scaffold module.

Godot Engine v4.3.dev.custom_build.0cab68afd (2024-03-15 19:15:14 UTC) - https://godotengine.org
Free and open source software under the terms of the MIT license.
(c) 2014-present Godot Engine contributors. (c) 2007-present Juan Linietsky, Ariel Manzur.

Usage:
  godot scaffold [type] [options]

General options:
  -h, --help                           Display this help message.
  --version                            Display the version string.
  -v, --verbose                        Use verbose stdout mode.
  --quiet                              Quiet mode, silences stdout messages. Errors are still displayed.
  --no-header                          Do not print engine version and rendering method header on startup.
  --no-interactive                          Do not start the interactive scaffold builder.

godot type options:
  --title                               Project title.

godot-cpp type options:
  --title                               Project title.

Interactive scaffold

Launching godot scaffold without any parameters would launch the interactive scaffold tool. The builder would be launched for every missing parameter, except when --no-interactive would be added as a parameter.

Which scaffold would you like to use?
  Base Godot project
> godot-cpp project
Name of your project
> 
Project directory
(./name_of_my_project) > 

And such.

Declarative scaffold

It would be possible to pass all the parameters a scaffold needs after the scaffold keyword, bypassing the need for an interactive prompt.

If this enhancement will not be used often, can it be worked around with a few lines of script?

This PR is in part essentially the command line equivalent of using the project manager to create a project.

Is there a reason why this should be core and not an add-on in the asset library?

This kind of functionality isn't made for the asset library.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions