Skip to content

[0] Setup Guide

Patrick Gruntz edited this page May 24, 2024 · 2 revisions

Setup Guide for DOPE Query Builder

Introduction

This guide outlines how to integrate the DOPE Query Builder into your Kotlin projects using either Gradle Kotlin DSL (build.gradle.kts) or Groovy DSL (build.gradle).

Prerequisites

Before you start, make sure you have the following ready:

  • A Kotlin project setup within an IDE that supports Gradle (like IntelliJ IDEA).
  • Basic knowledge of Gradle and your chosen DSL (Kotlin or Groovy).

Adding DOPE to Your Project

Step 1: Configure the JitPack Repository

DOPE Query Builder is distributed through JitPack, which means you need to add JitPack as a repository to your project. This ensures that Gradle can fetch DOPE from the specified location.

For Gradle Kotlin DSL (build.gradle.kts):

repositories {
    mavenCentral()
    maven(url = "https://jitpack.io")
}
For Gradle Groovy DSL (build.gradle):
repositories {
    mavenCentral()
    maven { url 'https://jitpack.io' }
}

Step 2: Add the Dependency

Include DOPE Query Builder as a dependency in your project. Make sure to replace <Version> with the newest JitpackVersion of DOPE:

For Gradle Kotlin DSL (build.gradle.kts):

dependencies {
    implementation("com.github.ergon.dope-query-builder:core:<Version>")
    implementation("com.github.ergon.dope-query-builder:crystal-map-connector:<Version>")
}
For Gradle Groovy DSL (build.gradle):
dependencies {
    implementation 'com.github.ergon.dope-query-builder:core:<Version>'
    implementation 'com.github.ergon.dope-query-builder:crystal-map-connector:<Version>'
}

Step 3: Sync Your Project

After updating your build.gradle.kts file, sync your project with Gradle to ensure all dependencies are properly downloaded. This can typically be done through your IDE or by running the following command in your terminal:

./gradlew --refresh-dependencies