Created
June 14, 2021 18:02
-
-
Save levibostian/c6c83025761c0bc27cf16734fae5ac57 to your computer and use it in GitHub Desktop.
Install Android SDK from private github repo in your Android app
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
// this file is in app/build.gradle | |
... | |
dependencies { | |
// Install your library | |
implementation 'com.example.lib:sdk:0.1.1-alpha' | |
} |
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
// Top-level build file where you can add configuration options common to all sub-projects/modules. | |
buildscript { | |
ext.kotlin_version = "1.4.32" | |
repositories { | |
google() | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:4.2.1' | |
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | |
// NOTE: Do not place your application dependencies here; they belong | |
// in the individual module build.gradle files | |
} | |
} | |
subprojects { | |
// Load `secrets.properties` file, if it exists. | |
if (file("$project.rootDir/secrets.properties").exists()) { | |
def localProperties = new Properties() | |
localProperties.load(new FileInputStream("$project.rootDir/secrets.properties")) | |
localProperties.each { prop -> | |
project.ext.set(prop.key, prop.value) | |
} | |
} | |
} | |
allprojects { | |
repositories { | |
google() | |
mavenCentral() | |
maven { | |
name = "GitHubPackages" | |
url = uri("https://maven.pkg.github.com/yourusername/repo-name") | |
credentials { | |
username = project.ext.find("githubRepo.username") ?: System.getenv("GITHUB_REPO_USERNAME") | |
password = project.ext.find("githubRepo.token") ?: System.getenv("GITHUB_REPO_TOKEN") | |
} | |
} | |
} | |
} | |
task clean(type: Delete) { | |
delete rootProject.buildDir | |
} |
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
githubRepo.username=your-github-username | |
githubRepo.token=XXXXXXXXXXXXXXXXXXX | |
# On CI server, set: GITHUB_REPO_USERNAME and GITHUB_REPO_TOKEN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment