Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
root = true

[*.{kt,kts}]
ktlint_standard_import-ordering = disabled
10 changes: 10 additions & 0 deletions .github/workflows/KMMBridge-Debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Publish a build for development. The Xcode framework is debuggable.
name: KMMBridge-Debug
on:
workflow_dispatch:

jobs:
call-publish:
uses: ./.github/workflows/create_swift_package.yml
with:
build-debug: true
10 changes: 10 additions & 0 deletions .github/workflows/KMMBridge-Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Publish a build for release.
name: KMMBridge-Release
on:
workflow_dispatch:

jobs:
call-publish:
uses: ./.github/workflows/create_swift_package.yml
with:
build-debug: false
27 changes: 19 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,47 @@ on:
jobs:
build-and-test:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
api-level: [ 29 ]
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
ref: ${{ github.head_ref || github.ref }}
fetch-depth: 0
persist-credentials: false

- name: Set up JDK 17
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: '17'

- name: Setup Gradle
uses: gradle/gradle-build-action@v3
uses: gradle/actions/setup-gradle@v6

- name: Grant execute permission for Gradlew
run: chmod +x gradlew

- name: Build and Test with Coverage
run: ./gradlew clean build koverXmlReport --stacktrace
run: ./gradlew clean build koverXmlReport --stacktrace --continue

- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: always()
with:
report_paths: '**/build/test-results/**/*.xml'

- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v4
if: github.repository == 'MobileNativeFoundation/Store'
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: build/reports/kover/coverage.xml
Expand All @@ -53,16 +64,16 @@ jobs:
needs: build-and-test
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up JDK 17
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: '17'

- name: Setup Gradle
uses: gradle/gradle-build-action@v3
uses: gradle/actions/setup-gradle@v6

- name: Grant execute permission for Gradlew
run: chmod +x gradlew
Expand Down
69 changes: 65 additions & 4 deletions .github/workflows/create_swift_package.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,68 @@
name: Create Swift Package
# Based on: https://github.com/touchlab/KMMBridgeSPMQuickStart/blob/main/.github/workflows/Base-Publish.yml
name: Base-Publish

on:
workflow_dispatch:
workflow_call:
inputs:
build-debug:
description: If set to true, the Xcode framework is debuggable. For release builds, setting to false produces more optimized binaries.
required: true
type: boolean

permissions:
contents: write
packages: write

jobs:
publish:
uses: touchlab/KMMBridgeGithubWorkflow/.github/workflows/[email protected]
kmmbridgepublish:
concurrency: "kmmbridgepublish-${{ github.repository }}"
runs-on: macos-latest
steps:
- name: Checkout the repo with tags
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true

- name: Retrieve Version
id: versionPropertyValue
run: |
VERSION=$(grep -w 'VERSION_NAME' gradle.properties | cut -d'=' -f2)
echo "propVal=$VERSION" >> $GITHUB_OUTPUT

- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: '17'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6

- name: Grant execute permission for Gradlew
run: chmod +x gradlew

- name: Create or Find Artifact Release
id: devrelease
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: "${{ steps.versionPropertyValue.outputs.propVal }}"

- name: Build and Publish
run: |
./gradlew kmmBridgePublish \
-PNATIVE_BUILD_TYPE=${{ inputs.build-debug && 'DEBUG' || 'RELEASE' }} \
-PGITHUB_ARTIFACT_RELEASE_ID=${{ steps.devrelease.outputs.id }} \
-PGITHUB_PUBLISH_TOKEN=${{ secrets.GITHUB_TOKEN }} \
-PGITHUB_REPO=${{ github.repository }} \
--no-daemon --info --stacktrace
env:
GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m"

- uses: touchlab/ga-update-release-tag@v1
id: update-release-tag
with:
commitMessage: "KMP SPM package release for ${{ steps.versionPropertyValue.outputs.propVal }}"
tagMessage: "KMP release version ${{ steps.versionPropertyValue.outputs.propVal }}"
tagVersion: ${{ steps.versionPropertyValue.outputs.propVal }}
76 changes: 38 additions & 38 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
alias(libs.plugins.android.kotlin.multiplatform) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.dokka) apply false
alias(libs.plugins.vanniktech.maven.publish) apply false
alias(libs.plugins.atomicfu) apply false
alias(libs.plugins.kotlin.cocoapods) apply false
alias(libs.plugins.ktlint)
id("com.diffplug.spotless") version "6.4.1"
}

buildscript {
repositories {
mavenCentral()
gradlePluginPortal()
google()
}

dependencies {
classpath(libs.android.gradle.plugin)
classpath(libs.kotlin.gradle.plugin)
classpath(libs.kotlin.serialization.plugin)
classpath(libs.dokka.gradle.plugin)
classpath(libs.ktlint.gradle.plugin)
classpath(libs.jacoco.gradle.plugin)
classpath(libs.maven.publish.plugin)
classpath(libs.atomic.fu.gradle.plugin)
classpath(libs.kmmBridge.gradle.plugin)
classpath(libs.binary.compatibility.validator)
}
}

allprojects {
repositories {
mavenCentral()
google()
}
alias(libs.plugins.spotless)
alias(libs.plugins.binary.compatibility.validator) apply false
alias(libs.plugins.kmmbridge.github) apply false
}

val ktLintVersion = libs.versions.ktlint.get()
subprojects {
apply(plugin = "org.jlleitschuh.gradle.ktlint")
apply(plugin = "com.diffplug.spotless")

ktlint {
disabledRules.add("import-ordering")
}

spotless {
kotlin {
target("src/**/*.kt")
}
}
ktlint {
version = ktLintVersion
additionalEditorconfig.put("ktlint_standard_function-expression-body", "disabled")
additionalEditorconfig.put("ktlint_standard_class-signature", "disabled")
additionalEditorconfig.put("ktlint_standard_spacing-between-declarations-with-comments", "disabled")
additionalEditorconfig.put("ktlint_standard_when-entry-bracing", "disabled")
additionalEditorconfig.put("ktlint_standard_blank-line-between-when-conditions", "disabled")
additionalEditorconfig.put("ktlint_standard_kdoc", "disabled")
additionalEditorconfig.put("ktlint_standard_max-line-length", "disabled")
additionalEditorconfig.put("ktlint_standard_chain-method-continuation", "disabled")
additionalEditorconfig.put("ktlint_standard_function-signature", "disabled")
}
}

tasks {
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "11"
withType<KotlinCompile> {
compilerOptions {
jvmTarget = JvmTarget.fromTarget(libs.versions.jvmCompat.get())
}
}

withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_11.name
targetCompatibility = JavaVersion.VERSION_11.name
sourceCompatibility = libs.versions.jvmCompat.get()
targetCompatibility = libs.versions.jvmCompat.get()
}
}

// Workaround for https://youtrack.jetbrains.com/issue/KT-62040
tasks.getByName("wrapper")

tasks.named<UpdateDaemonJvm>("updateDaemonJvm") {
// JDK 17 is the minimum version supported by the org.gradle.toolchains.foojay-resolver-convention plugin
languageVersion = JavaLanguageVersion.of(17)
vendor.set(JvmVendorSpec.AZUL)
}
2 changes: 1 addition & 1 deletion cache/api/jvm/cache.api
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
public abstract interface class org/mobilenativefoundation/store/cache5/Cache {
public abstract fun getAllPresent ()Ljava/util/Map;
public fun getAllPresent ()Ljava/util/Map;
public abstract fun getAllPresent (Ljava/util/List;)Ljava/util/Map;
public abstract fun getIfPresent (Ljava/lang/Object;)Ljava/lang/Object;
public abstract fun getOrPut (Ljava/lang/Object;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
Expand Down
8 changes: 2 additions & 6 deletions cache/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,18 @@ plugins {
kotlin {

sourceSets {
val commonMain by getting {
commonMain {
dependencies {
api(libs.kotlinx.atomic.fu)
api(projects.core)
implementation(libs.kotlinx.coroutines.core)
}
}
val commonTest by getting {
commonTest {
dependencies {
implementation(libs.junit)
implementation(libs.kotlinx.coroutines.test)
}
}
}
}

android {
namespace = "org.mobilenativefoundation.store.cache"
}
2 changes: 0 additions & 2 deletions cache/src/androidMain/AndroidManifest.xml

This file was deleted.

6 changes: 1 addition & 5 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@ plugins {
kotlin {

sourceSets {
val commonMain by getting {
commonMain {
dependencies {
implementation(libs.kotlin.stdlib)
}
}
}
}

android {
namespace = "org.mobilenativefoundation.store.core"
}
2 changes: 0 additions & 2 deletions core/src/androidMain/AndroidManifest.xml

This file was deleted.

6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# don't use jetifier, all deps are in androidX already android.enableJetifier=true
android.useAndroidX=true
org.gradle.caching=true
org.gradle.configureondemand=true
org.gradle.configureondemand=false
org.gradle.configuration-cache=true

# https://github.com/Kotlin/dokka/issues/1405
org.gradle.jvmargs=-XX:MaxMetaspaceSize=2G

# POM file
GROUP=org.mobilenativefoundation.store
VERSION_NAME=5.1.0-alpha08
VERSION_NAME=5.1.0-SNAPSHOT
POM_PACKAGING=pom
POM_DESCRIPTION = Store5 is a Kotlin Multiplatform network-resilient repository layer

Expand All @@ -23,6 +24,5 @@ POM_DEVELOPER_ID=dropbox
POM_DEVELOPER_NAME=Dropbox
kotlinx.atomicfu.enableJvmIrTransformation=false
kotlinx.atomicfu.enableJsIrTransformation=false
kotlin.js.compiler=ir

org.jetbrains.compose.experimental.uikit.enabled=true
13 changes: 13 additions & 0 deletions gradle/gradle-daemon-jvm.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#This file is generated by updateDaemonJvm
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/584d2f01a3c6e59ebb9478a182f5f714/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/7352c4c0c11b2db21fdd7541204de287/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/584d2f01a3c6e59ebb9478a182f5f714/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/7352c4c0c11b2db21fdd7541204de287/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/12ed6bcbab330f7afa37d16220b272a3/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/a7e1d8e6e800a81047d4aec26156ef5c/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/584d2f01a3c6e59ebb9478a182f5f714/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/7352c4c0c11b2db21fdd7541204de287/redirect
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/3676ee7aa5095d7f22645eb0f22ca159/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/fc98f2d434c5796fe6ec02f0f22957b3/redirect
toolchainVendor=AZUL
toolchainVersion=17
Loading
Loading