Integration of the IOMB Lib Android¶
The integration of the IOMb Library Android is done in a few steps via Maven:
Prerequisites¶
The IOMb Library is provided via GitHub Packages. To access it, you need a GitHub Classic Personal Access Token with the read:packages scope.
Classic Token Required
Fine-grained Personal Access Tokens are currently not supported by GitHub Packages for Maven. Use a Classic token.
- Create a Classic Personal Access Token at: https://github.com/settings/tokens/new
- Select at least the
read:packagesscope - Store the token securely
Configuration¶
~/.gradle/gradle.properties (recommended):
1 2 | |
Note
The file ~/.gradle/gradle.properties may not exist yet and might need to be created first.
Alternatively, you can store the credentials in the project-specific gradle.properties in the project directory.
Security Notice for project-specific gradle.properties
Never commit your gradle.properties with real credentials to a repository. Add the file to .gitignore or use environment variables.
Add Repository¶
Depending on your project structure, there are two ways to add the GitHub Packages repository:
Open build.gradle.kts in the project root and add the repository under allprojects > repositories:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
For newer projects using dependencyResolutionManagement, add the repository in settings.gradle.kts:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
Which Variant?
- settings.gradle.kts: Recommended for new projects (Android Studio Flamingo+). Uses
providers.gradleProperty(). - build.gradle.kts: For existing projects without
dependencyResolutionManagement. Usesproject.findProperty().
Add Dependency¶
Under "dependencies" in the build.gradle.kts of the app module, reference the IOMb Library:
1 2 3 4 | |