-
-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #913 from aSemy/fix/de-duplicate-valueclasssupport
De-duplicate `ValueClassSupport`
- Loading branch information
Showing
24 changed files
with
113 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 0 additions & 68 deletions
68
modules/mockk-agent-android/src/main/kotlin/io/mockk/ValueClassSupportAndroid.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 0 additions & 68 deletions
68
modules/mockk-agent/src/jvmMain/kotlin/io/mockk/ValueClassSupport.kt
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/advice/Interceptor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
public final class io/mockk/core/ValueClassSupport { | ||
public static final field INSTANCE Lio/mockk/core/ValueClassSupport; | ||
public final fun getBoxedClass (Lkotlin/reflect/KClass;)Lkotlin/reflect/KClass; | ||
public final fun getBoxedValue (Ljava/lang/Object;)Ljava/lang/Object; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import buildsrc.config.Deps | ||
|
||
plugins { | ||
buildsrc.convention.`kotlin-multiplatform` | ||
|
||
buildsrc.convention.`mockk-publishing` | ||
} | ||
|
||
description = "MockK functionality that is used by other MockK modules" | ||
|
||
val mavenName: String by extra("MockK Core") | ||
val mavenDescription: String by extra("${project.description}") | ||
|
||
kotlin { | ||
jvm() | ||
|
||
sourceSets { | ||
val commonMain by getting { | ||
dependencies { | ||
} | ||
} | ||
val commonTest by getting { | ||
dependencies { | ||
implementation(kotlin("test")) | ||
} | ||
} | ||
val jvmMain by getting { | ||
dependencies { | ||
implementation(kotlin("reflect")) | ||
} | ||
} | ||
val jvmTest by getting { | ||
dependencies { | ||
implementation(kotlin("test-junit5")) | ||
implementation(Deps.Libs.junitJupiter) | ||
} | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
modules/mockk-core/src/commonMain/kotlin/io/mockk/core/ValueClassSupport.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package io.mockk.core | ||
|
||
import kotlin.reflect.KClass | ||
|
||
|
||
expect object ValueClassSupport { | ||
|
||
/** | ||
* Underlying property value of a **`value class`** or self. | ||
* | ||
* The type of the return might also be a `value class`! | ||
*/ | ||
val <T : Any> T.boxedValue: Any? | ||
|
||
/** | ||
* Underlying property class of a **`value class`**, or self. | ||
* | ||
* The result might also be a value class! So check recursively, if necessary. | ||
*/ | ||
val KClass<*>.boxedClass: KClass<*> | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.