Skip to content

Commit

Permalink
add binary api validation (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
psuzn authored Apr 17, 2024
1 parent a688010 commit c3a42a4
Show file tree
Hide file tree
Showing 12 changed files with 418 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
- name: Lint and Static analysis
run: ./gradlew detekt ktlintCheck --no-daemon --stacktrace

- name: Validate api compatibility
run: ./gradlew apiCheck --no-daemon --stacktrace

- name: Build Artifacts
run: ./gradlew publishToMavenLocal

3 changes: 3 additions & 0 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ jobs:
- name: Tests
run: ./gradlew allTests -x tvosSimulatorArm64Test -x watchosSimulatorArm64Test

- name: Validate api compatibility
run: ./gradlew apiCheck --no-daemon --stacktrace

- name: Mac build
run: |
./gradlew \
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Validate api compatibility
run: ./gradlew apiCheck --no-daemon --stacktrace

- name: Get version name
id: extract_version_name
run: |
Expand Down
1 change: 1 addition & 0 deletions build-logic/src/main/kotlin/PackagingConventionPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class PackagingConventionPlugin : Plugin<Project> {
with(pluginManager) {
apply(libs.plugins.mavenPublish)
apply("signing")
apply(libs.plugins.binaryCompatibilityValidator)
}

configurePublishingMetadata()
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ plugins {
alias(libs.plugins.ktlint) apply false
alias(libs.plugins.detekt) apply false
alias(libs.plugins.mavenPublish) apply false
alias(libs.plugins.binaryCompatibilityValidator) apply false
id("module")
base
}
Expand Down
4 changes: 4 additions & 0 deletions context-provider/api/context-provider.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
public final class me/sujanpoudel/utils/contextProvider/ApplicationContextInitializerKt {
public static final fun getApplicationContext ()Landroid/content/Context;
}

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.startup.Initializer
* Application scoped context for current app session
*/
lateinit var applicationContext: Context
private set

internal class ApplicationContextInitializer : Initializer<Context> {
override fun create(context: Context): Context = context.also {
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ compose = "1.6.1"
klint-plugin = "12.0.3"
mavenPublish = "0.28.0"
detekt = "1.23.6"
binaryCompatibilityValidator = "0.15.0-Beta.2"

# libraries
ktlint = "1.2.1"
Expand Down Expand Up @@ -50,4 +51,5 @@ compose = { id = "org.jetbrains.compose", version.ref = "compose" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "klint-plugin" }
mavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "mavenPublish" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
binaryCompatibilityValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binaryCompatibilityValidator" }

24 changes: 24 additions & 0 deletions multiplatform-paths/api/android/multiplatform-paths.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
public final class me/sujanpoudel/multiplatform/utils/multiplatformPaths/BuildConfig {
public static final field BUILD_TYPE Ljava/lang/String;
public static final field DEBUG Z
public static final field LIBRARY_PACKAGE_NAME Ljava/lang/String;
public fun <init> ()V
}

public final class me/sujanpoudel/utils/paths/DirectoriesKt {
public static final fun appCacheDirectory (Ljava/lang/String;Z)Lkotlinx/io/files/Path;
public static synthetic fun appCacheDirectory$default (Ljava/lang/String;ZILjava/lang/Object;)Lkotlinx/io/files/Path;
public static final fun appDataDirectory (Ljava/lang/String;Z)Lkotlinx/io/files/Path;
public static synthetic fun appDataDirectory$default (Ljava/lang/String;ZILjava/lang/Object;)Lkotlinx/io/files/Path;
}

public final class me/sujanpoudel/utils/paths/Directories_androidKt {
public static final fun cacheDirectory (Ljava/lang/String;)Lkotlinx/io/files/Path;
public static final fun dataDirectory (Ljava/lang/String;)Lkotlinx/io/files/Path;
}

public final class me/sujanpoudel/utils/paths/utils/PathKt {
public static final fun div (Lkotlinx/io/files/Path;Ljava/lang/String;)Lkotlinx/io/files/Path;
public static final fun toPath (Ljava/lang/String;)Lkotlinx/io/files/Path;
}

22 changes: 22 additions & 0 deletions multiplatform-paths/api/desktop/multiplatform-paths.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
public final class me/sujanpoudel/utils/paths/DirectoriesKt {
public static final fun appCacheDirectory (Ljava/lang/String;Z)Lkotlinx/io/files/Path;
public static synthetic fun appCacheDirectory$default (Ljava/lang/String;ZILjava/lang/Object;)Lkotlinx/io/files/Path;
public static final fun appDataDirectory (Ljava/lang/String;Z)Lkotlinx/io/files/Path;
public static synthetic fun appDataDirectory$default (Ljava/lang/String;ZILjava/lang/Object;)Lkotlinx/io/files/Path;
}

public final class me/sujanpoudel/utils/paths/Directories_desktopCommonKt {
public static final fun desktopAppHomeDirectory (Ljava/lang/String;Lme/sujanpoudel/utils/platformIdentifier/Platform$OS;Lkotlin/jvm/functions/Function1;)Lkotlinx/io/files/Path;
public static final fun desktopCacheDirectory (Ljava/lang/String;Lme/sujanpoudel/utils/platformIdentifier/Platform$OS;Lkotlin/jvm/functions/Function1;)Lkotlinx/io/files/Path;
}

public final class me/sujanpoudel/utils/paths/Directories_desktopKt {
public static final fun cacheDirectory (Ljava/lang/String;)Lkotlinx/io/files/Path;
public static final fun dataDirectory (Ljava/lang/String;)Lkotlinx/io/files/Path;
}

public final class me/sujanpoudel/utils/paths/utils/PathKt {
public static final fun div (Lkotlinx/io/files/Path;Ljava/lang/String;)Lkotlinx/io/files/Path;
public static final fun toPath (Ljava/lang/String;)Lkotlinx/io/files/Path;
}

175 changes: 175 additions & 0 deletions platform-identifier/api/android/platform-identifier.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
public final class me/sujanpoudel/multiplatform/utils/platformIdentifier/BuildConfig {
public static final field BUILD_TYPE Ljava/lang/String;
public static final field DEBUG Z
public static final field LIBRARY_PACKAGE_NAME Ljava/lang/String;
public fun <init> ()V
}

public final class me/sujanpoudel/utils/platformIdentifier/Arch : java/lang/Enum {
public static final field ARM_X32 Lme/sujanpoudel/utils/platformIdentifier/Arch;
public static final field ARM_X64 Lme/sujanpoudel/utils/platformIdentifier/Arch;
public static final field UNKNOWN Lme/sujanpoudel/utils/platformIdentifier/Arch;
public static final field X64 Lme/sujanpoudel/utils/platformIdentifier/Arch;
public static final field X86 Lme/sujanpoudel/utils/platformIdentifier/Arch;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static fun valueOf (Ljava/lang/String;)Lme/sujanpoudel/utils/platformIdentifier/Arch;
public static fun values ()[Lme/sujanpoudel/utils/platformIdentifier/Arch;
}

public abstract class me/sujanpoudel/utils/platformIdentifier/Platform {
}

public abstract class me/sujanpoudel/utils/platformIdentifier/Platform$JS : me/sujanpoudel/utils/platformIdentifier/Platform {
}

public final class me/sujanpoudel/utils/platformIdentifier/Platform$JS$Browser : me/sujanpoudel/utils/platformIdentifier/Platform$JS {
public fun <init> (Ljava/lang/String;)V
public final fun component1 ()Ljava/lang/String;
public final fun copy (Ljava/lang/String;)Lme/sujanpoudel/utils/platformIdentifier/Platform$JS$Browser;
public static synthetic fun copy$default (Lme/sujanpoudel/utils/platformIdentifier/Platform$JS$Browser;Ljava/lang/String;ILjava/lang/Object;)Lme/sujanpoudel/utils/platformIdentifier/Platform$JS$Browser;
public fun equals (Ljava/lang/Object;)Z
public final fun getUserAgent ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class me/sujanpoudel/utils/platformIdentifier/Platform$JS$Node : me/sujanpoudel/utils/platformIdentifier/Platform$JS {
public fun <init> (Lme/sujanpoudel/utils/platformIdentifier/Platform$OS;Ljava/lang/String;Ljava/lang/String;)V
public final fun component1 ()Lme/sujanpoudel/utils/platformIdentifier/Platform$OS;
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Ljava/lang/String;
public final fun copy (Lme/sujanpoudel/utils/platformIdentifier/Platform$OS;Ljava/lang/String;Ljava/lang/String;)Lme/sujanpoudel/utils/platformIdentifier/Platform$JS$Node;
public static synthetic fun copy$default (Lme/sujanpoudel/utils/platformIdentifier/Platform$JS$Node;Lme/sujanpoudel/utils/platformIdentifier/Platform$OS;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Lme/sujanpoudel/utils/platformIdentifier/Platform$JS$Node;
public fun equals (Ljava/lang/Object;)Z
public final fun getNodeVersion ()Ljava/lang/String;
public final fun getOs ()Lme/sujanpoudel/utils/platformIdentifier/Platform$OS;
public final fun getV8Version ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public abstract class me/sujanpoudel/utils/platformIdentifier/Platform$OS : me/sujanpoudel/utils/platformIdentifier/Platform {
public synthetic fun <init> (Lme/sujanpoudel/utils/platformIdentifier/Arch;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun getArch ()Lme/sujanpoudel/utils/platformIdentifier/Arch;
}

public final class me/sujanpoudel/utils/platformIdentifier/Platform$OS$Android : me/sujanpoudel/utils/platformIdentifier/Platform$OS {
public fun <init> (Lme/sujanpoudel/utils/platformIdentifier/Arch;ILjava/lang/String;ZZ)V
public final fun component1 ()Lme/sujanpoudel/utils/platformIdentifier/Arch;
public final fun component2 ()I
public final fun component3 ()Ljava/lang/String;
public final fun component4 ()Z
public final fun component5 ()Z
public final fun copy (Lme/sujanpoudel/utils/platformIdentifier/Arch;ILjava/lang/String;ZZ)Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$Android;
public static synthetic fun copy$default (Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$Android;Lme/sujanpoudel/utils/platformIdentifier/Arch;ILjava/lang/String;ZZILjava/lang/Object;)Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$Android;
public fun equals (Ljava/lang/Object;)Z
public final fun getAndroidVersion ()Ljava/lang/String;
public fun getArch ()Lme/sujanpoudel/utils/platformIdentifier/Arch;
public final fun getBuildNumber ()I
public fun hashCode ()I
public final fun isTv ()Z
public final fun isWatch ()Z
public fun toString ()Ljava/lang/String;
}

public final class me/sujanpoudel/utils/platformIdentifier/Platform$OS$IOS : me/sujanpoudel/utils/platformIdentifier/Platform$OS {
public fun <init> (Lme/sujanpoudel/utils/platformIdentifier/Arch;Ljava/lang/String;Z)V
public final fun component1 ()Lme/sujanpoudel/utils/platformIdentifier/Arch;
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Z
public final fun copy (Lme/sujanpoudel/utils/platformIdentifier/Arch;Ljava/lang/String;Z)Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$IOS;
public static synthetic fun copy$default (Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$IOS;Lme/sujanpoudel/utils/platformIdentifier/Arch;Ljava/lang/String;ZILjava/lang/Object;)Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$IOS;
public fun equals (Ljava/lang/Object;)Z
public fun getArch ()Lme/sujanpoudel/utils/platformIdentifier/Arch;
public final fun getVersion ()Ljava/lang/String;
public fun hashCode ()I
public final fun isSimulator ()Z
public fun toString ()Ljava/lang/String;
}

public final class me/sujanpoudel/utils/platformIdentifier/Platform$OS$Linux : me/sujanpoudel/utils/platformIdentifier/Platform$OS {
public fun <init> (Lme/sujanpoudel/utils/platformIdentifier/Arch;Ljava/lang/String;)V
public final fun component1 ()Lme/sujanpoudel/utils/platformIdentifier/Arch;
public final fun component2 ()Ljava/lang/String;
public final fun copy (Lme/sujanpoudel/utils/platformIdentifier/Arch;Ljava/lang/String;)Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$Linux;
public static synthetic fun copy$default (Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$Linux;Lme/sujanpoudel/utils/platformIdentifier/Arch;Ljava/lang/String;ILjava/lang/Object;)Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$Linux;
public fun equals (Ljava/lang/Object;)Z
public fun getArch ()Lme/sujanpoudel/utils/platformIdentifier/Arch;
public final fun getVersion ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class me/sujanpoudel/utils/platformIdentifier/Platform$OS$MacOs : me/sujanpoudel/utils/platformIdentifier/Platform$OS {
public fun <init> (Lme/sujanpoudel/utils/platformIdentifier/Arch;Ljava/lang/String;)V
public final fun component1 ()Lme/sujanpoudel/utils/platformIdentifier/Arch;
public final fun component2 ()Ljava/lang/String;
public final fun copy (Lme/sujanpoudel/utils/platformIdentifier/Arch;Ljava/lang/String;)Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$MacOs;
public static synthetic fun copy$default (Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$MacOs;Lme/sujanpoudel/utils/platformIdentifier/Arch;Ljava/lang/String;ILjava/lang/Object;)Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$MacOs;
public fun equals (Ljava/lang/Object;)Z
public fun getArch ()Lme/sujanpoudel/utils/platformIdentifier/Arch;
public final fun getVersion ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class me/sujanpoudel/utils/platformIdentifier/Platform$OS$TvOs : me/sujanpoudel/utils/platformIdentifier/Platform$OS {
public fun <init> (Lme/sujanpoudel/utils/platformIdentifier/Arch;Ljava/lang/String;Z)V
public final fun component1 ()Lme/sujanpoudel/utils/platformIdentifier/Arch;
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Z
public final fun copy (Lme/sujanpoudel/utils/platformIdentifier/Arch;Ljava/lang/String;Z)Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$TvOs;
public static synthetic fun copy$default (Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$TvOs;Lme/sujanpoudel/utils/platformIdentifier/Arch;Ljava/lang/String;ZILjava/lang/Object;)Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$TvOs;
public fun equals (Ljava/lang/Object;)Z
public fun getArch ()Lme/sujanpoudel/utils/platformIdentifier/Arch;
public final fun getVersion ()Ljava/lang/String;
public fun hashCode ()I
public final fun isSimulator ()Z
public fun toString ()Ljava/lang/String;
}

public final class me/sujanpoudel/utils/platformIdentifier/Platform$OS$Unknown : me/sujanpoudel/utils/platformIdentifier/Platform$OS {
public fun <init> (Lme/sujanpoudel/utils/platformIdentifier/Arch;Ljava/lang/String;)V
public final fun component1 ()Lme/sujanpoudel/utils/platformIdentifier/Arch;
public final fun component2 ()Ljava/lang/String;
public final fun copy (Lme/sujanpoudel/utils/platformIdentifier/Arch;Ljava/lang/String;)Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$Unknown;
public static synthetic fun copy$default (Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$Unknown;Lme/sujanpoudel/utils/platformIdentifier/Arch;Ljava/lang/String;ILjava/lang/Object;)Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$Unknown;
public fun equals (Ljava/lang/Object;)Z
public fun getArch ()Lme/sujanpoudel/utils/platformIdentifier/Arch;
public final fun getVersion ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class me/sujanpoudel/utils/platformIdentifier/Platform$OS$WatchOs : me/sujanpoudel/utils/platformIdentifier/Platform$OS {
public fun <init> (Lme/sujanpoudel/utils/platformIdentifier/Arch;Ljava/lang/String;Z)V
public final fun component1 ()Lme/sujanpoudel/utils/platformIdentifier/Arch;
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Z
public final fun copy (Lme/sujanpoudel/utils/platformIdentifier/Arch;Ljava/lang/String;Z)Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$WatchOs;
public static synthetic fun copy$default (Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$WatchOs;Lme/sujanpoudel/utils/platformIdentifier/Arch;Ljava/lang/String;ZILjava/lang/Object;)Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$WatchOs;
public fun equals (Ljava/lang/Object;)Z
public fun getArch ()Lme/sujanpoudel/utils/platformIdentifier/Arch;
public final fun getVersion ()Ljava/lang/String;
public fun hashCode ()I
public final fun isSimulator ()Z
public fun toString ()Ljava/lang/String;
}

public final class me/sujanpoudel/utils/platformIdentifier/Platform$OS$Windows : me/sujanpoudel/utils/platformIdentifier/Platform$OS {
public fun <init> (Lme/sujanpoudel/utils/platformIdentifier/Arch;Ljava/lang/String;)V
public final fun component1 ()Lme/sujanpoudel/utils/platformIdentifier/Arch;
public final fun component2 ()Ljava/lang/String;
public final fun copy (Lme/sujanpoudel/utils/platformIdentifier/Arch;Ljava/lang/String;)Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$Windows;
public static synthetic fun copy$default (Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$Windows;Lme/sujanpoudel/utils/platformIdentifier/Arch;Ljava/lang/String;ILjava/lang/Object;)Lme/sujanpoudel/utils/platformIdentifier/Platform$OS$Windows;
public fun equals (Ljava/lang/Object;)Z
public fun getArch ()Lme/sujanpoudel/utils/platformIdentifier/Arch;
public final fun getVersion ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class me/sujanpoudel/utils/platformIdentifier/Platform_androidKt {
public static final fun platform ()Lme/sujanpoudel/utils/platformIdentifier/Platform;
}

Loading

0 comments on commit c3a42a4

Please sign in to comment.