These tasks are able to install or uninstall packages.
This task installs a management package based on the following parameters:
This task uses the same credentials used in other tasks, so below we have an example about Apex Lang package installation.
command:
$ gradle installPackage -Ppkg.namespace=al -Ppkg.version=1.18
output:
:installPackage
___________________________________________
Username: john.smith@gmail.com
Login type: login
___________________________________________
[zip] Building zip: \users\john.smith\my_sfdc_project\build\deploy.zip
Starting deploy...
[==================================================] 100%
The files were successfully deployed
Install package 'al' v1.18 success.
BUILD SUCCESSFUL
Total time: 4 mins 28.956 secs
Once that task is completed a result message will be displayed.
This task uninstalls a managed package based on the following parameters:
Bellow we have an example about Apex Lang package installation.
command:
$ gradle uninstallPackage -Ppkg.namespace=al
output:
:uninstallPackage
___________________________________________
Username: john.smith@gmail.com
Login type: login
___________________________________________
Verifying installed package 'al' ...
Starting retrieve...
Waiting for retrieve result...
Retrieve result completed
[unzip] Expanding: \users\john.smith\my_sfdc_project\build\installedpkgsresult\installedPkgs.zip into \users\john.smith\my_sfdc_project\build\installedpkgsresult
Installed package 'al' found.
[zip] Building zip: \users\john.smith\my_sfdc_project\build\deploy.zip
Starting deploy...
[==================================================] 100%
The files were successfully deployed
Uninstall package 'al' success.
BUILD SUCCESSFUL
Total time: 2 mins 24.547 secs
Once the task is completed, a result message will be displayed.
If “target org” does not have the related package installed, the command will not respond because it verified an installed package before starting the process. Below we have an execution example:
$ gradle uninstallPackage -Ppkg.namespace=al
output:
:uninstallPackage
___________________________________________
Username: john.smith@gmail.com
Login type: login
___________________________________________
Verifying installed package 'al' ...
Starting retrieve...
Waiting for retrieve result...
Retrieve result completed
WARNING: Entity of type 'InstalledPackage' named 'al' cannot be found
Installed package 'al' not found.
BUILD SUCCESSFUL
Total time: 15.179 secs
As you can see, an information message is displayed to notify that there is not an installed package.