-
Notifications
You must be signed in to change notification settings - Fork 1
MonoGame Content Builder
NOTE: This is preliminary documentation of a feature in progress.
The MonoGame Content Builder (MGCB.exe) is a command line tool for building XNB content on Windows, Mac, and Linux desktop systems.
Typically it is executed indirectly by VisualStudio or MonoDevelop during the build process of a MonoGame project. Alternatively you can use it directly from the command line for specialized build pipelines or for debugging content processing.
The options are processed "left to right". When an option is repeated the last option is always wins.
/outputDir:<directory_path>
It specifies the directory where all content is written. If this option is omitted the output will be put into the current working directory.
/intermediateDir:<directory_path>
It specifies the directory where all intermediate files are written. If this option is omitted the intermediate data will be put into the current working directory.
/rebuild
An optional parameter which forces a full rebuild of all content.
/clean
Delete all previously built content and intermediate files.
/incremental
Skip cleaning files not included in the current build. Useful for custom tools which only require a subset of the game content built.
/reference:<assembly_path>
An optional parameter which adds an assembly reference which contains importers, processors, or writers needed during content building.
/platform:<target_Platform>
Set the target platform for this build. It must be a member of the TargetPlatform enum:
- Windows
- Xbox360
- WindowsPhone
- iOS
- Android
- Linux
- MacOSX
- WindowsStoreApp
- NativeClient
- Ouya
- PlayStationMobile
- WindowsPhone8
- RaspberryPi
If not set it will default to Windows.
/profile:<graphics_Profile>
Set the target graphics profile for this build. It must be a member of the GraphicsProfile enum:
- HiDef
- Reach
If not set it will default to HiDef.
/config:<build_config>
The optional build configuration name from the build system. This is sometimes used as a hint in content processors.
/importer:<class_name>
An optional parameter which defines the class name of the content importer for reading source content. If the option is omitted or used without a class name the default content importer for the source type is used.
/processor:<class_name>
An optional parameter which defines the class name of the content processor for processing imported content. If the option is omitted used without a class name the default content processor for the imported content is used.
/processorParam:<name>=<value>
An optional parameter which defines a parameter name and value to set on a content processor.
/build:<content_filepath>
Instructs the content builder to build the specified content file using the previously set switches and options.
/@:<response_filepath>
This defines a text response file (sometimes called a command file) that contains the same options and switches you would normally find on the command line.
Each switch is specified on a new line. Comment lines are prefixed with #. You can specify multiple response files or mix normal command line switches with response files.
An example response file could look like this:
# Directories
/outputDir:bin/foo
/intermediateDir:obj/foo
/rebuild
# Build a texture
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyEnabled=false
/build:Textures\wood.png
/build:Textures\metal.png
/build:Textures\plastic.png