Skip to content

MonoGame Content Builder

tomspilman edited this page Jan 26, 2013 · 21 revisions

NOTE: This is preliminary documentation of a feature in progress.

The MonoGame Content Builder (MGCB.exe) is a command line tool for building content on Windows, Mac, and Linux desktop systems.

Typically it is executed indirectly by VisualStudio or MonoDevelop when building content for MonoGame. Alternatively you can use it directly from the command line for specialized build pipelines or for debugging content processing.

MGCB Options

The options are processed "left to right". When an option is repeated the last option is always wins.

/outputDir (Output Directory)

This is a required parameter. It specifies the directory where all content is written.

/intermediateDir (Intermediate Directory)

This is a required parameter. It specifies the directory where all intermediate files are written.

/rebuild (Rebuild Content)

An optional parameter which forces a full rebuild of all content.

/reference: (Assembly Reference)

An optional parameter which adds an assembly reference which contains importers, processors, or writers needed during content building.

/importer: (Content Importer Name)

An optional parameter which defines the class name of the content importer for reading source content. If the switch is used without a class name the default content importer for the source type is used.

/processor: (Content Processor Name)

An optional parameter which defines the class name of the content processor for processing imported content. If the switch is used without a class name the default content processor for the imported content is used.

/@ (Response File)

This defines a text command or response file that contains command line switches.

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

Clone this wiki locally