Skip to content

Commit

Permalink
Added gradle task to publish library
Browse files Browse the repository at this point in the history
  • Loading branch information
amitsid1408 committed May 13, 2024
1 parent e4ea0ab commit f5cb424
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
.externalNativeBuild
.cxx
local.properties
github.properties
44 changes: 43 additions & 1 deletion smart-storage/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.rootPublicationComponentName
import java.io.FileInputStream
import java.util.Properties

plugins {
alias(libs.plugins.androidLibrary)
alias(libs.plugins.jetbrainsKotlinAndroid)
id("maven-publish")
}

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

val getArtifactId = { ->
"com.ss.smart-storage" // Replace with library name ID
}

val githubProperties = Properties()
githubProperties.load(FileInputStream(rootProject.file("github.properties")))


android {
namespace = "com.ss.smart_storage"
namespace = "com.ss.smart-storage"
compileSdk = 34

defaultConfig {
Expand All @@ -13,6 +30,9 @@ android {
consumerProguardFiles("consumer-rules.pro")
}




buildTypes {
release {
isMinifyEnabled = false
Expand All @@ -22,15 +42,37 @@ android {
)
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}
}

publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/smartSenseSolutions/smartStorage")
credentials {
username = githubProperties.getProperty("gpr.usr")
password = githubProperties.getProperty("gpr.key")
}
}
}
publications {
create<MavenPublication>("maven") {
groupId = "io.github.smartsensesolutions"
artifactId = getArtifactId()
version = getVersionName()
}
}
}

dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
Expand Down

0 comments on commit f5cb424

Please sign in to comment.