Skip to content

Commit

Permalink
Merge pull request #21 from skydoves/kmp
Browse files Browse the repository at this point in the history
Support KMP
  • Loading branch information
skydoves authored Oct 15, 2024
2 parents 88d74b9 + d3c93d5 commit 07e9852
Show file tree
Hide file tree
Showing 24 changed files with 208 additions and 76 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
lint:
name: Spotless check
runs-on: ubuntu-latest
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v2
Expand All @@ -23,7 +23,7 @@ jobs:

api_check:
name: API check
runs-on: ubuntu-latest
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v2
Expand All @@ -36,7 +36,7 @@ jobs:
run: ./gradlew apiCheck

build:
runs-on: ubuntu-latest
runs-on: macos-latest
steps:
- uses: actions/checkout@v2

Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/publish-snapshot.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
publish:
name: Snapshot build and publish
runs-on: ubuntu-latest
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v3.1.0
Expand Down
Binary file not shown.
5 changes: 1 addition & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
plugins {
id(libs.plugins.android.application.get().pluginId)
id(libs.plugins.kotlin.android.get().pluginId)
id(libs.plugins.compose.compiler.get().pluginId)
}

android {
Expand Down Expand Up @@ -30,10 +31,6 @@ android {
jvmTarget = libs.versions.jvmTarget.get()
}

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.androidxComposeCompiler.get()
}

packaging {
resources {
excludes.add("/META-INF/{AL2.0,LGPL2.1}")
Expand Down
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ plugins {
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.binary.compatibility) apply false
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.nexus.plugin)
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ android.defaults.buildfeatures.shaders=false
# https://developer.android.com/studio/releases/gradle-plugin#4.1-nontransitive-r-class
android.nonTransitiveRClass=true

## Maven Central Publication ##
# Required to publish to Nexus (see https://github.com/gradle/gradle/issues/11308)
systemProp.org.gradle.internal.publish.checksums.insecure=true

# Increase timeout when pushing to Sonatype (otherwise we get timeouts)
systemProp.org.gradle.internal.http.socketTimeout=120000


POM_URL=https://github.com/skydoves/whatif/
POM_SCM_URL=https://github.com/skydoves/whatif/
POM_SCM_CONNECTION=scm:git:git://github.com/skydoves/whatif.git
Expand Down
23 changes: 12 additions & 11 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
[versions]
agp = "8.1.2"
kotlin = "1.9.10"
agp = "8.6.1"
kotlin = "2.0.21"
dokka = "1.9.0"
nexusPlugin = "0.25.3"
kotlinBinaryCompatibility = "0.13.1"
nexusPlugin = "0.26.0"
kotlinBinaryCompatibility = "0.16.3"
jvmTarget = "11"
material = "1.10.0"
androidxActivity = "1.8.0"
androidxAppCompat = "1.6.1"
androidxCompose = "1.5.3"
androidxComposeCompiler = "1.5.3"
landscapist = "2.2.10"
material = "1.12.0"
androidxActivity = "1.9.2"
androidxAppCompat = "1.7.0"
androidxCompose = "1.7.3"
landscapist = "2.4.1"
coroutines = "1.7.3"
retrofit = "2.9.0"
retrofitAdapters = "1.0.9"
robolectric = "4.10.3"
robolectric = "4.12.1"
spotless = "6.19.0"

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
nexus-plugin = { id = "com.vanniktech.maven.publish", version.ref = "nexusPlugin" }
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
Expand Down
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Tue Oct 15 22:13:09 KST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 0 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ pluginManagement {
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
Expand Down
62 changes: 62 additions & 0 deletions whatif/api/android/whatif.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
public final class com/skydoves/whatif/WhatIfArrayKt {
public static final synthetic fun whatIfNotNullOrEmpty ([BLkotlin/jvm/functions/Function1;)[B
public static final synthetic fun whatIfNotNullOrEmpty ([BLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)[B
public static final synthetic fun whatIfNotNullOrEmpty ([CLkotlin/jvm/functions/Function1;)[C
public static final synthetic fun whatIfNotNullOrEmpty ([CLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)[C
public static final synthetic fun whatIfNotNullOrEmpty ([DLkotlin/jvm/functions/Function1;)[D
public static final synthetic fun whatIfNotNullOrEmpty ([DLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)[D
public static final synthetic fun whatIfNotNullOrEmpty ([FLkotlin/jvm/functions/Function1;)[F
public static final synthetic fun whatIfNotNullOrEmpty ([FLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)[F
public static final synthetic fun whatIfNotNullOrEmpty ([ILkotlin/jvm/functions/Function1;)[I
public static final synthetic fun whatIfNotNullOrEmpty ([ILkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)[I
public static final synthetic fun whatIfNotNullOrEmpty ([JLkotlin/jvm/functions/Function1;)[J
public static final synthetic fun whatIfNotNullOrEmpty ([JLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)[J
public static final synthetic fun whatIfNotNullOrEmpty ([Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)[Ljava/lang/Object;
public static final synthetic fun whatIfNotNullOrEmpty ([Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)[Ljava/lang/Object;
public static final synthetic fun whatIfNotNullOrEmpty ([SLkotlin/jvm/functions/Function1;)[S
public static final synthetic fun whatIfNotNullOrEmpty ([SLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)[S
public static final synthetic fun whatIfNotNullOrEmpty ([ZLkotlin/jvm/functions/Function1;)[Z
public static final synthetic fun whatIfNotNullOrEmpty ([ZLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)[Z
}

public final class com/skydoves/whatif/WhatIfCollectionsKt {
public static final synthetic fun whatIfAnd (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function0;)Ljava/lang/Iterable;
public static final synthetic fun whatIfAnd (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;)Ljava/lang/Iterable;
public static final synthetic fun whatIfNotNullOrEmpty (Ljava/util/List;Lkotlin/jvm/functions/Function1;)Ljava/util/List;
public static final synthetic fun whatIfNotNullOrEmpty (Ljava/util/List;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)Ljava/util/List;
public static final synthetic fun whatIfNotNullOrEmpty (Ljava/util/Map;Lkotlin/jvm/functions/Function1;)Ljava/util/Map;
public static final synthetic fun whatIfNotNullOrEmpty (Ljava/util/Map;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)Ljava/util/Map;
public static final synthetic fun whatIfNotNullOrEmpty (Ljava/util/Set;Lkotlin/jvm/functions/Function1;)Ljava/util/Set;
public static final synthetic fun whatIfNotNullOrEmpty (Ljava/util/Set;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)Ljava/util/Set;
public static final synthetic fun whatIfOr (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function0;)Ljava/lang/Iterable;
public static final synthetic fun whatIfOr (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;)Ljava/lang/Iterable;
}

public final class com/skydoves/whatif/WhatIfKt {
public static final synthetic fun whatIf (Ljava/lang/Boolean;Lkotlin/jvm/functions/Function0;)Ljava/lang/Boolean;
public static final synthetic fun whatIf (Ljava/lang/Boolean;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;)Ljava/lang/Boolean;
public static final synthetic fun whatIf (Ljava/lang/Object;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIf (Ljava/lang/Object;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIf (Ljava/lang/Object;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIf (Ljava/lang/Object;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIf (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public static final synthetic fun whatIf (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public static final synthetic fun whatIfAnd (Ljava/lang/Boolean;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function0;)Ljava/lang/Boolean;
public static final synthetic fun whatIfElse (Ljava/lang/Boolean;Lkotlin/jvm/functions/Function0;)Ljava/lang/Boolean;
public static final synthetic fun whatIfLet (Ljava/lang/Object;Ljava/lang/Boolean;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIfLet (Ljava/lang/Object;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIfMap (Ljava/lang/Object;Ljava/lang/Boolean;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIfMap (Ljava/lang/Object;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIfMap (Ljava/lang/Object;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIfMap (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIfNotNull (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIfNotNull (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public static final synthetic fun whatIfNotNullWith (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIfOr (Ljava/lang/Boolean;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function0;)Ljava/lang/Boolean;
}

public final class com/skydoves/whatif/WhatIfStringKt {
public static final synthetic fun whatIfNotNullOrEmpty (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Ljava/lang/String;
public static final synthetic fun whatIfNotNullOrEmpty (Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)Ljava/lang/String;
}

62 changes: 62 additions & 0 deletions whatif/api/jvm/whatif.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
public final class com/skydoves/whatif/WhatIfArrayKt {
public static final synthetic fun whatIfNotNullOrEmpty ([BLkotlin/jvm/functions/Function1;)[B
public static final synthetic fun whatIfNotNullOrEmpty ([BLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)[B
public static final synthetic fun whatIfNotNullOrEmpty ([CLkotlin/jvm/functions/Function1;)[C
public static final synthetic fun whatIfNotNullOrEmpty ([CLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)[C
public static final synthetic fun whatIfNotNullOrEmpty ([DLkotlin/jvm/functions/Function1;)[D
public static final synthetic fun whatIfNotNullOrEmpty ([DLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)[D
public static final synthetic fun whatIfNotNullOrEmpty ([FLkotlin/jvm/functions/Function1;)[F
public static final synthetic fun whatIfNotNullOrEmpty ([FLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)[F
public static final synthetic fun whatIfNotNullOrEmpty ([ILkotlin/jvm/functions/Function1;)[I
public static final synthetic fun whatIfNotNullOrEmpty ([ILkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)[I
public static final synthetic fun whatIfNotNullOrEmpty ([JLkotlin/jvm/functions/Function1;)[J
public static final synthetic fun whatIfNotNullOrEmpty ([JLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)[J
public static final synthetic fun whatIfNotNullOrEmpty ([Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)[Ljava/lang/Object;
public static final synthetic fun whatIfNotNullOrEmpty ([Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)[Ljava/lang/Object;
public static final synthetic fun whatIfNotNullOrEmpty ([SLkotlin/jvm/functions/Function1;)[S
public static final synthetic fun whatIfNotNullOrEmpty ([SLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)[S
public static final synthetic fun whatIfNotNullOrEmpty ([ZLkotlin/jvm/functions/Function1;)[Z
public static final synthetic fun whatIfNotNullOrEmpty ([ZLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)[Z
}

public final class com/skydoves/whatif/WhatIfCollectionsKt {
public static final synthetic fun whatIfAnd (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function0;)Ljava/lang/Iterable;
public static final synthetic fun whatIfAnd (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;)Ljava/lang/Iterable;
public static final synthetic fun whatIfNotNullOrEmpty (Ljava/util/List;Lkotlin/jvm/functions/Function1;)Ljava/util/List;
public static final synthetic fun whatIfNotNullOrEmpty (Ljava/util/List;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)Ljava/util/List;
public static final synthetic fun whatIfNotNullOrEmpty (Ljava/util/Map;Lkotlin/jvm/functions/Function1;)Ljava/util/Map;
public static final synthetic fun whatIfNotNullOrEmpty (Ljava/util/Map;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)Ljava/util/Map;
public static final synthetic fun whatIfNotNullOrEmpty (Ljava/util/Set;Lkotlin/jvm/functions/Function1;)Ljava/util/Set;
public static final synthetic fun whatIfNotNullOrEmpty (Ljava/util/Set;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)Ljava/util/Set;
public static final synthetic fun whatIfOr (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function0;)Ljava/lang/Iterable;
public static final synthetic fun whatIfOr (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;)Ljava/lang/Iterable;
}

public final class com/skydoves/whatif/WhatIfKt {
public static final synthetic fun whatIf (Ljava/lang/Boolean;Lkotlin/jvm/functions/Function0;)Ljava/lang/Boolean;
public static final synthetic fun whatIf (Ljava/lang/Boolean;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;)Ljava/lang/Boolean;
public static final synthetic fun whatIf (Ljava/lang/Object;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIf (Ljava/lang/Object;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIf (Ljava/lang/Object;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIf (Ljava/lang/Object;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIf (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public static final synthetic fun whatIf (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public static final synthetic fun whatIfAnd (Ljava/lang/Boolean;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function0;)Ljava/lang/Boolean;
public static final synthetic fun whatIfElse (Ljava/lang/Boolean;Lkotlin/jvm/functions/Function0;)Ljava/lang/Boolean;
public static final synthetic fun whatIfLet (Ljava/lang/Object;Ljava/lang/Boolean;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIfLet (Ljava/lang/Object;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIfMap (Ljava/lang/Object;Ljava/lang/Boolean;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIfMap (Ljava/lang/Object;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIfMap (Ljava/lang/Object;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIfMap (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIfNotNull (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIfNotNull (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public static final synthetic fun whatIfNotNullWith (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final synthetic fun whatIfOr (Ljava/lang/Boolean;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function0;)Ljava/lang/Boolean;
}

public final class com/skydoves/whatif/WhatIfStringKt {
public static final synthetic fun whatIfNotNullOrEmpty (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Ljava/lang/String;
public static final synthetic fun whatIfNotNullOrEmpty (Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)Ljava/lang/String;
}

Loading

0 comments on commit 07e9852

Please sign in to comment.