Skip to content

Commit

Permalink
github publishing code added
Browse files Browse the repository at this point in the history
  • Loading branch information
vkvashistha committed Jun 24, 2022
1 parent 8552238 commit 51d5799
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion MultiViewRecyclerView/multiviewrecyclerview/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,48 @@
plugins {
id 'maven-publish'
id "com.android.library"
id 'org.jetbrains.kotlin.android'
}
def githubProperties = new Properties()
githubProperties.load(new FileInputStream(rootProject.file("github.properties"))) //Set env variable GPR_USER & GPR_API_KEY if not adding a properties file

def getVersionName = { ->
return "1.0.0" // Replace with version Name
}

def getArtificatId = { ->
return "multiviewrecyclerview" // Replace with library name ID
}

publishing {
publications {
bar(MavenPublication) {
groupId 'com.vkvashistha' // Replace with group ID
artifactId getArtificatId()
version getVersionName()
artifact("$buildDir/outputs/aar/${getArtificatId()}-release.aar")
}
}

repositories {
maven {
name = "GitHubPackages"
/** Configure path of your package repository on Github
** Replace GITHUB_USERID with your/organisation Github userID
** and REPOSITORY with the repository name on GitHub
*/
url = uri("https://maven.pkg.github.com/vkvashistha/multiviewrecyclerview")
credentials {
/** Create github.properties in root project folder file with
** gpr.usr=GITHUB_USER_ID & gpr.key=PERSONAL_ACCESS_TOKEN
** Set env variable GPR_USER & GPR_API_KEY if not adding a properties file**/

username = githubProperties['gpr.usr'] ?: System.getenv("GPR_USER")
password = githubProperties['gpr.key'] ?: System.getenv("GPR_API_KEY")
}
}
}
}
android {
compileSdk 32

Expand Down Expand Up @@ -32,7 +72,7 @@ android {

dependencies {

implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.google.android.material:material:1.6.1'
testImplementation 'junit:junit:4.13.2'
Expand Down

0 comments on commit 51d5799

Please sign in to comment.