Skip to content

Commit

Permalink
Working on Zowe Client Kotlin SDK docs
Browse files Browse the repository at this point in the history
Signed-off-by: Uladzislau <[email protected]>
  • Loading branch information
KUGDev committed Sep 4, 2024
1 parent 5547e38 commit 2023360
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ To install this library in your project, use one of build tools like Maven, Grad
To add the SDK as a Maven dependency:

1. Declare a Zowe JFrog artifactory as a custom repository to fetch from:

```xml
<project>
...
Expand All @@ -26,6 +27,7 @@ To add the SDK as a Maven dependency:
```

2. Add a new Maven dependency:

```xml
<project>
...
Expand All @@ -45,6 +47,7 @@ To add the SDK as a Maven dependency:
To add the SDK as a Gradle dependency:

1. Declare a Zowe JFrog artifactory as a custom repository to fetch from:

```kotlin
repositories {
...
Expand All @@ -56,6 +59,7 @@ repositories {
```

2. Add a new Gradle dependency:

```kotlin
// change the <version> to the actual version of the Zowe Client Kotlin SDK
val zoweKotlinSdkVersion = <version>
Expand All @@ -70,6 +74,7 @@ dependencies {
### How to use the SDK in your project

To use the Zowe Client Kotlin SDK after it is added as a dependency in your project, simply import any of the needed packages:

```kotlin
...
import org.zowe.kotlinsdk
Expand Down Expand Up @@ -107,6 +112,7 @@ The raw APIs provide descriptions with headers and body parameters to issue a re
To customize the request triggering and response handling:
1. Import the necessary raw API to cover, as well as **Retrofit2 API builder**:

```kotlin
...
// Import DataAPI and API wrapper
Expand All @@ -120,6 +126,7 @@ import org.zowe.kotlinsdk.buildApiWithBytesConverter
```

2. Wrap the API with the **Retrofit2 API builder**

```kotlin
...
// Build DataAPI wrapper
Expand All @@ -128,6 +135,7 @@ val datasetsApi = buildApi(<zosmf-url>, <okhttp-client>, DataAPI::class.java)
```

3. Use the API wrapper and process the response

```kotlin
...
// Declare the request
Expand Down Expand Up @@ -168,17 +176,20 @@ This package provides the default API isage implementation that is available to

As the example of how to use the default implementation:
1. Import **ZOSConnection** and other classes with the functionality needed:

```kotlin
import org.zowe.kotlinsdk.zowe.client.sdk.core.ZOSConnection
import org.zowe.kotlinsdk.zowe.client.sdk.zosfiles.ZosDsn
```

2. Create a **ZOSConnection** instance:

```kotlin
val zosConnection = ZOSConnection("<host>", "<port>", "<username>", "<password>", "http(s)")
```

3. Create the functionality class instance and trigger the function needed:

```kotlin
val result = ZosDsn(zosConnection).createDsn("<dsn>", <CreateDataset cls instance>)
```
Expand Down Expand Up @@ -212,6 +223,7 @@ Before running integration tests, you need three variables to be set up:
- **``ZOSMF_TEST_PASSWORD``** - a user password to run the tests

To run the integration tests:

```shell
./gradlew intTest
```
Expand All @@ -221,6 +233,7 @@ To run the integration tests:
We use **[Dokka](https://github.com/Kotlin/dokka)** to generate the SDK documentation.

To generate the docs, run:

```shell
./gradlew dokkaHtml
```
Expand All @@ -239,6 +252,7 @@ The rules and commands below describe how to publish artifacts for the Zowe Clie
1. The version of the built SDK will be in a **SemVer** format. To provide a build that is not yet ready to be publicly used, add the **-rc.n** at the end of the version, where **n** is **the next release candidate**.
2. Provide **`zowe.deploy.username`** and **`zowe.deploy.password`** as the parameters of the **`release`** command to specify the credentials to the [Zowe Artifactory](https://zowe.jfrog.io/), as well as the **`artifactory_user`** and the **`artifactory_password`** (generally, the credentials might be the same, but the variables are different for the different tasks during the release process).
Example:

```shell
./gradlew release -Pzowe.deploy.username=$ARTIFACTORY_USERNAME -Pzowe.deploy.password=$ARTIFACTORY_PASSWORD -Partifactory_user=$ARTIFACTORY_USERNAME -Partifactory_password=$ARTIFACTORY_USERNAME
```
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ repositoryUrl=https://github.com/zowe/zowe-client-kotlin-sdk

# Artifacts version (is changed automatically after the version is released)
# !!!DO NOT CHANGE YOURSELF!!!
version=0.5.0-rc.12
version=0.5.0-rc.13

# Artifactory repositories for builds
artifactoryMavenRepo=https://zowe.jfrog.io/zowe/libs-release
Expand Down

0 comments on commit 2023360

Please sign in to comment.