In the editor: Select the new platform, like "Web", in the "Run → Platforms → …" menu. Then you can save it for the future using menu item "Run → Platforms → Save Chosen Platform As Default (in Project Local Settings)".
Alternatively and equivalently:
You can create a file CastleProjectLocalSettings.json
in your project. Place it at the top-level of the project, so it is next to the CastleEngineManifest.xml file. The CastleProjectLocalSettings.json
can contain settings that are specific to your local user or machine.
For example, it can specify that the default target is web like this:
{
"$$ClassName" : "TCastleProjectLocalSettings",
"UsePlatformDefaults" : true,
"DefaultTarget": "targetWeb"
}
Changing the default platform is useful if you want to always build and run for the web, without specifying --target=web
every time. Now using just castle-engine compile
and castle-engine run
will build and run for the web. You can still override this at command-line, using the --target
, --os
, --cpu
options (see build tool docs).
Note
|
The CastleProjectLocalSettings.json support is not strictly a feature of the web target, it’s useful in every case when you want to change the default platform (and we plan to add there more things). By default, we build and run for the current desktop target, with current OS and CPU.
|
Note that you can also open the CastleProjectLocalSettings.json
as a design in the editor and edit the component in the object inspector. That’s because TCastleProjectLocalSettings
is a regular serializable component for our engine. Right now, this doesn’t really imply any new features, but it may, and it will be compatible with future CastleProject.json.
Warning
|
The file CastleProjectLocalSettings.json should not be committed to the version control, it should be ignored by file like .gitignore (if you use GIT).
|