Initial Setup
Adding MapLayr to Your Project
Create GitHub token
GitHub package registry requires authentication credentials. These must be created by following the guide provided by GitHub.
You will need to enable the following scope on the GitHub token creation form:
MapLayr plugin
Add GitHub package registry to project Gradle
If your project uses the legacy buildscript { dependencies }
method to add build script dependencies then add the Github package registry to the top level build.gradle
file as so:
An example can be found here: build.gradle
If your project uses the pluginManagement { repositories }
method to configure plugin resolution then add the Github package registry to the settings.gradle
file as so:
Use environment variables for credential storage
To avoid saving your GitHub credentials directly in your repo you can add them to your environment variables. They can then be accessed like so: === "Groovy" === "Kotlin"Add the MapLayr plugin class path to Gradle
Add the MapLayr plugin class path to Gradle by adding the following dependency to the top level build.gradle
as so:
An example can be found here: build.gradle
Add MapLayr plugin to Gradle
Add the MapLayr plugin to Gradle in the app module build.gradle
as so:
An example can be found here: app/build.gradle
MapLayr
Add GitHub package registry to module Gradle
If your project uses the legacy per-module repositories {}
block within the module's build.gradle
file then add the GitHub package registry to the module level build.gradle
as so:
An example can be found here: app/build.gradle
If your project uses the centralised repository approach within settings.gradle
using the dependencyResolutionManagement { repositories }
block then add the GitHub package registry as so:
Add MapLayr implementation to Gradle module dependencies
An example can be found here: app/build.gradle
Adding Your API Key
In the app module build.gradle
configure the MapLayr plugin. The apiKey
is required for any usage of the SDK
An example can be found here: app/build.gradle