sfp provides mechanisms to control the aspects of the build command, the following section details how one can configure these mechanisms in your sfdx-project.json
Sometimes, due to certain platform errors, some metadata components need to be ignored during build (especially for unlocked packages) while the same being required for other commands like validate . sfp offer you an easy mechanism which allows to switch .forceignore files depending on the operation.
Add this entry to your sfdx-project.json and as in the example below, mention the path to different files that need to be used for different stages
Attribute | Type | Description | Package Types Applicable |
---|
Using the ignoreOnStage:[ "build" ]
property on a package, causes the particular package to be skipped by the build command. Similarly you can use ignoreOnStage:[ "quickbuild" ]
to skip packages in the quickbuild stage.
ignoreOnStage | array | Ignore a package from being processed by a particular stage |
|
Attribute | Type | Description | Package Types Applicable |
---|---|---|---|
In certain scenarios, it's necessary to build a new version of a package when any package in the collection undergoes changes. This can be accomplished by utilizing the buildCollection
attribute in the sfdx-project.json
file.
To ensure that a new version of a package is built whenever any package in a specified collection undergoes a change, you can use the buildCollection
attribute in the sfdx-project.json
file. Below is an example illustrating how to define a collection of packages that should be built together.
The configFile
flag in the build
command is used for features and settings of the scratch org used to validate your unlocked package. It is optional and if not passed in, it will assume the default one which is none.
Typically, all packages in the same repo share the same scratch org definition. Therefore, you pass in the definition that you are using to build your scratch org pool and use the same to build your unlocked package.
However, there is an option to use multiple definitions.
For example, if you have two packages, package 1 is dependent on SharedActivities
, and package 2 is not. You would pass a scratch org definition file to package 1 via scratchOrgDefFilePaths
in sfdx-project
. Package 2 would be using. the default definitionFile
.
ignoreOnStage
array
Ignore a package from being processed by a particular stage
unlocked
org-dependent unlocked
source
diff