Last active
July 7, 2021 02:46
-
-
Save thekarthiksankar/d4d68f5c2e4b44c25f4101a4742235b0 to your computer and use it in GitHub Desktop.
Android: Import package from GitHub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app level build.gradle | |
android { | |
def githubProperties = new Properties() | |
githubProperties.load(new FileInputStream(rootProject.file('github.properties'))) | |
repositories { | |
maven { | |
name = "GitHubPackages" | |
/* Configure path to the library hosted on GitHub Packages Registry | |
* Replace GITHUB_ID with package owner userID and REPO_NAME with the repository name | |
* e.g. "https://maven.pkg.github.com/GITHUB_ID/REPO_NAME"*/ | |
url = uri("https://maven.pkg.github.com/UserID/REPOSITORY") | |
credentials { | |
username = githubProperties['gpr.usr'] | |
password = githubProperties['gpr.key'] | |
} | |
} | |
} | |
} | |
dependencies { | |
// Include the dependency | |
implementation "packagename:modulename:version" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gpr.usr=GITHUB_USER_NAME | |
gpr.key=GITHUB_ACCESS_TOKEN | |
// Replace the GITHUB_USER_NAME & GITHUB_ACCESS_TOKEN with the respective values |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment