Skip to content

Development

Schmoho edited this page Oct 14, 2024 · 5 revisions

Build Instructions

ModelPolisher uses gradle to build. Make sure you have gradle (version >= 5.0) installed in your system before following the procedure below.

Gradle

First clone this repository and go to directory <path>/ModelPolisher/. Then, ModelPolisher can be built using Gradle. Your safest bet is to run gradle fatJar, which bundles all necessary dependencies in the build artifact. Running gradle build will leave you responsible for satisfying classpath requirements of the project.

Build artifacts will be placed in <path>/ModelPolisher/target/

Additionally gradle devel is provided to easily run a non-release version with Docker.

Best Practices

  • Please include the prefix issue #<issue-number> in every commit message. If there is no issue that your commit belongs to, create one. Doing this will link the commit to the message in GitHub (and most git client applications). This is essential to comprehend the development history and the current state of development on any open issues.

Release Checklist

  • Tag the release commit
  • Publish an artifact that corresponds the the tagged commit on Github
  • Publish the artifact on Maven
  • Rebuild the MPServer artifact and container
  • Publish the MPServer container

Local Development Setup

We understand problems in setting-up database backend and that a developer would need to build ModelPolisher multiple times and making required changes in java Dockerfile will be a tedious task. We recommend the following practice for developers:

  1. Set up required databases by running docker-compose up.
  2. After making required changes in codebase build jar by gradle fatJar.
  3. Run the newly build jar using:
java -jar ./target/ModelPolisher-2.1.jar --input=<input> --output=<output> --output-combine=true --annotate-with-bigg=true --bigg-host=0.0.0.0 --bigg-port=1310 --add-adb-annotations=true --adb-host=0.0.0.0 --adb-port=1013

Using a non-release jar with Docker

Building using gradle devel builds a container with the local ModelPolisher jar.
This container can be used analogously to the release version, though either -f docker-compose.devel.yml needs to be passed to each invocation of docker-compose or the COMPOSE_FILE environment variable needs to be set so it points to docker-compose.devel.yml, e.g. using export COMPOSE_FILE=docker-compose.devel.yml for sh or bash.

Dependency License Report

License information for dependencies can be created by running 'gradle generateLicenseReport' and is located in build/reports/dependency-license/index.html. This functionality is provided by the 'Gradle License Report' plugin (https://github.com/jk1/Gradle-License-Report).