Skip to content

Commit

Permalink
Merge pull request #6 from PAYONE-GmbH/feature/first_runnable_version
Browse files Browse the repository at this point in the history
update publishing code in gradle
  • Loading branch information
dnikolicnanogiants authored Sep 18, 2024
2 parents fbf690e + 3620ed9 commit c1e0ed0
Showing 1 changed file with 30 additions and 53 deletions.
83 changes: 30 additions & 53 deletions pcp-client-android-sdk/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import com.vanniktech.maven.publish.SonatypeHost

plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.sonar)
kotlin("plugin.serialization") version "1.9.0"
id("com.vanniktech.maven.publish") version "0.29.0"
id("maven-publish")
id("signing")
id("com.vanniktech.maven.publish") version "0.29.0"
}

android {
Expand Down Expand Up @@ -53,69 +54,45 @@ dependencies {
debugImplementation("androidx.fragment:fragment-testing:1.5.7")
}

publishing {
publications {
afterEvaluate {
create<MavenPublication>("mavenAndroid") {
from(components["release"])

groupId = "com.payone.pcp_client_android_sdk"
artifactId = "pcp-client-android-sdk"
version = "0.0.1"
mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)

pom {
packaging = "aar"
name.set("PCP Client Android SDK")
description.set("Welcome to the PAYONE Commerce Platform Client Android SDK for the PAYONE Commerce Platform. This SDK provides everything a client needs to easily complete payments using Credit or Debit Card, PAYONE Buy Now Pay Later (BNPL).")
url.set("https://github.com/PAYONE-GmbH/PCP-client-android-SDK")
signAllPublications()

licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/license/mit/")
}
}
coordinates("io.github.payone-gmbh", "pcp-client-android-sdk", "0.0.1")

developers {
developer {
name.set("Djordje Nikolic")
email.set("[email protected]")
}
}

scm {
connection.set("scm:git:https://github.com/PAYONE-GmbH/PCP-client-android-SDK.git")
developerConnection.set("scm:git:https://github.com/PAYONE-GmbH/PCP-client-android-SDK.git")
url.set("https://github.com/PAYONE-GmbH/PCP-client-android-SDK")
}
}
pom {
name.set("PCP-CLIENT-SDK-ANDROID")
description.set("The PAYONE Client Android SDK")
inceptionYear.set("2024")
url.set("https://github.com/PAYONE-GmbH/PCP-client-android-SDK")
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/license/mit/")
}
}
}

repositories {
maven {
name = "MavenCentral"
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = project.findProperty("mavenCentralUsername") as String? ?: System.getenv("ORG_GRADLE_PROJECT_mavenCentralUsername")
password = project.findProperty("mavenCentralPassword") as String? ?: System.getenv("ORG_GRADLE_PROJECT_mavenCentralPassword")
developers {
developer {
name.set("Djordje Nikolic")
email.set("[email protected]")
}
}

scm {
url.set("https://github.com/PAYONE-GmbH/PCP-client-android-SDK")
connection.set("scm:git:git://github.com/PAYONE-GmbH/PCP-client-android-SDK.git")
developerConnection.set("scm:git:ssh://[email protected]/PAYONE-GmbH/PCP-client-android-SDK.git")
}
}
}

signing {
useInMemoryPgpKeys(
project.findProperty("signingInMemoryKeyId") as String? ?: System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKeyId"),
project.findProperty("signingInMemoryKey") as String? ?: System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKey"),
project.findProperty("signingInMemoryKeyPassword") as String? ?: System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKeyPassword")
findProperty("signingInMemoryKey") as String?,
findProperty("signingKeyPassword") as String?
)
afterEvaluate {
sign(publishing.publications["mavenAndroid"])
}
}




sign(publishing.publications)
}

0 comments on commit c1e0ed0

Please sign in to comment.