Skip to content

Commit

Permalink
Merge pull request #25 from psuzn/house-keeping
Browse files Browse the repository at this point in the history
general house keeping
  • Loading branch information
psuzn authored Apr 17, 2024
2 parents 1c719a6 + 834931f commit 544a5af
Show file tree
Hide file tree
Showing 85 changed files with 1,743 additions and 539 deletions.
10 changes: 8 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# https://EditorConfig.org
# EditorConfig is awesome: https://EditorConfig.org

root = true

Expand All @@ -18,6 +18,12 @@ ij_kotlin_name_count_to_use_star_import_for_members = 99999
ij_java_names_count_to_use_import_on_demand = 99999

ktlint_code_style = ktlint_official
ktlint_experimental = disabled
ktlint_standard_filename = disabled

ktlint_standard_annotation = disabled
ktlint_function_naming_ignore_when_annotated_with = Composable
ktlint_function_signature_body_expression_wrapping = default
ktlint_standard_multiline-expression-wrapping = disabled
ktlint_standard_string-template-indent = disabled
ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = 4

42 changes: 0 additions & 42 deletions .github/workflows/CI.yaml

This file was deleted.

44 changes: 44 additions & 0 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build Linux

on:
workflow_call:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
env:
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3g"

steps:
- uses: actions/checkout@v4

- name: JDK setup
uses: actions/setup-java@v4
with:
java-version: 17
distribution: corretto

- name: Cache
uses: actions/cache@v4
with:
path: |
./build
./.gradle
~/.gradle/caches
~/.gradle/wrapper
~/.m2/repository
~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Tests
run: ./gradlew allTest --parallel --no-daemon --stacktrace

- name: Lint and Static analysis
run: ./gradlew detekt ktlintCheck --no-daemon --stacktrace

- name: Build Artifacts
run: ./gradlew publishToMavenLocal

55 changes: 55 additions & 0 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build macOS

on:
workflow_call:
workflow_dispatch:

jobs:
build:
runs-on: macos-latest

env:
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3g"

steps:
- uses: actions/checkout@v4

- name: JDK setup
uses: actions/setup-java@v4
with:
java-version: 17
distribution: corretto

- name: Cache
uses: actions/cache@v4
with:
path: |
./build
./.gradle
~/.gradle/caches
~/.gradle/wrapper
~/.m2/repository
~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Tests
run: ./gradlew allTests -x tvosSimulatorArm64Test -x watchosSimulatorArm64Test

- name: Mac build
run: |
./gradlew \
publishIosArm64PublicationToMavenLocal \
publishIosSimulatorArm64PublicationToMavenLocal \
publishIosX64PublicationToMavenLocal \
publishMacosX64PublicationToMavenLocal \
publishMacosArm64PublicationToMavenLocal \
publishWatchosArm64PublicationToMavenLocal \
publishWatchosArm32PublicationToMavenLocal \
publishWatchosSimulatorArm64PublicationToMavenLocal \
publishTvosArm64PublicationToMavenLocal \
publishTvosSimulatorArm64PublicationToMavenLocal \
publishTvosX64PublicationToMavenLocal \
--no-daemon --stacktrace
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on:
push:
branches: [ "main", "develop" ]
paths-ignore:
- "**/*.md"
pull_request:
branches: [ "main", "develop" ]
paths-ignore:
- "**/*.md"
workflow_call:

permissions:
contents: read

jobs:
build-linux:
name: Build Linux
uses: ./.github/workflows/build-linux.yml

build-macos:
name: Build macOS
uses: ./.github/workflows/build-macos.yml

29 changes: 13 additions & 16 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,34 @@ jobs:
matrix:
os: [ 'macos-latest' ]
runs-on: ${{ matrix.os }}
env:
BUILDLESS_APIKEY: ${{ secrets.BUILDLESS_APIKEY }}

outputs:
VERSION_NAME: ${{ steps.extract_version_name.outputs.VERSION_NAME }}

steps:
- uses: actions/checkout@v3

- name: "Setup: Buildless"
uses: buildless/[email protected]

- name: Set up JDK 17
uses: actions/setup-java@v3
- name: JDK setup
uses: actions/setup-java@v4
with:
java-version: |
11
17
distribution: 'temurin'
cache: gradle
java-version: 17
distribution: corretto

- name: Setup Gradle
uses: gradle/[email protected]

- name: Checkout Gradle Build Cache
uses: actions/cache@v3
- name: Cache
uses: actions/cache@v4
with:
path: |
./build
./.gradle
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
~/.m2/repository
~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
Expand Down Expand Up @@ -70,7 +67,7 @@ jobs:
runs-on: ubuntu-latest
if: ${{ !endsWith(needs.release_artifacts.outputs.VERSION_NAME,'SNAPSHOT') }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Extract release notes
id: release_notes
Expand Down
2 changes: 1 addition & 1 deletion .idea/runConfigurations/IOS_App.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 17 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

# Multiplatform Paths

[![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/)
[![CI](https://github.com/psuzn/mp-utils/actions/workflows/CI.yaml/badge.svg)](https://github.com/psuzn/mp-utils/actions/workflows/CI.yaml)
[![Maven Central](https://img.shields.io/maven-central/v/me.sujanpoudel.multiplatform.utils/paths?label=version&color=blue)](https://search.maven.org/search?q=me.sujanpoudel.multiplatform.utils)
[![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/me.sujanpoudel.multiplatform.utils/paths?label=snapshot&server=https%3A%2F%2Fs01.oss.sonatype.org)](https://s01.oss.sonatype.org/content/repositories/snapshots/me/sujanpoudel/multiplatform/)
[![CI](https://github.com/psuzn/multiplatform-paths/actions/workflows/CI.yaml/badge.svg)](https://github.com/psuzn/mp-utils/actions/workflows/CI.yaml)

[![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)
![license](https://img.shields.io/github/license/psuzn/multiplatform-paths?label=License)

Platform-specific application home and cache directories for KMP

Expand Down Expand Up @@ -44,7 +44,7 @@ repositories {
}

dependencies {
implementation("me.sujanpoudel.mputils:paths:0.1.1")
implementation("me.sujanpoudel.multiplatform.utils:multiplatform-paths:0.1.1")
}
```

Expand All @@ -53,7 +53,7 @@ dependencies {
#### App data directory

```kotlin
import me.sujanpoudel.mputils.paths.appDataDirectory
import me.sujanpoudel.utils.paths.appDataDirectory

val packageName = "example.com.app"

Expand All @@ -66,7 +66,7 @@ directory on other platforms.
#### App cache directory

```kotlin
import me.sujanpoudel.mputils.paths.appCacheDirectory
import me.sujanpoudel.utils.paths.appCacheDirectory

val packageName = "example.com.app"

Expand Down Expand Up @@ -116,7 +116,7 @@ repositories {
}

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

Expand All @@ -125,7 +125,7 @@ dependencies {
#### Get current running platform info

```kotlin
import me.sujanpoudel.mputils.platformIdentifier.platform
import me.sujanpoudel.multiplatform.utils.platformIdentifier.platform

val currentPlatform = platform()

Expand Down Expand Up @@ -180,7 +180,7 @@ repositories {
}

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

Expand All @@ -189,16 +189,17 @@ dependencies {
#### Get Android Context

```kotlin
import me.sujanpoudel.mputils.contextProvider.applicationContext
import me.sujanpoudel.utils.contextProvider.applicationContext
import android.content.Context

val context = applicationContext
val context: 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/).
snapshots [repository](https://s01.oss.sonatype.org/content/repositories/snapshots/me/sujanpoudel/multiplatform).

```kotlin
repositories {
Expand All @@ -207,9 +208,9 @@ repositories {
}

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

Expand Down
File renamed without changes.
Loading

0 comments on commit 544a5af

Please sign in to comment.