eng/targets/README.md
The goal of our targets files is to be the container of all of our build logic. Our repo has several hundred projects that target various platforms and products. The requirements of these platforms / products can change frequently during a release. Reacting to these changes is easier when the build logic is centralized.
To accomplish this all of the build logic is contained in our central targets files. This includes logic around packaging, deployment, nuget targeting, signing, etc... The preference is to contain logic in XML when reasonable but a custom build task is used when appropriate.
The individual project files contain declaritive information only. They inherit their build logic by importing Settings.props at the start and Imports.targets at the conclusion.
There are a set of general rules to follow for props and targets files:
This section describes the purpose and layout of the important files here.
This file is importanted at the start of projects. There are two primary purposes of this file:
Properties like $(Configuration) and $(OutDir) are reasonable to define here as projects can make reasonable use of these values. For example:
<OutDir>$(OutDir)\Shared</OutDir>
Properties like $(Deterministic), $(CheckForOverflowUnderflow), etc ... should not be defined here. No reasonable project will read these values as they are a requirement for how we produce binaries. These should all instead be defined in Imports.targets.
The general structure of this file is:
This file is imported at the end of projects. The primary purposes of this file are:
Properties which are central to our build should be defined here. For example $(Deterministic) is unconditionally defined in this file. No project should be able to override it because it's important to the correctness of our build. To protect against accidentally setting this property and having it silently ignored, such properties should also be banned in BuildBoss.
The general structure of this file is:
There are a number props files that just control version numbers: