Skip to content

Environment Setup

John M. Daniel edited this page Jan 22, 2020 · 1 revision

How To Setup Salesforce DX Scratch Org

Create a DX Scratch Org

There are no special requirements with regards to the type of SalesforceDX scratch org needed to support this project.... just that one is created.

For the remainder of these instructions, we will assume that the your DX Scratch org alias is "myScratchOrg".

Install All Frameworks

As mentioned elsewhere, this codebase is dependent on other open source frameworks. These include:

Prerequisites

Using the SalesforceDX custom plugin "shane-sfdx-plugins" will be the simplest way to accomplish this. If you need to install this plugin, execute the following:

  • sfdx plugins:install shane-sfdx-plugins

Setup the scratch org

  • sfdx force:org:create -a myScratchOrg -f config/project-scratch-def.json

Each of the following frameworks must be installed before the source code from this project can be deployed to a scratch org.

Install ApexMocks

Install the fflib-apex-mocks project

  • sfdx shane:github:src:install -g apex-enterprise-patterns -r fflib-apex-mocks -u myScratchOrg

Install Apex Common

Install the fflib-apex-commons project

  • sfdx shane:github:src:install -g apex-enterprise-patterns -r fflib-apex-common -p fflib/src -u myScratchOrg

Here is the full command list:

sfdx force:org:create -a myScratchOrg -f config/project-scratch-def.json 
sfdx shane:github:src:install -g apex-enterprise-patterns -r fflib-apex-mocks -u myScratchOrg
sfdx shane:github:src:install -g apex-enterprise-patterns -r fflib-apex-common -p fflib/src -u myScratchOrg

Install The fflib-apex-common-builder code

Simply push the code to the scratch org

  • sfdx force:source:push