4.5 Execute Gradle Tasks

This topic provides information on Execute Gradle Tasks.

Now that you are ready with your input JSON and the pre-requisites are done you are eligible to run required gradle tasks. There is a list of gradle tasks which needs to be run in the provided order. These tasks will generate source code, furnish eclipse projects for the generated code, build the source and provide the deployable WARs in the <APITOOLKIT_HOME>/ output/deployables folder.

Before moving forward have a look at the folder structure of the toolkit.

The <APITOOLKIT_HOME> has input, output , logs folders that are going to be required in further steps. The <APITOOLKIT_HOME> is depicted below in the snippet.



  • Input folder

    It is where the input JSON has to be provided. The HelloWorld.json (input JSON for HelloWorld) can be seen below:



  • output folder

    Output folder has deployables, scripts, swagger, etc.

  • seed/oracle

    It is where the required SQL scripts will be generated.



  • logs folder

    It is where the logs of the toolkit will get generated.



  • gradle swaginput (Optional)

    This command fetches the Swagger file from the specified location and generates the corresponding input JSON files.

  • gradle precodegen

    It generates the domainName#AspectAttributes.json as per the transaction type and AspectAttributes.json in the<APITOOLKIT HOME>/input/json location.

  • gradle codegen(*)

    It generates the source code as per the input provided as JSON. So before you execute this task make sure you have the prepared input JSON placed at <APITOOLKIT_HOME>/ /input/json.



  • gradle build(on generated module)

    You can directly import your gradle project into an IDE or else you can execute gradle build command on command line.





  • gradle thirdpartygen

    This task will get you the third party deployables. It basically generates the simulation MDB WARs which mocks the third-party host.

  • gradle swagger (on generated module)

    It generates a swagger document that comprises details of the generated REST API.

    This document must be hosted and that URL must be provided to UI Workbench. Details regarding how to use this document is mentioned in the user guide of UI Workbench.

    The swagger will get generated on the particular path APITOOLKIT_HOME > output > com.ofss.digx.module.{moduleName} > com.ofss.digx.appx.{moduleName}.endpoint > build.





Note:

In case the user needs to change the input JSON as per changed requirement please execute the below task before performing the above-mentioned steps for the updated JSON: gradle clean