Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix publishing to maven #118

Merged
merged 5 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Sign and Publish Android Library
name: Sign and Publish KMP Library

on:
workflow_dispatch:
inputs:
androidVersionName:
versionName:
description: 'Android Version Name (eg. 0.9.0)'
required: true

Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
POM_VERSION: ${{ github.event.inputs.androidVersionName }}
POM_VERSION: ${{ github.event.inputs.versionName }}
POM_NAME: ${{ secrets.POM_NAME }}
POM_DESCRIPTION: ${{ secrets.POM_DESCRIPTION }}
POM_GROUPID: ${{ secrets.POM_GROUPID }}
Expand Down
33 changes: 9 additions & 24 deletions daraja/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ kotlin {
kotlin.applyDefaultHierarchyTemplate()

androidTarget {
publishLibraryVariants("release")

compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
}

publishLibraryVariants("release")
}

iosX64()
Expand Down Expand Up @@ -102,22 +102,13 @@ android {
minSdk = 21
compileSdk = 34
}

namespace = "com.vickbt.darajamultiplatform"

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

sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")

buildTypes {
getByName("debug") {}

getByName("release") {
isMinifyEnabled = true
}
}
}

tasks.named<DependencyUpdatesTask>("dependencyUpdates").configure {
Expand Down Expand Up @@ -167,13 +158,8 @@ publishing {

repositories {
maven {
name = "Sonatype"
url =
if (version.toString().endsWith("SNAPSHOT")) {
snapshotsRepoUrl
} else {
releasesRepoUrl
}
name = "sonatype"
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl

credentials {
username = project.get("OSSRH_USERNAME")
Expand All @@ -183,14 +169,13 @@ publishing {
}

publications.withType<MavenPublication> {
groupId = project.get("POM_GROUPID")
artifactId = project.get("POM_ARTIFACTID")
version = project.get("POM_VERSION")

artifact(javadocJar)
artifact(javadocJar.get())

pom {
groupId = project.get("POM_GROUPID")
artifactId = project.get("POM_ARTIFACTID")
version = project.get("POM_VERSION")

name.set(project.get("POM_NAME"))
description.set(project.get("POM_DESCRIPTION"))
url.set(project.get("POM_URL"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class AccountBalanceResponse(
internal data class AccountBalanceResponse(
@SerialName("OriginatorConversationID")
val originatorConversationId: String,
@SerialName("ConversationID")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import kotlin.native.ObjCName
@ObjCName(swiftName = "C2BResponse")
@Serializable
/***/
data class C2BResponse(
internal data class C2BResponse(
/**This is a global unique identifier for the transaction request returned by the API proxy upon successful request submission.*/
@SerialName("OriginatorCoversationID")
val originatorCoversationId: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import kotlin.native.ObjCName

@ObjCName(swiftName = "DarajaTransactionResponse")
@Serializable
data class DarajaTransactionResponse(
internal data class DarajaTransactionResponse(
@SerialName("ResponseCode")
val responseCode: String,
@SerialName("ResponseDescription")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import kotlin.native.ObjCName
* @param [responseDescription] This is a response describing the status of the transaction.
* @param [qrCode] QR Code Image/Data/String.
* */
data class DynamicQrResponse(
internal data class DynamicQrResponse(
@SerialName("ResponseCode")
val responseCode: String,
@SerialName("RequestID")
Expand Down