[TECH] GUHADA’s Gradle Multi-Project

TEMCO
TEMCO
3 min readJun 3, 2019

--

Hello, everyone!

GUHADA tech update at this time is about “Gradle Multi-Project”.

Most of the developers are familiar with Gradle and is used for the multi-project.

As you can see on the left, it shows a set with API that connects Database and Web, which is close to the User Model. So, you have to think about how to process the “Model” that is used by both Web and API at the same time.

Accordingly, we labeled the model as “User” which has to be utilized frequently.

So, there are various ways that the “Model” can be used frequently.

The easiest way is using “copy & paste” after creating the model. In this situation, it is difficult to manage the organization because of the model object has to be managed from two locations. So, as the number of projects increases each time, the same object as to be created over and over, so if a section is changed each object corresponding to the change has to be changed as well. In such situations, there could be some mistakes, so it may not be a good method.

However, if the preconditions shown below are met, it can be considered an applicable method.

Example:
- The same object is used for multi-projects.
- At the point of build, automatic participation in the common project is required.

The project structure

If you check out the project structure below, under the GUHADA Module, the structure is divided into “guhada_framework Module” and “guhada_order_module” for the “Multi-project”.

For the commonly used model, we placed the justification on “guhada_frameword” and structured it in a way that it can be used in each project.

The “build.gradle” Setting

The next part is the setting for the Multi-Project.

We’ve focused on the Multi-Project setting uses gradle, so we’ll inject the dependency to the build.gradle.

As shown above, the basic setting is finished when we inject the dependency. And of course, it is not used just based on that.

The usage of the module has to be declared in order to be executed
(The below example shows the structure of compile project, however, the setting can be used as to include “guhada_framework” etc. as well, depending on the project structure)

Lib Verification

So let's check out if the Lib setting is in the correct format.

As you can see below, if the “guhada_framework” and “order” are verified, then you can check out the setting is aligned in the correct way.

For those who use gradle, content can be a familiar one, and the gradle Multi-Project is one of Java project’s necessary functions so we wanted to review and show its settings.

Thank you for supporting TEMCO!

TEMCO: Innovative Supply Chain Data Management and E-Commerce platform through Blockchain and Smart Contract Technology.

▶TEMCO Chatroom: https://t.me/temcolabs
▶TEMCO Official Website: https://temco.io

--

--

TEMCO
TEMCO
Writer for

Blockchain-based Supply Chain Data Management and E-commerce Open Market Platform, GUHADA.