amosproj / amos2021ss07-bike-nest

MIT License
1 stars 0 forks source link

Common Code for Backend Services #81

Closed rmandlx closed 3 years ago

rmandlx commented 3 years ago

We need a Gradle Project that contains common code for all services. The Services can include this project and access the code. The project should use the package: com.bikenest.common

Components of the Common Project:

rmandlx commented 3 years ago

So I found out to include another project via gradle, you have to use this inside "settings.gradle": includeBuild "../common"

It is also possible to specify a root project for the Backend, that includes all sub projects and handles building.

rmandlx commented 3 years ago

The last commit 7c7f22c
allows the service projects to be built individually. It was really complicated getting it to work: You can define the used plugins inside settings.gradle So if you define them inside the root project, then you are not allowed to define the plugin versions inside the build.gradle files of the subprojects. But if you want to build the subprojects individually, it wont work if you don't define the versions. Thats why I had to change the settings.gradle of each project and also define the plugin versions there.

And if you build a service individually, it also won't know about the common project, thats why you also have to specify include ':common' project(':common').projectDir = new File('../common') inside the settings.gradle of each project...

rmandlx commented 3 years ago

This will be integrated into the main branch with #83.