Build.gradle file

Code

   buildscript {
       repositories {
         mavenCentral()
         jcenter()
       }
       dependencies {
           classpath 'org.fundacionjala.gradle.plugins.enforce:enforce-gradle-plugin:1.1.5'
       }
   }

   apply plugin: 'enforce'
   
   enforce {
       srcPath = 'src'
       deleteTemporaryFiles = true
       deleteSubComponents = ['*']
   }   

Configuration parameters

Task srcPath
Description Specifies the folder where we store our code.
Examples ‘src’
Task deleteTemporaryFiles
Description During the execution of a task is necessary to create some temporary folders in the build folder, using this parameter we can define that these folders are not delete.
Examples true or false
Note The default value of this variable is true
Task deleteSubComponents
Description Selects that subcomponents of an object may be removed during the update and delete tasks.
Examples [’ * ‘] : Delete all subcomponents
[’ !* ‘] : Ignore all subcomponents
[‘fields’, ‘compactLayouts’] : Delete all fields and compactLayouts components.
[‘!fields’, ‘!compactLayouts’] : Ignore all fields and compactLayouts components.
[‘fields’, ‘!compactLayouts’] : Delete fields components and ignore compactLayouts components.
Note Supported subcomponents
[‘fields’, ‘compactLayouts’, ‘recordTypes’, ‘validationRules’]