Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add binary compatibility validator and convention plugins #645

Merged
merged 1 commit into from
Jun 29, 2024
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
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ buildscript {
classpath(libs.kover.plugin)
classpath(libs.atomic.fu.gradle.plugin)
classpath(libs.kmmBridge.gradle.plugin)
classpath(libs.binary.compatibility.validator)
}
}

Expand Down
69 changes: 69 additions & 0 deletions cache/api/android/cache.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
public abstract interface class org/mobilenativefoundation/store/cache5/Cache {
public abstract 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;
public abstract fun invalidate (Ljava/lang/Object;)V
public abstract fun invalidateAll ()V
public abstract fun invalidateAll (Ljava/util/List;)V
public abstract fun put (Ljava/lang/Object;Ljava/lang/Object;)V
public abstract fun putAll (Ljava/util/Map;)V
public abstract fun size ()J
}

public final class org/mobilenativefoundation/store/cache5/Cache$DefaultImpls {
public static fun getAllPresent (Lorg/mobilenativefoundation/store/cache5/Cache;)Ljava/util/Map;
}

public final class org/mobilenativefoundation/store/cache5/CacheBuilder {
public static final field Companion Lorg/mobilenativefoundation/store/cache5/CacheBuilder$Companion;
public fun <init> ()V
public final fun build ()Lorg/mobilenativefoundation/store/cache5/Cache;
public final fun concurrencyLevel (Lkotlin/jvm/functions/Function0;)Lorg/mobilenativefoundation/store/cache5/CacheBuilder;
public final fun expireAfterAccess-LRDsOJo (J)Lorg/mobilenativefoundation/store/cache5/CacheBuilder;
public final fun expireAfterWrite-LRDsOJo (J)Lorg/mobilenativefoundation/store/cache5/CacheBuilder;
public final fun maximumSize (J)Lorg/mobilenativefoundation/store/cache5/CacheBuilder;
public final fun ticker (Lkotlin/jvm/functions/Function0;)Lorg/mobilenativefoundation/store/cache5/CacheBuilder;
public final fun weigher (JLkotlin/jvm/functions/Function2;)Lorg/mobilenativefoundation/store/cache5/CacheBuilder;
}

public final class org/mobilenativefoundation/store/cache5/CacheBuilder$Companion {
}

public final class org/mobilenativefoundation/store/cache5/StoreMultiCache : org/mobilenativefoundation/store/cache5/Cache {
public static final field Companion Lorg/mobilenativefoundation/store/cache5/StoreMultiCache$Companion;
public fun <init> (Lorg/mobilenativefoundation/store/core5/KeyProvider;Lorg/mobilenativefoundation/store/cache5/Cache;Lorg/mobilenativefoundation/store/cache5/Cache;)V
public synthetic fun <init> (Lorg/mobilenativefoundation/store/core5/KeyProvider;Lorg/mobilenativefoundation/store/cache5/Cache;Lorg/mobilenativefoundation/store/cache5/Cache;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun getAllPresent ()Ljava/util/Map;
public fun getAllPresent (Ljava/util/List;)Ljava/util/Map;
public synthetic fun getIfPresent (Ljava/lang/Object;)Ljava/lang/Object;
public fun getIfPresent (Lorg/mobilenativefoundation/store/core5/StoreKey;)Lorg/mobilenativefoundation/store/core5/StoreData;
public synthetic fun getOrPut (Ljava/lang/Object;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public fun getOrPut (Lorg/mobilenativefoundation/store/core5/StoreKey;Lkotlin/jvm/functions/Function0;)Lorg/mobilenativefoundation/store/core5/StoreData;
public synthetic fun invalidate (Ljava/lang/Object;)V
public fun invalidate (Lorg/mobilenativefoundation/store/core5/StoreKey;)V
public fun invalidateAll ()V
public fun invalidateAll (Ljava/util/List;)V
public synthetic fun put (Ljava/lang/Object;Ljava/lang/Object;)V
public fun put (Lorg/mobilenativefoundation/store/core5/StoreKey;Lorg/mobilenativefoundation/store/core5/StoreData;)V
public fun putAll (Ljava/util/Map;)V
public fun size ()J
}

public final class org/mobilenativefoundation/store/cache5/StoreMultiCache$Companion {
public final fun invalidKeyErrorMessage (Ljava/lang/Object;)Ljava/lang/String;
}

public final class org/mobilenativefoundation/store/cache5/StoreMultiCacheAccessor {
public fun <init> (Lorg/mobilenativefoundation/store/cache5/Cache;Lorg/mobilenativefoundation/store/cache5/Cache;)V
public final fun getAllPresent ()Ljava/util/Map;
public final fun getCollection (Lorg/mobilenativefoundation/store/core5/StoreKey$Collection;)Lorg/mobilenativefoundation/store/core5/StoreData$Collection;
public final fun getSingle (Lorg/mobilenativefoundation/store/core5/StoreKey$Single;)Lorg/mobilenativefoundation/store/core5/StoreData$Single;
public final fun invalidateAll ()V
public final fun invalidateCollection (Lorg/mobilenativefoundation/store/core5/StoreKey$Collection;)Z
public final fun invalidateSingle (Lorg/mobilenativefoundation/store/core5/StoreKey$Single;)Z
public final fun putCollection (Lorg/mobilenativefoundation/store/core5/StoreKey$Collection;Lorg/mobilenativefoundation/store/core5/StoreData$Collection;)Z
public final fun putSingle (Lorg/mobilenativefoundation/store/core5/StoreKey$Single;Lorg/mobilenativefoundation/store/core5/StoreData$Single;)Z
public final fun size ()J
}

69 changes: 69 additions & 0 deletions cache/api/jvm/cache.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
public abstract interface class org/mobilenativefoundation/store/cache5/Cache {
public abstract 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;
public abstract fun invalidate (Ljava/lang/Object;)V
public abstract fun invalidateAll ()V
public abstract fun invalidateAll (Ljava/util/List;)V
public abstract fun put (Ljava/lang/Object;Ljava/lang/Object;)V
public abstract fun putAll (Ljava/util/Map;)V
public abstract fun size ()J
}

public final class org/mobilenativefoundation/store/cache5/Cache$DefaultImpls {
public static fun getAllPresent (Lorg/mobilenativefoundation/store/cache5/Cache;)Ljava/util/Map;
}

public final class org/mobilenativefoundation/store/cache5/CacheBuilder {
public static final field Companion Lorg/mobilenativefoundation/store/cache5/CacheBuilder$Companion;
public fun <init> ()V
public final fun build ()Lorg/mobilenativefoundation/store/cache5/Cache;
public final fun concurrencyLevel (Lkotlin/jvm/functions/Function0;)Lorg/mobilenativefoundation/store/cache5/CacheBuilder;
public final fun expireAfterAccess-LRDsOJo (J)Lorg/mobilenativefoundation/store/cache5/CacheBuilder;
public final fun expireAfterWrite-LRDsOJo (J)Lorg/mobilenativefoundation/store/cache5/CacheBuilder;
public final fun maximumSize (J)Lorg/mobilenativefoundation/store/cache5/CacheBuilder;
public final fun ticker (Lkotlin/jvm/functions/Function0;)Lorg/mobilenativefoundation/store/cache5/CacheBuilder;
public final fun weigher (JLkotlin/jvm/functions/Function2;)Lorg/mobilenativefoundation/store/cache5/CacheBuilder;
}

public final class org/mobilenativefoundation/store/cache5/CacheBuilder$Companion {
}

public final class org/mobilenativefoundation/store/cache5/StoreMultiCache : org/mobilenativefoundation/store/cache5/Cache {
public static final field Companion Lorg/mobilenativefoundation/store/cache5/StoreMultiCache$Companion;
public fun <init> (Lorg/mobilenativefoundation/store/core5/KeyProvider;Lorg/mobilenativefoundation/store/cache5/Cache;Lorg/mobilenativefoundation/store/cache5/Cache;)V
public synthetic fun <init> (Lorg/mobilenativefoundation/store/core5/KeyProvider;Lorg/mobilenativefoundation/store/cache5/Cache;Lorg/mobilenativefoundation/store/cache5/Cache;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun getAllPresent ()Ljava/util/Map;
public fun getAllPresent (Ljava/util/List;)Ljava/util/Map;
public synthetic fun getIfPresent (Ljava/lang/Object;)Ljava/lang/Object;
public fun getIfPresent (Lorg/mobilenativefoundation/store/core5/StoreKey;)Lorg/mobilenativefoundation/store/core5/StoreData;
public synthetic fun getOrPut (Ljava/lang/Object;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public fun getOrPut (Lorg/mobilenativefoundation/store/core5/StoreKey;Lkotlin/jvm/functions/Function0;)Lorg/mobilenativefoundation/store/core5/StoreData;
public synthetic fun invalidate (Ljava/lang/Object;)V
public fun invalidate (Lorg/mobilenativefoundation/store/core5/StoreKey;)V
public fun invalidateAll ()V
public fun invalidateAll (Ljava/util/List;)V
public synthetic fun put (Ljava/lang/Object;Ljava/lang/Object;)V
public fun put (Lorg/mobilenativefoundation/store/core5/StoreKey;Lorg/mobilenativefoundation/store/core5/StoreData;)V
public fun putAll (Ljava/util/Map;)V
public fun size ()J
}

public final class org/mobilenativefoundation/store/cache5/StoreMultiCache$Companion {
public final fun invalidKeyErrorMessage (Ljava/lang/Object;)Ljava/lang/String;
}

public final class org/mobilenativefoundation/store/cache5/StoreMultiCacheAccessor {
public fun <init> (Lorg/mobilenativefoundation/store/cache5/Cache;Lorg/mobilenativefoundation/store/cache5/Cache;)V
public final fun getAllPresent ()Ljava/util/Map;
public final fun getCollection (Lorg/mobilenativefoundation/store/core5/StoreKey$Collection;)Lorg/mobilenativefoundation/store/core5/StoreData$Collection;
public final fun getSingle (Lorg/mobilenativefoundation/store/core5/StoreKey$Single;)Lorg/mobilenativefoundation/store/core5/StoreData$Single;
public final fun invalidateAll ()V
public final fun invalidateCollection (Lorg/mobilenativefoundation/store/core5/StoreKey$Collection;)Z
public final fun invalidateSingle (Lorg/mobilenativefoundation/store/core5/StoreKey$Single;)Z
public final fun putCollection (Lorg/mobilenativefoundation/store/core5/StoreKey$Collection;Lorg/mobilenativefoundation/store/core5/StoreData$Collection;)Z
public final fun putSingle (Lorg/mobilenativefoundation/store/core5/StoreKey$Single;Lorg/mobilenativefoundation/store/core5/StoreData$Single;)Z
public final fun size ()J
}

102 changes: 4 additions & 98 deletions cache/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,127 +1,33 @@
@file:Suppress("UnstableApiUsage")

import com.vanniktech.maven.publish.SonatypeHost.S01
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
kotlin("multiplatform")
kotlin("plugin.serialization")
id("com.android.library")
id("com.vanniktech.maven.publish")
id("org.jetbrains.dokka")
id("org.jetbrains.kotlinx.kover")
`maven-publish`
kotlin("native.cocoapods")
id("kotlinx-atomicfu")
id("org.mobilenativefoundation.store.multiplatform")
}

kotlin {
android()
jvm()
iosArm64()
iosX64()
linuxX64()
iosSimulatorArm64()
js {
browser()
nodejs()
}

@OptIn(ExperimentalWasmDsl::class)
wasmJs {
nodejs()
}
cocoapods {
summary = "Cache5"
homepage = "https://github.com/MobileNativeFoundation/Store"
ios.deploymentTarget = "13"
version = libs.versions.store.get()
}

sourceSets {
all {
languageSettings.apply {
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
optIn("kotlin.RequiresOptIn")
}
}

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

val jvmMain by getting
val androidMain by getting
val nativeMain by creating {
dependsOn(commonMain)
}
}

jvmToolchain(17)
}

android {
namespace = "org.mobilenativefoundation.store.cache5"

sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
compileSdk = 33

defaultConfig {
minSdk = 24
targetSdk = 33
}

lint {
disable += "ComposableModifierFactory"
disable += "ModifierFactoryExtensionFunction"
disable += "ModifierFactoryReturnType"
disable += "ModifierFactoryUnreferencedReceiver"
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}

tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets.configureEach {
reportUndocumented.set(false)
skipDeprecated.set(true)
jdkVersion.set(17)
}
}

mavenPublishing {
publishToMavenCentral(S01)
signAllPublications()
}

koverMerged {
enable()

xmlReport {
onCheck.set(true)
reportFile.set(layout.projectDirectory.file("kover/coverage.xml"))
}

htmlReport {
onCheck.set(true)
reportDir.set(layout.projectDirectory.dir("kover/html"))
}

verify {
onCheck.set(true)
}
namespace = "org.mobilenativefoundation.store.cache"
}
69 changes: 69 additions & 0 deletions core/api/android/core.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
public abstract interface annotation class org/mobilenativefoundation/store/core5/ExperimentalStoreApi : java/lang/annotation/Annotation {
}

public final class org/mobilenativefoundation/store/core5/InsertionStrategy : java/lang/Enum {
public static final field APPEND Lorg/mobilenativefoundation/store/core5/InsertionStrategy;
public static final field PREPEND Lorg/mobilenativefoundation/store/core5/InsertionStrategy;
public static final field REPLACE Lorg/mobilenativefoundation/store/core5/InsertionStrategy;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static fun valueOf (Ljava/lang/String;)Lorg/mobilenativefoundation/store/core5/InsertionStrategy;
public static fun values ()[Lorg/mobilenativefoundation/store/core5/InsertionStrategy;
}

public abstract interface class org/mobilenativefoundation/store/core5/KeyProvider {
public abstract fun fromCollection (Lorg/mobilenativefoundation/store/core5/StoreKey$Collection;Lorg/mobilenativefoundation/store/core5/StoreData$Single;)Lorg/mobilenativefoundation/store/core5/StoreKey$Single;
public abstract fun fromSingle (Lorg/mobilenativefoundation/store/core5/StoreKey$Single;Lorg/mobilenativefoundation/store/core5/StoreData$Single;)Lorg/mobilenativefoundation/store/core5/StoreKey$Collection;
}

public abstract interface class org/mobilenativefoundation/store/core5/StoreData {
}

public abstract interface class org/mobilenativefoundation/store/core5/StoreData$Collection : org/mobilenativefoundation/store/core5/StoreData {
public abstract fun copyWith (Ljava/util/List;)Lorg/mobilenativefoundation/store/core5/StoreData$Collection;
public abstract fun getItems ()Ljava/util/List;
public abstract fun insertItems (Lorg/mobilenativefoundation/store/core5/InsertionStrategy;Ljava/util/List;)Lorg/mobilenativefoundation/store/core5/StoreData$Collection;
}

public abstract interface class org/mobilenativefoundation/store/core5/StoreData$Single : org/mobilenativefoundation/store/core5/StoreData {
public abstract fun getId ()Ljava/lang/Object;
}

public abstract interface class org/mobilenativefoundation/store/core5/StoreKey {
}

public abstract interface class org/mobilenativefoundation/store/core5/StoreKey$Collection : org/mobilenativefoundation/store/core5/StoreKey {
public abstract fun getInsertionStrategy ()Lorg/mobilenativefoundation/store/core5/InsertionStrategy;
}

public abstract interface class org/mobilenativefoundation/store/core5/StoreKey$Collection$Cursor : org/mobilenativefoundation/store/core5/StoreKey$Collection {
public abstract fun getCursor ()Ljava/lang/Object;
public abstract fun getFilters ()Ljava/util/List;
public abstract fun getSize ()I
public abstract fun getSort ()Lorg/mobilenativefoundation/store/core5/StoreKey$Sort;
}

public abstract interface class org/mobilenativefoundation/store/core5/StoreKey$Collection$Page : org/mobilenativefoundation/store/core5/StoreKey$Collection {
public abstract fun getFilters ()Ljava/util/List;
public abstract fun getPage ()I
public abstract fun getSize ()I
public abstract fun getSort ()Lorg/mobilenativefoundation/store/core5/StoreKey$Sort;
}

public abstract interface class org/mobilenativefoundation/store/core5/StoreKey$Filter {
public abstract fun invoke (Ljava/util/List;)Ljava/util/List;
}

public abstract interface class org/mobilenativefoundation/store/core5/StoreKey$Single : org/mobilenativefoundation/store/core5/StoreKey {
public abstract fun getId ()Ljava/lang/Object;
}

public final class org/mobilenativefoundation/store/core5/StoreKey$Sort : java/lang/Enum {
public static final field ALPHABETICAL Lorg/mobilenativefoundation/store/core5/StoreKey$Sort;
public static final field NEWEST Lorg/mobilenativefoundation/store/core5/StoreKey$Sort;
public static final field OLDEST Lorg/mobilenativefoundation/store/core5/StoreKey$Sort;
public static final field REVERSE_ALPHABETICAL Lorg/mobilenativefoundation/store/core5/StoreKey$Sort;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static fun valueOf (Ljava/lang/String;)Lorg/mobilenativefoundation/store/core5/StoreKey$Sort;
public static fun values ()[Lorg/mobilenativefoundation/store/core5/StoreKey$Sort;
}

Loading
Loading