Skip to content

Instantly share code, notes, and snippets.

@prasad79
Created December 17, 2019 16:03
Show Gist options
  • Save prasad79/7bcbd578967bd70a7f6d547b98e50c0f to your computer and use it in GitHub Desktop.
Save prasad79/7bcbd578967bd70a7f6d547b98e50c0f to your computer and use it in GitHub Desktop.
Consuming an Android library from Github Packages using Kotlin DSL - configure repositories details
android{
repositories {
maven {
name = "GitHubPackages"
/* Configure path to the library hosted on GitHub Packages Registry
* Replace UserID with package owner userID and REPOSITORY with the repository name
* e.g. "https://maven.pkg.github.com/enefce/AndroidLibrary-GPR-KDSL"
*/
//url = uri("https://maven.pkg.github.com/UserID/REPOSITORY")
url = uri("https://maven.pkg.github.com/enefce/AndroidLibrary-GPR-KDSL")
credentials {
/**Create github.properties in root project folder file with gpr.usr=GITHUB_USER_ID & gpr.key =PERSONAL_ACCESS_TOKEN**/
username = githubProperties["gpr.usr"] as String? ?: System.getenv("GPR_USER")
password = githubProperties["gpr.key"] as String? ?: System.getenv("GPR_API_KEY")
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment