Hoverboard contains common functionality, basic extensions, and quality of life improvements that MichiganLabs recommends for its Android projects. The primary focus of this project is to improve startup time and provide consistent implementations of common actions across all projects.
To provide for a more flexible "opt-in" approach, packages are intended to be focused to a specific area of need. Each package should aim to have the fewest number of dependencies possible to provide easier maintainability and prevent the bloating of applications that depend on the package.
All packages are currently being hosted exclusively in GitHub Packages. Setting up your application to be able to ingest the library requires setting up a GitHub token within your root gradle properties (this prevents accidentally leaking or sharing of a GitHub token) and then adding the GitHub Packages to your project. This is done in three overall steps.
- Login to GitHub and navigate to your personal GitHub account and create a new access token.
- Save user username and token to your root gradle.properties
~/.gradle/gradle.properties
and insert your username and token.
gitHubHoverboardUsername = YOUR_GITHUB_USERNAME
gitHubHoverboardPassword = YOUR_GITHUB_TOKEN
Identify the repositories
section in your settings.gradle.kts
. Be sure not to add it to the pluginManagement section!
repositories {
...
maven {
url = uri("https://maven.pkg.github.com/michiganlabs/hoverboard")
credentials {
val gitHubHoverboardUsername: String? by settings
val gitHubHoverboardPassword: String? by settings
username = gitHubHoverboardUsername ?: System.getenv("GITHUB_USERNAME")
password = gitHubHoverboardPassword ?: System.getenv("GITHUB_TOKEN")
}
}
}
Each package is intentionally split out to provide opt-in functionality by general architecture. For the specific implementation string refer to the specific project. In general your build.gradle.kts
file will add the following line.
dependencies {
...
implementation("com.michiganlabs.hoverboard:THE_PACKAGE_NAME:THE_VERSION_NUMBER")
}
To publish a new package to GitHub Packages, perform the following steps.
- Bump the version number in the
gradle.properties
- Tag the release
git tag vRELEASE_NUMBER
- Go to the Releases and create a new release with the tag
- GitHub Action will immediately begin creating the new packages.