Skip to content

Commit

Permalink
Change namespace from "com.github.davidepianca98" to "io.github.david…
Browse files Browse the repository at this point in the history
…epianca98"
  • Loading branch information
davidepianca98 committed Sep 20, 2023
1 parent ef25a74 commit eff347b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 59 deletions.
66 changes: 8 additions & 58 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,13 @@

#### Gradle

NOTE: Apple targets are not yet available through JitPack, so for now the library is published on GitHub packages which requires login credentials also for reading.

Setup GitHub credentials:
1. Open ~/.gradle/gradle.properties
2. Add the line `mavenUsername=yourGithubUsername`
3. Add the line `mavenPassword=yourGithubToken` (instructions to generate it https://docs.github.com/en/[email protected]/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)

Alternatively it is possible to follow these steps to build the library locally:
1. Clone the repository.
2. Run the gradle task `publishToMavenLocal`.
3. Replace the GitHub `maven` block with `mavenLocal()` in the `repositories` block in your `build.gradle.kts` file.
4. Continue with the following guide.

If you are getting an error saying that OpenSSL hasn't been found, please copy the correct file from https://github.com/davidepianca98/KMQTT/tree/master/kmqtt-common/src/nativeInterop in your project's main directory.

##### Kotlin Multiplatform plugin
On the Kotlin Multiplatform plugin you only need to require the dependency on the common source set and the platform specific parts will be automatically imported.
```gradle
repositories {
mavenCentral()
maven {
url = uri("https://maven.pkg.github.com/davidepianca98/KMQTT")
credentials(PasswordCredentials::class)
}
}
kotlin {
Expand All @@ -86,35 +69,27 @@ kotlin {
sourceSets {
commonMain {
dependencies {
implementation("com.github.davidepianca98:kmqtt-common:0.4.3")
implementation("com.github.davidepianca98:kmqtt-client:0.4.3")
implementation("io.github.davidepianca98:kmqtt-common:0.4.3")
implementation("io.github.davidepianca98:kmqtt-client:0.4.3")
}
}
}
}
```

NOTE: If you want to use Jitpack, replace "com.github.davidepianca98" with "com.github.davidepianca98.KMQTT" in the `implementation` statements.

##### Single platform project
```gradle
repositories {
mavenCentral()
maven {
url = uri("https://maven.pkg.github.com/davidepianca98/KMQTT")
credentials(PasswordCredentials::class)
}
}
dependencies {
implementation("com.github.davidepianca98:kmqtt-common-jvm:0.4.3")
implementation("com.github.davidepianca98:kmqtt-client-jvm:0.4.3")
implementation("io.github.davidepianca98:kmqtt-common-jvm:0.4.3")
implementation("io.github.davidepianca98:kmqtt-client-jvm:0.4.3")
}
```

Replace jvm with js, linuxx64, linuxarm64, mingwx64, macosx64, macosarm64, iosarm64, iosX64, iossimulatorarm64, tvossimulatorarm64, tvosx64, tvosarm64, watchosarm32, watchosarm64, watchosx64, watchossimulatorarm64 based on the desired target.

NOTE: If you want to use Jitpack, replace "com.github.davidepianca98" with "com.github.davidepianca98.KMQTT" in the `implementation` statements.

#### Quick start code example
This code starts the MQTT client on port 1883 without TLS encryption. You can play with MQTTClient() constructor parameters to set the various settings
```kotlin
Expand Down Expand Up @@ -175,30 +150,13 @@ You can download the executables for your platform under the release tab

#### Gradle

NOTE: Apple targets are not yet available through JitPack, so for now the library is published on GitHub packages which requires login credentials also for reading.

Setup GitHub credentials:
1. Open ~/.gradle/gradle.properties
2. Add the line `mavenUsername=yourGithubUsername`
3. Add the line `mavenPassword=yourGithubToken` (instructions to generate it https://docs.github.com/en/[email protected]/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)

Alternatively it is possible to follow these steps to build the library locally:
1. Clone the repository.
2. Run the gradle task `publishToMavenLocal`.
3. Replace the GitHub `maven` block with `mavenLocal()` in the `repositories` block in your `build.gradle.kts` file.
4. Continue with the following guide.

If you are getting an error saying that OpenSSL hasn't been found, please copy the correct file from https://github.com/davidepianca98/KMQTT/tree/master/kmqtt-common/src/nativeInterop in your project's main directory.

##### Kotlin Multiplatform plugin
On the Kotlin Multiplatform plugin you only need to require the dependency on the common source set and the platform specific parts will be automatically imported.
```gradle
repositories {
mavenCentral()
maven {
url = uri("https://maven.pkg.github.com/davidepianca98/KMQTT")
credentials(PasswordCredentials::class)
}
}
kotlin {
Expand All @@ -208,35 +166,27 @@ kotlin {
sourceSets {
commonMain {
dependencies {
implementation("com.github.davidepianca98:kmqtt-common:0.4.3")
implementation("com.github.davidepianca98:kmqtt-broker:0.4.3")
implementation("io.github.davidepianca98:kmqtt-common:0.4.3")
implementation("io.github.davidepianca98:kmqtt-broker:0.4.3")
}
}
}
}
```

NOTE: If you want to use Jitpack, replace "com.github.davidepianca98" with "com.github.davidepianca98.KMQTT" in the `implementation` statements.

##### Single platform project
```gradle
repositories {
mavenCentral()
maven {
url = uri("https://maven.pkg.github.com/davidepianca98/KMQTT")
credentials(PasswordCredentials::class)
}
}
dependencies {
implementation("com.github.davidepianca98:kmqtt-common-jvm:0.4.3")
implementation("com.github.davidepianca98:kmqtt-broker-jvm:0.4.3")
implementation("io.github.davidepianca98:kmqtt-common-jvm:0.4.3")
implementation("io.github.davidepianca98:kmqtt-broker-jvm:0.4.3")
}
```

Replace jvm with js, linuxx64, linuxarm64, macosarm64, macosx64, mingwx64 based on the desired target.

NOTE: If you want to use Jitpack, replace "com.github.davidepianca98" with "com.github.davidepianca98.KMQTT" in the `implementation` statements.

#### Quick start code example
This code starts the MQTT broker on port 1883 without TLS encryption. You can play with Broker() constructor parameters to set the various settings
```kotlin
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ plugins {
}

subprojects {
group = "com.github.davidepianca98"
group = "io.github.davidepianca98"
version = "0.4.3"
}

0 comments on commit eff347b

Please sign in to comment.