Skip to content

Commit

Permalink
readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
psuzn committed Dec 27, 2023
1 parent d6edf44 commit eadea8c
Showing 1 changed file with 75 additions and 10 deletions.
85 changes: 75 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
# Multiplatform Utils

[![Maven Central](https://img.shields.io/maven-central/v/me.sujanpoudel.mputils/paths?label=version&color=blue)](https://search.maven.org/search?q=me.sujanpoudel.mputils)
[![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/me.sujanpoudel.mputils/paths?label=snapshot&server=https%3A%2F%2Fs01.oss.sonatype.org)](https://s01.oss.sonatype.org/content/repositories/snapshots/me/sujanpoudel/mputils/)
[![kotlin](https://img.shields.io/badge/kotlin-1.9.21-blue?logo=kotlin)](http://kotlinlang.org)
[![compose-multiplatform](https://img.shields.io/badge/Compose_Multiplatform-1.5.11-blue?logo=jetpackcompose)](https://github.com/JetBrains/compose-jb)

![license](https://img.shields.io/github/license/psuzn/mp-utils?label=License)

MP Utils is a collection of a few utility libraries for developing multiplatform apps using Kotlin Multiplatform.

## Libraries

- `me.sujanpoudel.mpUtils:paths` : Get platform specific app data and cache directory(equivalent
to `ApplicationInfo.dataDir` or `NSHomeDirectory`).
- `me.sujanpoudel.mpUtils:platform-identifier` : Identify the current platform.
- `me.sujanpoudel.mpUtils:context-provider` : Get android context anywhere on your android source-set.
- `paths` : Get platform-specific app data and cache directory (equivalent
to `ApplicationInfo.dataDir` or `NSHomeDirectory` but for all the platforms).
- `platform-identifier` : Identify the current platform.
- `context-provider` : Get android context anywhere on your android source set.

## Table of content

- [Paths](#Paths)
- [Paths](#paths)
- [Setup](#setup)
- [Usage](#usage)
- [Getting App data directory](#getting-app-data-directory)
Expand All @@ -21,18 +28,33 @@ MP Utils is a collection of a few utility libraries for developing multiplatform
- [Usage](#usage-1)
- [Get current running platform info](#get-current-running-platform-info)
- [Possible return values](#possible-return-values)
- [Context Provider](#Paths)
- [Context Provider](#context-provider)
- [Setup](#setup-2)
- [Usage](#usage-2)
- [Get Android Context]()
- [Snapshots](#snapshots)
- [Contributions](#contributions)
- [License](#license)

## Paths

![badge-JVM](https://img.shields.io/badge/JVM(desktop)-orange)
![badge-Android](https://img.shields.io/badge/Android-dodgerblue?logo=android&logoColor=white)
![badge-iOS](https://img.shields.io/badge/iOS-gray?logo=apple&logoColor=silver)
![badge-macOS](https://img.shields.io/badge/macOS-gray?logo=apple&logoColor=silver)
![badge-Js(Node)](https://img.shields.io/badge/Js(Node)-limegreen?logo=nodedotjs&logoColor=white)

### Setup

> Coming soon!!
```kotlin
repositories {
mavenCentral()
}

dependencies {
implementation("me.sujanpoudel.mputils:paths:0.0.1")
}
```

### Usage

Expand Down Expand Up @@ -72,9 +94,25 @@ directory on other platforms

## Platform Identifier

![JVM(desktop)](https://img.shields.io/badge/JVM_(desktop)-orange?logo=freedesktopdoporg)
![Android](https://img.shields.io/badge/Android-dodgerblue?logo=android&logoColor=white)
![Android-native](https://img.shields.io/badge/Native-dodgerblue?logo=android&logoColor=white)
![iOS](https://img.shields.io/badge/iOS-gray?logo=apple&logoColor=silver)
![macOS](https://img.shields.io/badge/macOS-gray?logo=apple&logoColor=silver)
![windows](https://img.shields.io/badge/Windows-deepskyblue?logo=windows&logoColor=white)
![Js(Node)](https://img.shields.io/badge/Javascript-lightslategrey?logo=javascript&logoColor=white)

### Setup

> Coming soon!!
```kotlin
repositories {
mavenCentral()
}

dependencies {
implementation("me.sujanpoudel.mputils:platform-identifier:0.0.1")
}
```

### Usage

Expand Down Expand Up @@ -104,7 +142,6 @@ sealed class Platform {
data class IOS(override val arch: Arch, val version: String, val isSimulator: Boolean) : OS(arch)
data class WatchOs(override val arch: Arch, val version: String, val isSimulator: Boolean) : OS(arch)
data class TvOs(override val arch: Arch, val version: String, val isSimulator: Boolean) : OS(arch)

data class Android(
override val arch: Arch,
val buildNumber: Int,
Expand Down Expand Up @@ -133,9 +170,19 @@ enum class Arch {

## Context Provider

![Android](https://img.shields.io/badge/Android-dodgerblue?logo=android&logoColor=white)

### Setup

> Coming soon!!
```kotlin
repositories {
mavenCentral()
}

dependencies {
implementation("me.sujanpoudel.mputils:context-provider:0.0.1")
}
```

### Usage

Expand All @@ -148,6 +195,24 @@ val context = applicationContext

```

### Snapshots

Snapshots of the development version are available in Sonatype's
snapshots [repository](https://s01.oss.sonatype.org/content/repositories/snapshots/me/sujanpoudel/mputils/).

```kotlin
repositories {
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots/")
}

dependencies {
implementation("me.sujanpoudel.mputils:paths:0.0.1-SNAPSHOT")
implementation("me.sujanpoudel.mputils:platform-identifier:0.0.1-SNAPSHOT")
implementation("me.sujanpoudel.mputils:context-provider:0.0.1-SNAPSHOT")
}
```

### Contributions

Contributions are always welcome!. If you'd like to contribute, please feel free to create a PR or
Expand Down

0 comments on commit eadea8c

Please sign in to comment.