Skip to content

Commit

Permalink
Update android.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sumitjat3 committed Nov 4, 2024
1 parent 09d9fbf commit bc7df6e
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 83 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: '18.x'
- name: Check Build Website
run: |
cd docs
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ jobs:
name: Publish GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: '16.x'

- name: Build website
run: |
cd docs
Expand Down
10 changes: 0 additions & 10 deletions app/src/main/java/com/gojek/courier/app/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import com.gojek.mqtt.model.AdaptiveKeepAliveConfig
import com.gojek.mqtt.model.KeepAlive
import com.gojek.mqtt.model.MqttConnectOptions
import com.gojek.mqtt.model.ServerUri
import com.gojek.mqtt.model.Will
import com.gojek.workmanager.pingsender.WorkManagerPingSenderConfig
import com.gojek.workmanager.pingsender.WorkPingSenderFactory
import kotlinx.android.synthetic.main.activity_main.brokerIP
Expand Down Expand Up @@ -123,21 +122,12 @@ class MainActivity : AppCompatActivity() {
}

private fun connectMqtt(clientId: String, username: String, password: String, ip: String, port: Int) {

val will = Will(
topic = "last/will/topic",
message = "Client disconnected unexpectedly",
qos = QoS.ZERO,
retained = false
)

val connectOptions = MqttConnectOptions.Builder()
.serverUris(listOf(ServerUri(ip, port, if (port == 443) "ssl" else "tcp")))
.clientId(clientId)
.userName(username)
.password(password)
.cleanSession(false)
.will(will)
.keepAlive(KeepAlive(timeSeconds = 30))
.build()

Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/deps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ object versions {
const val kotlin = "1.6.21"
const val agp = "7.4.2"
const val jetifierProcessor = "1.0.0-beta10"
const val jfrogBuildInfoExtractor = "4.23.4"
const val jfrogBuildInfoExtractor = "4.11.0"
const val navigation = "2.1.0-rc01"
const val coroutines = "1.3.2"
const val broadcast = "1.0.0"
Expand Down
23 changes: 10 additions & 13 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{
"name": "docs",
"version": "1.0.0",
"version": "0.0.0",
"private": true,
"engines": {
"node": ">=18"
},
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
Expand All @@ -17,16 +14,16 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "^3.0.0",
"@docusaurus/preset-classic": "^3.0.0",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
"prism-react-renderer": "^2.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"@docusaurus/core": "2.0.0-beta.20",
"@docusaurus/preset-classic": "2.0.0-beta.20",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.1.1",
"prism-react-renderer": "^1.3.1",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.0.0"
"@docusaurus/module-type-aliases": "2.0.0-beta.20"
},
"browserslist": {
"production": [
Expand All @@ -40,4 +37,4 @@
"last 1 safari version"
]
}
}
}
20 changes: 0 additions & 20 deletions mqtt-client/api/mqtt-client.api
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,6 @@ public final class com/gojek/mqtt/model/MqttConnectOptions {
public final fun getUserPropertiesMap ()Ljava/util/Map;
public final fun getUsername ()Ljava/lang/String;
public final fun getVersion ()Lcom/gojek/mqtt/model/MqttVersion;
public final fun getWill ()Lcom/gojek/mqtt/model/Will;
public final fun getX509TrustManager ()Ljavax/net/ssl/X509TrustManager;
public final fun isCleanSession ()Z
public final fun newBuilder ()Lcom/gojek/mqtt/model/MqttConnectOptions$Builder;
Expand All @@ -1065,7 +1064,6 @@ public final class com/gojek/mqtt/model/MqttConnectOptions$Builder {
public final fun alpnProtocols (Ljava/util/List;)Lcom/gojek/mqtt/model/MqttConnectOptions$Builder;
public final fun build ()Lcom/gojek/mqtt/model/MqttConnectOptions;
public final fun cleanSession (Z)Lcom/gojek/mqtt/model/MqttConnectOptions$Builder;
public final fun clearWill ()Lcom/gojek/mqtt/model/MqttConnectOptions$Builder;
public final fun clientId (Ljava/lang/String;)Lcom/gojek/mqtt/model/MqttConnectOptions$Builder;
public final fun connectionSpec (Lorg/eclipse/paho/client/mqttv3/ConnectionSpec;)Lcom/gojek/mqtt/model/MqttConnectOptions$Builder;
public final fun keepAlive (Lcom/gojek/mqtt/model/KeepAlive;)Lcom/gojek/mqtt/model/MqttConnectOptions$Builder;
Expand All @@ -1077,7 +1075,6 @@ public final class com/gojek/mqtt/model/MqttConnectOptions$Builder {
public final fun sslSocketFactory (Ljavax/net/ssl/SSLSocketFactory;Ljavax/net/ssl/X509TrustManager;)Lcom/gojek/mqtt/model/MqttConnectOptions$Builder;
public final fun userName (Ljava/lang/String;)Lcom/gojek/mqtt/model/MqttConnectOptions$Builder;
public final fun userProperties (Ljava/util/Map;)Lcom/gojek/mqtt/model/MqttConnectOptions$Builder;
public final fun will (Lcom/gojek/mqtt/model/Will;)Lcom/gojek/mqtt/model/MqttConnectOptions$Builder;
}

public final class com/gojek/mqtt/model/MqttConnectOptions$Companion {
Expand Down Expand Up @@ -1106,23 +1103,6 @@ public final class com/gojek/mqtt/model/ServerUri {
public fun toString ()Ljava/lang/String;
}

public final class com/gojek/mqtt/model/Will {
public fun <init> (Ljava/lang/String;Ljava/lang/String;Lcom/gojek/courier/QoS;Z)V
public final fun component1 ()Ljava/lang/String;
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Lcom/gojek/courier/QoS;
public final fun component4 ()Z
public final fun copy (Ljava/lang/String;Ljava/lang/String;Lcom/gojek/courier/QoS;Z)Lcom/gojek/mqtt/model/Will;
public static synthetic fun copy$default (Lcom/gojek/mqtt/model/Will;Ljava/lang/String;Ljava/lang/String;Lcom/gojek/courier/QoS;ZILjava/lang/Object;)Lcom/gojek/mqtt/model/Will;
public fun equals (Ljava/lang/Object;)Z
public final fun getMessage ()Ljava/lang/String;
public final fun getQos ()Lcom/gojek/courier/QoS;
public final fun getRetained ()Z
public final fun getTopic ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class com/gojek/mqtt/network/ActiveNetInfo {
public fun <init> (ZZS)V
public final fun component1 ()Z
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,6 @@ internal class AndroidMqttClient(
.keepAlive(keepAliveProvider.getKeepAlive(connectOptions))
.clientId(connectOptions.clientId + ":adaptive")
.cleanSession(true)
.clearWill()
.build()
} else {
connectOptions.newBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,6 @@ internal class MqttConnection(
connectionSpec = mqttConnectOptions.connectionSpec
alpnProtocolList = mqttConnectOptions.protocols
}

mqttConnectOptions.will?.apply {
options?.setWill(
topic,
message.toByteArray(),
qos.value,
retained
)
}

// Setting some connection options which we need to reset on every connect

logger.d(TAG, "MQTT connecting on : " + mqtt!!.serverURI)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ class MqttConnectOptions private constructor(

val protocols: List<Protocol> = builder.protocols

val will: Will? = builder.will

init {

if (connectionSpec.isTls.not()) {
this.sslSocketFactory = null
this.x509TrustManager = null
Expand Down Expand Up @@ -80,7 +77,6 @@ class MqttConnectOptions private constructor(
internal var x509TrustManagerOrNull: X509TrustManager? = null
internal var connectionSpec: ConnectionSpec = DEFAULT_CONNECTION_SPECS
internal var protocols: List<Protocol> = emptyList()
internal var will: Will? = null

internal constructor(mqttConnectOptions: MqttConnectOptions) : this() {
this.serverUris = mqttConnectOptions.serverUris
Expand All @@ -97,7 +93,6 @@ class MqttConnectOptions private constructor(
this.x509TrustManagerOrNull = mqttConnectOptions.x509TrustManager
this.connectionSpec = mqttConnectOptions.connectionSpec
this.protocols = mqttConnectOptions.protocols
this.will = mqttConnectOptions.will
}

fun serverUris(serverUris: List<ServerUri>) = apply {
Expand Down Expand Up @@ -209,14 +204,6 @@ class MqttConnectOptions private constructor(
this.protocols = protocols
}

fun will(will: Will) = apply {
this.will = will
}

fun clearWill() = apply {
this.will = null
}

fun build(): MqttConnectOptions = MqttConnectOptions(this)
}

Expand Down
10 changes: 0 additions & 10 deletions mqtt-client/src/main/java/com/gojek/mqtt/model/Will.kt

This file was deleted.

0 comments on commit bc7df6e

Please sign in to comment.