Skip to content

Commit

Permalink
Setup public api verification (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
VladislavSumin authored Jan 3, 2025
1 parent 73b08c0 commit 6864db7
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,27 @@ jobs:
with:
gradle_command: test allTests

check-api:
name: Check public api
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Setup java
uses: ./.github/actions/setup_java

- name: Gradle cache
uses: ./.github/actions/gradle_cache
with:
key: "check-api"

- name: Run gradle
uses: ./.github/actions/run_gradle
with:
gradle_command: apiCheck

assemble:
name: Assemble
runs-on: ubuntu-24.04
Expand Down
1 change: 1 addition & 0 deletions build-scripts/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencies {
implementation(files(vsCoreLibs.javaClass.superclass.protectionDomain.codeSource.location))

implementation(vsCoreLibs.gradlePlugins.kotlin.core)
implementation(vsCoreLibs.gradlePlugins.kotlin.binaryValidator)
implementation(vsCoreLibs.gradlePlugins.android)
implementation(vsCoreLibs.gradlePlugins.detekt)
implementation(vsCoreLibs.gradlePlugins.checkUpdates)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package ru.vladislavsumin.convention.analyze

/**
* Стандартные настройки проверки бинарной совместимости публичного апи.
*/

plugins {
id("org.jetbrains.kotlinx.binary-compatibility-validator")
}
31 changes: 31 additions & 0 deletions core/decompose/components/api/android/components.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
public abstract class ru/vladislavsumin/core/decompose/components/Component : com/arkivanov/decompose/ComponentContext {
public fun <init> (Lcom/arkivanov/decompose/ComponentContext;)V
protected final fun asValue (Lkotlinx/coroutines/flow/StateFlow;)Lcom/arkivanov/decompose/value/Value;
public fun getBackHandler ()Lcom/arkivanov/essenty/backhandler/BackHandler;
public fun getComponentContextFactory ()Lcom/arkivanov/decompose/ComponentContextFactory;
public fun getInstanceKeeper ()Lcom/arkivanov/essenty/instancekeeper/InstanceKeeper;
public fun getLifecycle ()Lcom/arkivanov/essenty/lifecycle/Lifecycle;
public fun getStateKeeper ()Lcom/arkivanov/essenty/statekeeper/StateKeeper;
protected final fun launch (Lkotlin/coroutines/CoroutineContext;Lkotlinx/coroutines/CoroutineStart;Lkotlin/jvm/functions/Function2;)V
public static synthetic fun launch$default (Lru/vladislavsumin/core/decompose/components/Component;Lkotlin/coroutines/CoroutineContext;Lkotlinx/coroutines/CoroutineStart;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)V
protected fun viewModel (Lkotlin/jvm/functions/Function0;)Lru/vladislavsumin/core/decompose/components/ViewModel;
}

public abstract class ru/vladislavsumin/core/decompose/components/ViewModel {
public fun <init> ()V
public final fun getStateKeeper ()Lcom/arkivanov/essenty/statekeeper/StateKeeper;
protected final fun launch (Lkotlin/coroutines/CoroutineContext;Lkotlinx/coroutines/CoroutineStart;Lkotlin/jvm/functions/Function2;)V
public static synthetic fun launch$default (Lru/vladislavsumin/core/decompose/components/ViewModel;Lkotlin/coroutines/CoroutineContext;Lkotlinx/coroutines/CoroutineStart;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)V
protected final fun stateIn (Lkotlinx/coroutines/flow/Flow;Ljava/lang/Object;Lkotlinx/coroutines/flow/SharingStarted;)Lkotlinx/coroutines/flow/StateFlow;
public static synthetic fun stateIn$default (Lru/vladislavsumin/core/decompose/components/ViewModel;Lkotlinx/coroutines/flow/Flow;Ljava/lang/Object;Lkotlinx/coroutines/flow/SharingStarted;ILjava/lang/Object;)Lkotlinx/coroutines/flow/StateFlow;
}

public final class ru/vladislavsumin/core/decompose/components/utils/FlowUtilsKt {
public static final fun asValue (Lkotlinx/coroutines/flow/StateFlow;Lkotlinx/coroutines/CoroutineScope;)Lcom/arkivanov/decompose/value/Value;
}

public final class ru/vladislavsumin/core/decompose/components/utils/LifecycleCoroutineScopeKt {
public static final fun createCoroutineScope (Lcom/arkivanov/essenty/lifecycle/Lifecycle;Lkotlin/coroutines/CoroutineContext;)Lkotlinx/coroutines/CoroutineScope;
public static synthetic fun createCoroutineScope$default (Lcom/arkivanov/essenty/lifecycle/Lifecycle;Lkotlin/coroutines/CoroutineContext;ILjava/lang/Object;)Lkotlinx/coroutines/CoroutineScope;
}

31 changes: 31 additions & 0 deletions core/decompose/components/api/jvm/components.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
public abstract class ru/vladislavsumin/core/decompose/components/Component : com/arkivanov/decompose/ComponentContext {
public fun <init> (Lcom/arkivanov/decompose/ComponentContext;)V
protected final fun asValue (Lkotlinx/coroutines/flow/StateFlow;)Lcom/arkivanov/decompose/value/Value;
public fun getBackHandler ()Lcom/arkivanov/essenty/backhandler/BackHandler;
public fun getComponentContextFactory ()Lcom/arkivanov/decompose/ComponentContextFactory;
public fun getInstanceKeeper ()Lcom/arkivanov/essenty/instancekeeper/InstanceKeeper;
public fun getLifecycle ()Lcom/arkivanov/essenty/lifecycle/Lifecycle;
public fun getStateKeeper ()Lcom/arkivanov/essenty/statekeeper/StateKeeper;
protected final fun launch (Lkotlin/coroutines/CoroutineContext;Lkotlinx/coroutines/CoroutineStart;Lkotlin/jvm/functions/Function2;)V
public static synthetic fun launch$default (Lru/vladislavsumin/core/decompose/components/Component;Lkotlin/coroutines/CoroutineContext;Lkotlinx/coroutines/CoroutineStart;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)V
protected fun viewModel (Lkotlin/jvm/functions/Function0;)Lru/vladislavsumin/core/decompose/components/ViewModel;
}

public abstract class ru/vladislavsumin/core/decompose/components/ViewModel {
public fun <init> ()V
public final fun getStateKeeper ()Lcom/arkivanov/essenty/statekeeper/StateKeeper;
protected final fun launch (Lkotlin/coroutines/CoroutineContext;Lkotlinx/coroutines/CoroutineStart;Lkotlin/jvm/functions/Function2;)V
public static synthetic fun launch$default (Lru/vladislavsumin/core/decompose/components/ViewModel;Lkotlin/coroutines/CoroutineContext;Lkotlinx/coroutines/CoroutineStart;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)V
protected final fun stateIn (Lkotlinx/coroutines/flow/Flow;Ljava/lang/Object;Lkotlinx/coroutines/flow/SharingStarted;)Lkotlinx/coroutines/flow/StateFlow;
public static synthetic fun stateIn$default (Lru/vladislavsumin/core/decompose/components/ViewModel;Lkotlinx/coroutines/flow/Flow;Ljava/lang/Object;Lkotlinx/coroutines/flow/SharingStarted;ILjava/lang/Object;)Lkotlinx/coroutines/flow/StateFlow;
}

public final class ru/vladislavsumin/core/decompose/components/utils/FlowUtilsKt {
public static final fun asValue (Lkotlinx/coroutines/flow/StateFlow;Lkotlinx/coroutines/CoroutineScope;)Lcom/arkivanov/decompose/value/Value;
}

public final class ru/vladislavsumin/core/decompose/components/utils/LifecycleCoroutineScopeKt {
public static final fun createCoroutineScope (Lcom/arkivanov/essenty/lifecycle/Lifecycle;Lkotlin/coroutines/CoroutineContext;)Lkotlinx/coroutines/CoroutineScope;
public static synthetic fun createCoroutineScope$default (Lcom/arkivanov/essenty/lifecycle/Lifecycle;Lkotlin/coroutines/CoroutineContext;ILjava/lang/Object;)Lkotlinx/coroutines/CoroutineScope;
}

1 change: 1 addition & 0 deletions core/decompose/components/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id("ru.vladislavsumin.convention.kmp.js")
id("ru.vladislavsumin.convention.kmp.jvm")
id("ru.vladislavsumin.convention.publication.sonatype")
id("ru.vladislavsumin.convention.analyze.binary-validator")
`maven-publish`
}

Expand Down
2 changes: 2 additions & 0 deletions libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
kotlin-core = "2.1.0"
kotlin-coroutines = "1.10.1"
kotlin-serialization = "1.7.3"
kotlin-binaryValidator = "0.17.0"

gradlePlugins-android = "8.7.3"
gradlePlugins-detekt = "1.23.7"
Expand All @@ -14,6 +15,7 @@ decompose = "3.2.2"

# Gradle Plugins
gradlePlugins-kotlin-core = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin-core" }
gradlePlugins-kotlin-binaryValidator = { module = "org.jetbrains.kotlinx:binary-compatibility-validator", version.ref = "kotlin-binaryValidator" }
gradlePlugins-android = { module = "com.android.tools.build:gradle", version.ref = "gradlePlugins-android" }
gradlePlugins-detekt = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "gradlePlugins-detekt" }
gradlePlugins-checkUpdates = { module = "com.github.ben-manes:gradle-versions-plugin", version.ref = "gradlePlugins-checkUpdates" }
Expand Down

0 comments on commit 6864db7

Please sign in to comment.