Blogs

Blogs

Blade Extensions and Profiles

How can Blade help your development process? Please let us know!

Hello all!

 

We want our development tools to be flexible and extensible enough to meet our users requirements, and with this in mind, we have developed 2 new concepts for Blade: Extensions and Profiles.

Extensions allow you to develop your own custom commands for Blade, in which Blade will act as a framework and invoke your command when it is specified on the CLI. You, as the developer of the custom command, may choose the command name and help text, and implement it to meet your requirements. We have also included the ability to install and manage custom extensions directly from the Blade CLI, in the form of "blade extension install" and "blade extension uninstall".

Building upon Extensions, we have also created Profiles, which is basically a metadata flag associated with a given Liferay Workspace. When a custom command is created for Blade, it may be associated with a specific profile type (by using the annotation @BladeProfile), and after this custom command is installed for a user, it will be available in any Liferay Workspace associated with that profile. 

To create a workspace associated with a particular profile, Blade may be invoked as "blade init -b foo", foo would be the profile. (We may change this flag to -p / --profile, or add support for both, what do you think?)

If you would like to get started with these features, please look here https://github.com/liferay/liferay-blade-cli/tree/master/extensions for implementation examples (more to come).

Please let us know what you think of these features, if there is anything you would like to see added or changed in their implementation, or if you have comments about Blade in general. Your feedback helps us refine and improve the development experience, and it is very much appreciated!

Thank you,

Chris Boyd

This feature is awesome, kudos. A have already created my first blade extension: https://github.com/lmarqs/liferay-dev-tools

 

 

One of the issues that I faced creating it is related to blade-cli version. I had to use 3.1.0.201807032155 that is newer than the latest (https://releases.liferay.com/tools/blade-cli/latest). I also had to create an ivy repository in order to declare blade.jar as a dependency in my project. See: https://github.com/lmarqs/liferay-dev-tools/blob/aaacabfddd9e9daba472931934db86ed3d0bcc48/build.gradle#L30

 

 

And I had to generate a single jar in my multi-module project.  Because building more than one .jar generate an installation error. See: https://github.com/lmarqs/liferay-dev-tools/blob/aaacabfddd9e9daba472931934db86ed3d0bcc48/build.gradle#L77