4.5.1. Custom action script (action)¶
Custom action script.
Action targets execute arbitrary commands. They can be used to do various tasks that don’t fit the model of compiling or creating files, such as packaging files, installing, uploading, running tests and so on.
Actions are currently only supported by makefile-based toolsets. See the
pre-build-commands
and post-build-commands
properties for another
alternative that is supported by Visual Studio projects.
If the optional outputs
property is specified, the action is supposed
to generate the files listed in this property. This means that other
targets depending on this action will depend on these files in the
generated makefile, instead of depending on the phony target for an action
without outputs and also that these files will be cleaned up by the
clean
target of the generated makefile.
action osx-bundle
{
deps = test;
commands = "mkdir -p Test.app/Contents/MacOS"
"cp -f test Test.app/Contents/MacOS/test"
;
}
4.5.1.1. Properties¶
commands (type: list of strings)
List of commands to run.
Default: empty
Inheritable from parent: no
outputs (type: list of paths)
Output files created by this action, if any.
Default: null
Inheritable from parent: no
id (type: id)
Target’s unique name (ID).
Read-only property
Inheritable from parent: no
deps (type: list of ids)
Dependencies of the target (list of IDs).
The dependencies are handled in target-specific ways. At the very least, they are added to the list of dependencies in generated makefiles or projects to ensure correct build order. Some targets may be smart about some kinds of the dependencies and do more.
In particular, compiled targets (executables, DLLs) will automatically link against all libraries found in deps.
Default: empty
Inheritable from parent: no
pre-build-commands (type: list of strings)
Custom commands to run before building the target.
The value is a list of shell commands to run. Notice that the commands are platform-specific and so typically need to be set conditionally depending on the value of
toolset
.Currently only implemented by Visual Studio.
Default: empty
Inheritable from parent: no
post-build-commands (type: list of strings)
Custom commands to run after building the target.
The value is a list of shell commands to run. Notice that the commands are platform-specific and so typically need to be set conditionally depending on the value of
toolset
.Currently only implemented by Visual Studio.
Default: empty
Inheritable from parent: no
configurations (type: list of strings)
List of configurations to use for this target.
See Build configurations for more information.
Default: Debug Release
Inheritable from parent: yes
vs2008.projectfile (type: path)
File name of the project for the target.
Only for toolsets: Visual Studio 2008 (vs2008)
Default:
$(id).vcxproj
in the same directory as the.sln
fileInheritable from parent: no
vs2008.guid (type: string)
GUID of the project.
Only for toolsets: Visual Studio 2008 (vs2008)
Default: automatically generated
Inheritable from parent: no
vs2005.projectfile (type: path)
File name of the project for the target.
Only for toolsets: Visual Studio 2005 (vs2005)
Default:
$(id).vcxproj
in the same directory as the.sln
fileInheritable from parent: no
vs2005.guid (type: string)
GUID of the project.
Only for toolsets: Visual Studio 2005 (vs2005)
Default: automatically generated
Inheritable from parent: no
vs2017.projectfile (type: path)
File name of the project for the target.
Only for toolsets: Visual Studio 2017 (vs2017)
Default:
$(id).vcxproj
in the same directory as the.sln
fileInheritable from parent: no
vs2017.guid (type: string)
GUID of the project.
Only for toolsets: Visual Studio 2017 (vs2017)
Default: automatically generated
Inheritable from parent: no
vs2015.projectfile (type: path)
File name of the project for the target.
Only for toolsets: Visual Studio 2015 (vs2015)
Default:
$(id).vcxproj
in the same directory as the.sln
fileInheritable from parent: no
vs2015.guid (type: string)
GUID of the project.
Only for toolsets: Visual Studio 2015 (vs2015)
Default: automatically generated
Inheritable from parent: no
vs2012.projectfile (type: path)
File name of the project for the target.
Only for toolsets: Visual Studio 2012 (vs2012)
Default:
$(id).vcxproj
in the same directory as the.sln
fileInheritable from parent: no
vs2012.guid (type: string)
GUID of the project.
Only for toolsets: Visual Studio 2012 (vs2012)
Default: automatically generated
Inheritable from parent: no
vs2013.projectfile (type: path)
File name of the project for the target.
Only for toolsets: Visual Studio 2013 (vs2013)
Default:
$(id).vcxproj
in the same directory as the.sln
fileInheritable from parent: no
vs2013.guid (type: string)
GUID of the project.
Only for toolsets: Visual Studio 2013 (vs2013)
Default: automatically generated
Inheritable from parent: no
vs2003.projectfile (type: path)
File name of the project for the target.
Only for toolsets: Visual Studio 2003 (vs2003)
Default:
$(id).vcxproj
in the same directory as the.sln
fileInheritable from parent: no
vs2003.guid (type: string)
GUID of the project.
Only for toolsets: Visual Studio 2003 (vs2003)
Default: automatically generated
Inheritable from parent: no
vs2010.projectfile (type: path)
File name of the project for the target.
Only for toolsets: Visual Studio 2010 (vs2010)
Default:
$(id).vcxproj
in the same directory as the.sln
fileInheritable from parent: no
vs2010.guid (type: string)
GUID of the project.
Only for toolsets: Visual Studio 2010 (vs2010)
Default: automatically generated
Inheritable from parent: no