Gradle plugin will allow you to launch Gradle commands to build your projects from a Clarive instance.
Gradle is an open source build automation system that builds upon the concepts of Apache Ant and Apache Maven and introduces a Groovy-based domain-specific language. Gradle uses a directed acyclic graph ("DAG") to determine the order in which tasks can be run.
Gradle is needed in order for it to work properly.
To install the plugin, place the cla-gradle-plugin folder inside the $CLARIVE_BASE/plugins
directory in a Clarive instance.
The various parameters are:
- Server (variable name: server) - Choose the server where you wish to execute the command.
- User (user) - User which will be used to connect to the server.
- Gradle path (gradle_path) - Full path to the Gradle executable location. If it is in the system path, you can leave it empty.
- Project path (project_path) - Full path to the project location that will be built.
- Command (command) - Here you will have different commands to launch with the service or write a custom one.
- Compile release ("AssembleRelease") - Will build the project with the AssembleRelease configuration.
- Compile debug ("AssembleDebug") - Will build the project with the AssembleDebug configuration.
- Custom ("custom") - Will get the commands writen in the Custom command or arguments box.
- Custom command or arguments (custom_args) - Here you can write arguments for the selected command or write the commands you want to perform.
Only Clarive EE
- Errors and output - These two fields are related to manage control errors. Options are:
- Fail and output error - Search for configurated error pattern in script output. If found, an error message is displayed in monitor showing the match.
- Warn and output warn - Search for configurated warning pattern in script output. If found, an error message is displayed in monitor showing the match.
- Custom - In case combo box errors is set to custom a new form is showed to define the behavior with these fields:
- OK - Range of return code values for the script to have succeeded. No message will be displayed in monitor.
- Warn - Range of return code values to warn the user. A warn message will be displayed in monitor.
- Error - Range of return code values for the script to have failed. An error message will be displayed in monitor.
You can find this service in the Rule Designer palette.
Op Name: Gradle compile
Example:
Server: Gradle-Server
Gradle path: C:\programs\gradle\gradle.bat
Project path: C:\projects\build-project\
Command: Compile Debug
Custom command or arguments:
Errors: fail
If you want to use the plugin through the Rulebook, in any do
block, use this ops as examples to configure the different parameters:
rule: Gradle demo
do:
- gradle_compile:
server: gradle_server # Required. Use the mid set to the resource you created
user: ${username}
gradle_path: ${gradle_bat_path}
project_path: "C:\projects\build-project" # Required
command: "custom" # Required
custom_args: ["AssembleRelease"]
The service will return the console output for the Gradle command you set and the logs generated by it.
Build failed
Build Failed
Make sure that the option is available and you code is correct to be executed in Gradle.
Variable required
Error in rulebook (compile): Required argument(s) missing for op "gradle_compile": "server"
Make sure you have all required variables defined.
Not allowed variable
Error in rulebook (compile): Argument `Code` not available for op "gradle_compile"
Make sure you are using the correct paramaters (make sure you are writing the variable names correctly).
Feel free to join Clarive Community to resolve any of your doubts.