Currently Diabot consists of one project with all of the code inside of it, making it awkward to include as a dependency for other projects if, for example, just the BG conversion utilities or the Nightscout API is needed. This PR aims to fix that by splitting Diabot into three projects:
bot - All of the core Discord bot code, along with the MongoDB code (this might be put into a separate project later, I'm not sure at the moment).
nightscout-api - API which is used for querying the REST API data from a Nightscout instance.
utilities - BG/A1c conversion tools and SLF4J initialiser.
With splitting the single project into subprojects, I also cleaned up the build.gradle a bit:
switched to implementation and api from compile as it's deprecated
setting kotlinOptions.jvmTarget through a configureEach loop instead of setting it for compileKotlin and compileTestKotlin individually
The stage task for Heroku was kept in the root build.gradle and will still output a jar to build/libs/diabot.jar. Configuration for the shadow plugin/jar output is in the shadowJar closure.
Lastly, the Gradle wrapper was changed to use a -all distribution as it provides IntelliJ with Gradle API/DSL documentation.
Currently Diabot consists of one project with all of the code inside of it, making it awkward to include as a dependency for other projects if, for example, just the BG conversion utilities or the Nightscout API is needed. This PR aims to fix that by splitting Diabot into three projects:
bot
- All of the core Discord bot code, along with the MongoDB code (this might be put into a separate project later, I'm not sure at the moment).nightscout-api
- API which is used for querying the REST API data from a Nightscout instance.utilities
- BG/A1c conversion tools and SLF4J initialiser.With splitting the single project into subprojects, I also cleaned up the
build.gradle
a bit:implementation
andapi
fromcompile
as it's deprecatedfatJar
task and replaced with Gradle shadow pluginkotlinOptions.jvmTarget
through aconfigureEach
loop instead of setting it forcompileKotlin
andcompileTestKotlin
individuallyThe
stage
task for Heroku was kept in the rootbuild.gradle
and will still output a jar tobuild/libs/diabot.jar
. Configuration for the shadow plugin/jar output is in theshadowJar
closure.Lastly, the Gradle wrapper was changed to use a
-all
distribution as it provides IntelliJ with Gradle API/DSL documentation.