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

[DSDK-55] [TASK] Publish artifact on artifactory #11

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
40 changes: 24 additions & 16 deletions transport-ble/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ android {
kotlinOptions {
jvmTarget = "11"
}
publishing {
singleVariant('release') {
withSourcesJar()
}
}
}

dependencies {
Expand Down Expand Up @@ -59,31 +64,34 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

task sourceJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
archiveClassifier.set("sources")
}
//task sourceJar(type: Jar) {
// from android.sourceSets.main.java.srcDirs
// archiveClassifier.set("sources")
//}

publishing {
publications {
/*release(MavenPublication) {
groupId 'com.ledger.live'
artifactId 'android-transport-ble'
version '1.0.0'

artifact("$buildDir/outputs/aar/transport-ble-release.aar")
}*/

debug(MavenPublication) {
release(MavenPublication) {
groupId 'com.ledger.live'
artifactId 'android-transport-ble'
version '1.0.0-rc15'
artifact(sourceJar)

afterEvaluate {
//artifact("$buildDir/outputs/aar/transport-ble-debug.aar")
from components.debug
// artifact("$buildDir/outputs/aar/transport-ble-release.aar")
from components.release
}
}

// debug(MavenPublication) {
// groupId 'com.ledger.live'
// artifactId 'android-transport-ble'
// version "1.0.0-rc15"
// //artifact(sourceJar)
// afterEvaluate {
// //artifact("$buildDir/outputs/aar/transport-ble-debug.aar")
// from components.debug
// }
// }
}

/*repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ class BleManager internal constructor(
when (event) {
is BleServiceEvent.BleDeviceConnected -> {
connectionCallback?.onConnectionSuccess(connectedDevice)
_bleState.tryEmit(BleState.Connected(connectedDevice))
_bleState.tryEmit(BleState.Connected(connectedDevice = connectedDevice, mtu = event.mtu))
}

is BleServiceEvent.BleDeviceDisconnected -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ sealed class BleState {
): BleState()

data class Connected (
val connectedDevice: BleDeviceModel
val connectedDevice: BleDeviceModel,
val mtu: Int,
): BleState()

data class Disconnected(val error: BleError? = null): BleState()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class BleService : Service() {
is BleServiceStateMachine.BleServiceState.Ready -> {
if (!isReady) {
isReady = true
notify(BleServiceEvent.BleDeviceConnected)
notify(BleServiceEvent.BleDeviceConnected(mtu = it.mtu))
}

it.answer?.let { answer ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.ledger.live.ble.service.model
import com.ledger.live.ble.model.BleError

sealed class BleServiceEvent {
data object BleDeviceConnected: BleServiceEvent()
data class BleDeviceConnected(val mtu: Int): BleServiceEvent()
data class BleDeviceDisconnected(val error: BleError? = null): BleServiceEvent()
data class SuccessSend(val sendId: String): BleServiceEvent()
data class SendAnswer(val sendId: String, val answer: String): BleServiceEvent()
Expand Down