Skip to content

chore(deps): update dependency org.kodein.mock.mockmp to v3 - #218

Open
renovate-self-hosted-apter[bot] wants to merge 1 commit into
mainfrom
renovate/major-mockmp
Open

chore(deps): update dependency org.kodein.mock.mockmp to v3#218
renovate-self-hosted-apter[bot] wants to merge 1 commit into
mainfrom
renovate/major-mockmp

Conversation

@renovate-self-hosted-apter

@renovate-self-hosted-apter renovate-self-hosted-apter Bot commented Dec 1, 2024

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
org.kodein.mock.mockmp 1.17.03.5.1-kt2.3 age confidence

Release Notes

kosi-libs/MocKMP (org.kodein.mock.mockmp)

v3.5.1-kt2.3: 3.5.1-kt2.3

3.5.1-kt2.3

The Kotlin 2.3 build of 3.5.1 — same sources, compiled and published against Kotlin 2.3.21 instead of 2.4.10. KSP stays at 2.3.10, which pairs with both.

Use this if your project is still on Kotlin 2.3:

plugins {
    kotlin("multiplatform") version "2.3.21"
    id("com.google.devtools.ksp") version "2.3.10"
    id("org.kodein.mock.mockmp") version "3.5.1-kt2.3"
}

Everything in the 3.5.1 notes applies unchanged — no breaking changes.

Fixes

  • A generic interface mocked at a concrete instantiation now seeds the right placeholder. Processor<NeverTouched>'s member types used to be seeded from the bare declaration, so a type-parameter member resolved to Processor's own bound instead of NeverTouched — leaving isAny<NeverTouched>() with no providePlaceholder branch to resolve through at runtime
  • A placeholder MocKMP cannot build now explains why, instead of a doubly-wrapped "please open an issue" error. The generated stub used to error(...) with fake-flavoured advice ("register a @FakeProvider") that doesn't apply to something never requested by name, and the runtime wrapped that message twice on the way out, ending in an issue-tracker link even though the processor already knew the exact reason. It now throws a dedicated MocKMPNoPlaceholderException, rethrown unwrapped, naming mocker.useReference(...) as the fix
  • A type covered by a top-level @FakeProvider now resolves through providePlaceholder too. It used to have no branch at all — removed from the Fake candidates the moment it was collected, but never added as a Placeholder either — so isAny<ProvidedType>() failed at runtime despite a valid user-supplied value existing for it

The only difference from 3.5.1 is the toolchain — same as every prior -kt2.3 build. No dependency version, resolved URL or integrity hash changes.

Full Changelog: kosi-libs/MocKMP@v3.5.0-kt2.3...v3.5.1-kt2.3

v3.5.0: 3.5.0

3.5.0

⚠️ Breaking: isInstanceOf now takes a KClass argument, not a type parameter

- mocker.every { api.registerCallback(isInstanceOf<AdminCallback>()) } returns Unit
+ mocker.every { api.registerCallback(isInstanceOf(AdminCallback::class)) } returns Unit

isInstanceOf<T>()'s reified T doubled as the key used to fetch a placeholder return value, via the generated providePlaceholder(KClass<*>) dispatcher — but that dispatcher only has a branch for a type the processor actually saw declared somewhere (a mocked function's parameter/property type, or an enumerable sealed subtype). A type written only inside isInstanceOf<AdminCallback>() has no such branch, so the constraint threw at runtime, even though it compiled cleanly.

isInstanceOf now takes the class to check against as a regular KClass<*> argument. It is still a reified function, but that generic type argument must never be given explicitly:

isInstanceOf(AdminCallback::class)                  // correct — T is inferred from the call site
isInstanceOf<AdminCallback>(AdminCallback::class)    // compiles, but WILL throw at runtime

The second form still compiles — nothing stops you from writing it — but it will throw Could not find a way to get a reference of AdminCallback at runtime, the exact bug this release fixes. Its reified T must stay inferred from the surrounding call (normally the mocked function's own parameter type); the KClass<*> argument only drives the instance check, it has no bearing on what T resolves to. Writing an explicit type argument alongside it reintroduces the same broken placeholder lookup — the failure message now names this specific mistake if it happens, but the fix is to never write the type argument in the first place.

Action required: find every isInstanceOf<Type>() call and rewrite it as isInstanceOf(Type::class) — with no <Type> anywhere in the call.

Fixes

  • The isInstanceOf signature change above, plus a runtime message that now names an explicit type argument as the likely cause when placeholder lookup still fails inside isInstanceOf
  • A constructor parameter type KSP cannot resolve — typically a transitive dependency missing from the consumer's compile classpath — crashed the processor with NullPointerException: null (#​98). KSP2's error-type declaration for an unresolvable reference is itself a KSClassDeclaration with no qualified name, so it passed every existing type check and only failed on a bare qualifiedName!!, deep inside placeholder generation — often for a type the user's own code never names directly. An implicit Placeholder now degrades to a throwing stub instead of aborting the build; an explicit @Fake/@Mock target fails with a clear diagnostic naming the missing dependency

Documentation

  • mocking.adoc documents the isInstanceOf gotcha: call isInstanceOf(Type::class), never isInstanceOf<Type>()

Full Changelog: kosi-libs/MocKMP@v3.4.0...v3.5.0

v3.5.0-kt2.3: 3.5.0-kt2.3

3.5.0-kt2.3

The Kotlin 2.3 build of 3.5.0 — same sources, compiled and published against Kotlin 2.3.21 instead of 2.4.10. KSP stays at 2.3.10, which pairs with both.

Use this if your project is still on Kotlin 2.3:

plugins {
    kotlin("multiplatform") version "2.3.21"
    id("com.google.devtools.ksp") version "2.3.10"
    id("org.kodein.mock.mockmp") version "3.5.0-kt2.3"
}

Everything in the 3.5.0 notes applies unchanged, including the breaking change:

⚠️ Breaking: isInstanceOf now takes a KClass argument, not a type parameter

- mocker.every { api.registerCallback(isInstanceOf<AdminCallback>()) } returns Unit
+ mocker.every { api.registerCallback(isInstanceOf(AdminCallback::class)) } returns Unit

isInstanceOf<T>()'s reified T doubled as the key used to fetch a placeholder return value, but the generated dispatcher only has a branch for a type the processor actually saw declared somewhere — so a type written only inside isInstanceOf<AdminCallback>() threw at runtime, even though it compiled cleanly. isInstanceOf now takes the class to check against as a regular KClass<*> argument, and its still-reified generic type argument must never be given explicitly:

isInstanceOf(AdminCallback::class)                  // correct — T is inferred from the call site
isInstanceOf<AdminCallback>(AdminCallback::class)    // compiles, but WILL throw at runtime

Action required: find every isInstanceOf<Type>() call and rewrite it as isInstanceOf(Type::class) — with no <Type> anywhere in the call.

Also fixed

  • A constructor parameter type KSP cannot resolve — typically a transitive dependency missing from the consumer's compile classpath — crashed the processor with NullPointerException: null (#​98). An implicit Placeholder now degrades to a throwing stub instead of aborting the build; an explicit @Fake/@Mock target fails with a clear diagnostic naming the missing dependency instead
  • isInstanceOf's failure message now names an explicit type argument as the likely cause, when placeholder lookup still fails inside it

The only difference from 3.5.0 is the toolchain — same as every prior -kt2.3 build. No dependency version, resolved URL or integrity hash changes.

Full Changelog: kosi-libs/MocKMP@v3.4.0-kt2.3...v3.5.0-kt2.3

v3.4.0: 3.4.0

3.4.0

A correctness-and-safety release for mocking and faking: mocks are no longer silently duplicated as fakes, a generic type's placeholder is now instantiated at the exact type a caller needs instead of a widened bound, generated code opts in on the caller's behalf wherever it needs to, and it now suppresses deprecation warnings it has no way to avoid. fake<T>()/mocker.mock<T>() also now refuse to serve a type nothing requested directly.

Features

  • Distinct Placeholder kind, replacing accidental transitive mocks/fakes. A mocked interface's own member types used to be silently seeded into both toMock and toFake, generating a redundant, unused MockXxx/fakeXxx() for every type reached only that way — adding a property to a mocked interface would silently produce both a mock and a fake of its type. Placeholders now carry constructor transitivity only, never abstract-member transitivity (their members throw instead of being faked), and providePlaceholder prefers a Fake, then a Mock, then a Placeholder. A mock is now only ever generated for an explicit @Mock/@UsesMocks request
  • Generated code opts in on the caller's behalf. Faking or mocking a type that transitively needs an opt-in — kotlin.SubclassOptInRequired (e.g. kotlinx.serialization's SerialDescriptor) or kotlin.RequiresOptIn (including through lexical nesting, e.g. SerialKind's sealed resolution landing on PolymorphicKind.OPEN, itself @ExperimentalSerializationApi) — used to fail to compile. Generated declarations now carry @OptIn wherever they implement, extend, or mention a marked declaration
  • /* Required by: ... */ comments on generated declarations, naming the annotation site (@Mock, @Fake, @UsesMocks, @UsesFakes) and, for a transitively-reached type, each hop that led to it — previously this chain was only ever surfaced in a compile error

Fixes

  • A generic type's placeholder is now instantiated at the type actually needed, not its bound. Placeholders were keyed by declaration, so a generic type only ever got one placeholder, at its bounded instantiation (Id<Any?>) — which failed to typecheck wherever a constructor actually needed a specific instantiation (Id<String>). Keyed by the exact type now, mirroring how fakes already worked; the same bug in mocked-generic-interface construction is fixed alongside it
  • fake<T>()/mocker.mock<T>() only serve explicitly-requested types. A type reached only transitively — a constructor parameter of another explicitly-faked type, say — used to be reachable through fake<T>() anyway, even though nothing asked for it directly; if the type that needed it changed shape later, an unrelated test could silently start failing or returning something unrelated. Both accessors now only list types requested directly via @Fake/@UsesFakes/@Mock/@UsesMocks — a transitive dependency still gets its function generated and used internally, it just isn't exposed
  • Generated code suppresses DEPRECATION/DEPRECATION_ERROR it has no way to avoid. A mocked/faked declaration's own signature — supertype, member types, constructor arguments, enum entries, KClass/typeOf dispatch keys — routinely gets mentioned by generated code, and can itself be @Deprecated without the generated file being a place the user could act on that warning. Every generated file now opens with @file:Suppress("DEPRECATION", "DEPRECATION_ERROR")
  • The generated FakeXxx implementation class is private, and declared after its fakeXxx() function. It used to be emitted at the module's own visibility, ahead of the function that builds it — leaking an implementation detail into the faked type's own package (risking a name collision with user code) even though fake<T>() is the only supported way to obtain one

Internal

  • The internal control-flow exception Mocker throws to unwind an every {}/verify {} block no longer fills in a stack trace on the JVM — a small, always-on cost it never needed, since the exception is always caught internally

Full Changelog: kosi-libs/MocKMP@v3.3.0...v3.4.0

v3.4.0-kt2.3: 3.4.0-kt2.3

3.4.0-kt2.3

The Kotlin 2.3 build of 3.4.0 — same sources, compiled and published against Kotlin 2.3.21 instead of 2.4.10. KSP stays at 2.3.10, which pairs with both.

Use this if your project is still on Kotlin 2.3:

plugins {
    kotlin("multiplatform") version "2.3.21"
    id("com.google.devtools.ksp") version "2.3.10"
    id("org.kodein.mock.mockmp") version "3.4.0-kt2.3"
}

Everything in the 3.4.0 notes applies unchanged:

  • A mocked interface's own member types no longer produce an unused, redundant MockXxx/fakeXxx() pair — they now go through a distinct Placeholder kind, which only ever throws if reached, instead of a mock or fake nothing asked for
  • Generated code now opts in on the caller's behalf wherever it implements, extends, or mentions a kotlin.SubclassOptInRequired- or kotlin.RequiresOptIn-marked declaration (e.g. kotlinx.serialization's SerialDescriptor/SerialKind)
  • Generated MockXxx/fakeXxx()/placeholderXxx() declarations carry a /* Required by: ... */ comment naming the annotation site and, for a transitively-reached type, each hop that led to it
  • A generic type's placeholder is now instantiated at the type actually needed rather than its bound, fixing a typecheck failure a constructor could hit
  • fake<T>()/mocker.mock<T>() now only serve types requested directly via @Fake/@UsesFakes/@Mock/@UsesMocks — a transitively-reached type is no longer silently exposed through them
  • Generated code now suppresses DEPRECATION/DEPRECATION_ERROR it has no way to avoid, so a project with allWarningsAsErrors on can mock/fake a deprecated type without the generated file itself failing the build
  • The generated FakeXxx implementation class is private and declared after its fakeXxx() function, instead of leaking at the module's own visibility

The only difference from 3.4.0 is the toolchain, plus the yarn.lock that the 2.3.21 toolchain's bundled yarn writes — same as every prior -kt2.3 build. No dependency version, resolved URL or integrity hash changes.

Full Changelog: kosi-libs/MocKMP@v3.3.0-kt2.3...v3.4.0-kt2.3

v3.3.0: 3.3.0

3.3.0

A faking-focused feature release. The set of types the processor can produce a fake for grows substantially — objects, annotation classes, self-referential interfaces, and kotlinx.coroutines types (Flow, Job, StateFlow, ...) — alongside fixes to @Fake/@UsesFakes handling of nullable and function types, and to isAny() for a type only ever referenced nullably. The Gradle plugin is now also published to Maven Central.

Features — more types can be faked

  • Objects and annotation classes are now fakeable: fake<MySingleton>() returns the singleton itself, and an annotation class is faked by calling its constructor exactly like any other class

  • Self-referential interfaces and abstract classes can now be faked. A faked property whose value is itself a nested fake is now built lazily, on first read, instead of eagerly at construction — which is what makes this work:

    interface Node {
        val name: String
        val parent: Node
    }

    fake<Node>() builds only the root; each further .parent is built the moment it's read, so node.parent.parent.parent works even though nothing bounds how deep Node can go

  • kotlin.Nothing is now a builtin: a Nothing-typed member throws UnsupportedOperationException when reached, instead of the processor emitting code the compiler rejects

  • KClass<T>/Class<T> are now builtins too — String::class for KClass<String>, not a context-free literal — which is what makes an annotation class with such a parameter fakeable at all

Features — kotlinx.coroutines types are faked as builtins

Flow, SharedFlow/MutableSharedFlow, StateFlow/MutableStateFlow, Channel and friends, Job/CompletableJob, Deferred/CompletableDeferred, CoroutineScope, Mutex, Semaphore, and CoroutineContext are now faked as real, inert instances (emptyFlow(), Job(), Mutex(), ...) instead of generating a broken or useless implementation class.

  • StateFlow<T> recurses into a real fake of TStateFlow<User> holds a faked User, StateFlow<User?> holds null
  • The kotlinx.coroutines-specific placeholder branches are gated on the consuming module's classpath, so a project that doesn't depend on it is unaffected
  • A @FakeProvider can now override how any builtin is faked, including these — previously a builtin always won

Fixes

  • @Fake/@UsesFakes on a nullable or function-typed target used to be handled inconsistently with how the same type is faked when reached transitively: a nullable target could be faked as its non-null builtin literal instead of null (and, for a builtin like String?, broke the whole compilation via a duplicate placeholder branch), and a function-typed target was rejected outright even though its value is just an inline lambda. Both now resolve the same way a transitively-discovered occurrence of the same type already did
  • isAny() (and every other constraint) threw for a type only ever referenced nullably. A mocked interface parameter typed e.g. Suit?, with no other reference to Suit anywhere, made isAny() throw Could not find a way to get a reference of Suit — the processor had skipped generating a placeholder for Suit, reasoning that null already covered its one nullable use, but isAny<T>() resolves its placeholder through the erased T::class, which can't tell "T was Suit" apart from "T was Suit?" (typeOf<T>() would, but can't be used here — it fails to compile wherever the same reified T might be inferred as a suspend functional type, KT-47562). A placeholder is now seeded for the type either way; fake value construction for an actually-nullable property is unaffected — it still fakes as plain null everywhere else

Publishing

  • The Gradle plugin is now published to Maven Central, in addition to the Gradle Plugin Portal — needed by a legacy buildscript {} block, or any setup that mirrors dependencies into an internal repository rather than resolving plugins from the Portal

Full Changelog: kosi-libs/MocKMP@v3.2.0...v3.3.0

v3.3.0-kt2.3: 3.3.0-kt2.3

3.3.0-kt2.3

The Kotlin 2.3 build of 3.3.0 — same sources, compiled and published against Kotlin 2.3.21 instead of 2.4.10. KSP stays at 2.3.10, which pairs with both.

Use this if your project is still on Kotlin 2.3:

plugins {
    kotlin("multiplatform") version "2.3.21"
    id("com.google.devtools.ksp") version "2.3.10"
    id("org.kodein.mock.mockmp") version "3.3.0-kt2.3"
}

Everything in the 3.3.0 notes applies unchanged:

  • Objects, annotation classes, and self-referential interfaces/abstract classes can now be faked
  • kotlinx.coroutines types (Flow, Job, StateFlow, Mutex, ...) are faked as real, inert instances instead of a generated implementation
  • @Fake/@UsesFakes on a nullable or function-typed target is now handled consistently with a transitively-discovered occurrence of the same type
  • isAny() no longer throws for a type only ever referenced nullably
  • The Gradle plugin is now published to Maven Central as well as the Plugin Portal

The only difference from 3.3.0 is the toolchain, plus the yarn.lock that the 2.3.21 toolchain's bundled yarn writes: it collapses into one shared-key entry the blocks the 2.4.10 one duplicates per alias. No dependency version, resolved URL or integrity hash changes.

Full Changelog: kosi-libs/MocKMP@v3.2.0-kt2.3...v3.3.0-kt2.3

v3.2.0: 3.2.0

3.2.0

A feature release, built on 3.1.0's correctness work. Faking is no longer limited to types that can be constructed: interfaces and abstract classes are faked by implementing them. And when a type genuinely cannot be faked, the error now names the chain of your declarations that required it. No API changes, and nothing that faked or mocked before behaves differently.

Features — faking interfaces and abstract classes

  • A type that cannot be constructed can still be implemented, so @Fake and @UsesFakes now accept interfaces and abstract classes: fake<UserRepository>() returns an instance of a FakeUserRepository class generated next to the fake function
  • Its members follow the rules the rest of faking already followed: functions returning Unit do nothing, functions returning a value return a fake of their return type, and properties hold a fake of theirs (a var keeps whatever is later assigned)
  • Only abstract members are overridden — a default implementation is left to run, over the faked members it reads. This also sidesteps the JDK interop variance conflicts that mock generation ran into
  • An abstract class is constructed with faked arguments, exactly as a concrete class is
  • A function returning one of its own type parameters returns the parameter that already holds a value of that type: fun <T> convert(value: T): T is faked as convert(value) = value. With no such parameter (fun <T> get(): T) it is the one member that cannot be faked and throws when called; the rest of the fake is unaffected
  • The class is generated per faked instantiation rather than being generic, since it has to hold values and no value of a type parameter can be produced. A star projection implements its parameter's bound
  • Function types keep being rejected — they resolve to kotlin.FunctionN, which Kotlin/JS forbids implementing — but the error now points at @Mock, which mocks a function type as a callable mock

Features — diagnostics

  • A fake is rarely requested directly: it is reached through constructor parameters and, now, through abstract members. Naming only the type that failed left you with nothing of yours to look at, so every "cannot fake" diagnostic now prints the chain that required it:

    Cannot generate a fake for TCPLayer because it has no public constructor.
    Required by: Database.con: Connection -> Connection.connect(String): Network -> Network(TCPLayer, Int)
    Please register a top-level @&#8203;FakeProvider function that provides a value of this type.
    
  • The chain is recorded as the graph is walked, not reconstructed at failure time — a type can be discovered during expansion and only turn out to be unfakeable at generation

  • Placeholders seeded implicitly from a mocked interface's signatures are covered too. They never fail the build, so their path reaches you through the generated stub's runtime message — the case where none of the types involved appear in your code at all

Documentation

  • New "Faking interfaces and abstract classes" section, covering the member rules above
  • Abstract classes can be mocked — they always could, but the docs said the opposite ("Only interfaces can be mocked"). mocking.adoc now documents it: only abstract members are mocked, a concrete member keeps its real implementation, and the generated mock runs the class's constructor with a faked value per parameter
  • The docs component was left at 3.0 by the 3.1.0 release; it now tracks the release again

Full Changelog: kosi-libs/MocKMP@v3.1.0...v3.2.0

v3.2.0-kt2.3: 3.2.0-kt2.3

3.2.0-kt2.3

The Kotlin 2.3 build of 3.2.0 — same sources, compiled and published against Kotlin 2.3.21 instead of 2.4.10. KSP stays at 2.3.10, which pairs with both.

Use this if your project is still on Kotlin 2.3:

plugins {
    kotlin("multiplatform") version "2.3.21"
    id("com.google.devtools.ksp") version "2.3.10"
    id("org.kodein.mock.mockmp") version "3.2.0-kt2.3"
}

Everything in the 3.2.0 notes applies unchanged:

  • @Fake and @UsesFakes accept interfaces and abstract classes, faked by a generated implementation rather than by a constructor call
  • Every "cannot fake" diagnostic names the chain of your declarations that required the type
  • Abstract classes are documented as mockable, which they always were

The only difference from 3.2.0 is the toolchain, plus the yarn.lock that the 2.3.21 toolchain's bundled yarn writes: it collapses into one shared-key entry the blocks the 2.4.10 one duplicates per alias. No dependency version, resolved URL or integrity hash changes.

Full Changelog: kosi-libs/MocKMP@v3.1.0-kt2.3...v3.2.0-kt2.3

v3.1.0: 3.1.0

3.1.0

A correctness and coverage release. No API changes: every fix below is behavioural, and the suite that guards them grew from 311 to 442 test results across the eight test projects.

Fixes — processor

  • Inherited @Mock/@Fake properties are now injected. A base class holding the mocks every test needs works as documented
  • Type parameters are substituted at any nesting depth, so GenData<GenData<T>> and friends resolve
  • Star-projected generics can be faked through @UsesFakes
  • A sealed fake resolves its target with that subclass's own type arguments — a permitted subclass may declare them in its own order
  • One placeholder branch per function-type KClass, fixing a ClassCastException on Kotlin/Wasm
  • Generated output is ordered by source rather than by hash, so builds are reproducible
  • Injector file names are disambiguated by nesting, so two same-named nested classes no longer collide
  • Accessors are always emitted, including for a project that annotates nothing
  • @Deprecated is no longer propagated onto generated overrides, so mocking a deprecated member stops warning at the mock
  • A fake for a type that unwraps to a JDK class (kotlin.Exceptionjava.lang.Exception on JVM) is generated into fake.java.lang rather than java.lang, which the JVM forbids user code from contributing to
  • Every "cannot fake" diagnostic now states a concrete reason and points at @FakeProvider
  • Unexpected failures are reported as MocKMP bugs with a stack trace, instead of surfacing as a bare KSP crash

Fixes — runtime

  • Receivers are matched by identity, and equals/hashCode are never mocked — routing them through the Mocker recursed into the very lookup that invoked them
  • References is cleared on reset(), so a placeholder cannot survive into the next test
  • Stdlib placeholders resolve without a generated provider, and backProperty no longer requires a kotlin.Any placeholder
  • A custom isValid fails cleanly on a wrong-typed argument instead of throwing out of the surrounding every/verify
  • Constraints created but never passed to a mocked call are reported, rather than being silently taken by the next call

Fixes — Gradle plugin

  • JUnit 5 is detected through public API and outside a dependency provider, which is what the configuration cache requires
  • A target that cannot be processed now fails immediately, instead of surfacing much later as a missing actual
  • targets() rejects an unknown target name rather than silently filtering everything out
  • Build paths and task dependencies are derived lazily

Behaviour worth knowing

  • Mocking equals/hashCode is no longer possible, by design. toString remains mockable
  • Function-mock registration keys now use the qualified name the processor resolved, so they are identical on every platform. Reified mockFunctionN(mocker) calls still key on the platform's own rendering

Documentation

  • New 2.1 → 3.0 migration guide, linked from the README's breaking-change warning
  • facking.adoc renamed to faking.adoc, with a redirect so the published URL keeps working
  • Fixed example code that did not compile, and examples that named symbols they never declared

Full Changelog: kosi-libs/MocKMP@v3.0.1...v3.1.0

v3.1.0-kt2.3: 3.1.0-kt2.3

3.1.0-kt2.3

The Kotlin 2.3 build of 3.1.0 — same sources, compiled and published against Kotlin 2.3.21 instead of 2.4.10. KSP stays at 2.3.10, which pairs with both.

Use this if your project is still on Kotlin 2.3:

plugins {
    kotlin("multiplatform") version "2.3.21"
    id("com.google.devtools.ksp") version "2.3.10"
    id("org.kodein.mock.mockmp") version "3.1.0-kt2.3"
}

Everything in the 3.1.0 notes applies unchanged: the processor, runtime and Gradle plugin fixes, and the test suite that grew from 311 to 442 results. Verified on 2.3.21 — :tests-projects:check from clean gives the same 442 results with no failures, and the processor and plugin suites pass.

The only difference from 3.1.0 is the toolchain, plus a regenerated yarn.lock: the 2.3.21 toolchain bundles a different yarn, which writes the file with shared keys where the previous one duplicated a block per alias. No dependency version, resolved URL or integrity hash changes.

Full Changelog: kosi-libs/MocKMP@v3.0.1-kt2.3...v3.1.0-kt2.3

v3.0.1: 3.0.1

3.0.1

Fixes

  • Generated fake lambdas that return Unit no longer emit a redundant Unit body, which produced an "Expression is unused — Redundant 'Unit'" warning in consuming projects — e.g. a faked (String) -> Unit now generates { _, -> } instead of { _, -> Unit }

Improvements

  • The androidComponents generated-source hookup is now also wired up for the main source set of Kotlin Multiplatform Android targets (previously only applied to test source sets), and the wiring is shared through a single installExtractor() helper instead of being duplicated

Other

Full Changelog: kosi-libs/MocKMP@v3.0.0...v3.0.1

v3.0.1-kt2.3: 3.0.1-kt2.3

3.0.1-kt2.3

This is a Kotlin 2.3.21 build of MocKMP 3.0, for projects that cannot yet move to Kotlin 2.4. It carries the same AGP 9 requirement as 3.0.0.

Fixes

  • Generated fake lambdas that return Unit no longer emit a redundant Unit body, which produced an "Expression is unused — Redundant 'Unit'" warning in consuming projects — e.g. a faked (String) -> Unit now generates { _, -> } instead of { _, -> Unit }

Improvements

  • The androidComponents generated-source hookup is now also wired up for the main source set of Kotlin Multiplatform Android targets (previously only applied to test source sets), and the wiring is shared through a single installExtractor() helper instead of being duplicated

Other

  • Pinned Kotlin to 2.3.21 (down from 2.4.10 in 3.0.0) for this build variant

Full Changelog: kosi-libs/MocKMP@v3.0.0...v3.0.1-kt2.3

v3.0.0: 3.0.0

3.0.0

⚠️ Breaking change — requires AGP 9

This release migrates the MocKMP Gradle plugin to the new Android Gradle Plugin APIs and is incompatible with AGP 8 or earlier. Only update to MocKMP 3.0 if you are also updating your project to AGP 9.

Breaking Changes

  • Migrated the Gradle plugin from the legacy TestedExtension/variant APIs to the new androidComponents (AndroidComponentsExtension) and CommonExtension APIs, adding proper support for the new host/device test source sets (HasHostTests, HasDeviceTests, HasUnitTest, HasAndroidTest)
  • Bumped the required Android Gradle Plugin to 9.1.1
  • Added support for the new com.android.kotlin.multiplatform.library plugin (Android as a genuine Kotlin Multiplatform target) alongside the classic com.android.library + kotlin("android") setup
  • Updated to Kotlin 2.4.10

Improvements

  • Added website and vcsUrl to the Gradle plugin metadata for better documentation linking on the Gradle Plugin Portal
  • Refined the plugin's Gradle Plugin Portal description to reflect support for Kotlin Multiplatform, Android, and JVM projects

Full Changelog: kosi-libs/MocKMP@v2.1.0...v3.0.0

v2.1.0: 2.1.0

2.1.0

Fixes

  • Fixed a naming collision in the generated fakes.kt: two faked types with the same simple name in different packages (e.g. foo.Data and bar.Data) produced duplicate type_Data properties and when branches that failed to compile. Generated type_* identifiers — and the generated fakeXxx() function names — are now package-qualified (type_foo_Data, type_bar_Data) (#​87)
  • Replaced the unsafe-cast isAny() / isEqual() / etc. placeholder mechanism with real, KSP-generated placeholder instances. Kotlin 2.3 defaults genericSafeCasts=true for unoptimized Kotlin/Native binaries (KT-68165), which turned the old placeholder into a hard ClassCastException on every native test target
  • Downgraded the JVM toolchain from 17 back to 11 for all modules, restoring compatibility with projects that must build on Java 11 (#​89)

Improvements

  • Updated to Kotlin 2.3
  • Replaced kosi-publish with maven-publish across all modules and unified Gradle configuration; added support for additional targets (watchOS, tvOS, wasmJs)
  • Internal: MocKMPProcessor was split from a single 420-line function into a documented, phase-organized set of KSP round functions — no behavior change

Full Changelog: kosi-libs/MocKMP@v2.0.2...v2.1.0

v2.0.2: 2.0.2

What's Changed

Fixes

Full Changelog: kosi-libs/MocKMP@v2.0.1...v2.0.2

v2.0.1: 2.0.1

What's Changed

  • Use Custom Capitalization Function to Prevent NoClassDefFoundError by @​rs-georg in #​86

New Contributors

Full Changelog: kosi-libs/MocKMP@v2.0.0...v2.0.1

v2.0.0: 2.0.0

Update to Kotlin 2.0

MIGRATION GUIDE

This updates brings breaking changes in the way MocKMP is applied to projects, as well as how mocks, fakes and injectors are accessed from common sources.

It does NOT bring any change in the mocks configuration / verifications as well as how the fakes and injectors work.


Configuration

📅 Schedule: Branch creation - Between 12:00 AM and 03:59 AM, on day 1 of the month ( * 0-3 1 * * ) (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@coderabbitai

coderabbitai Bot commented Dec 1, 2024

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Join our Discord community for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@renovate-self-hosted-apter
renovate-self-hosted-apter Bot force-pushed the renovate/major-mockmp branch 3 times, most recently from d045395 to 7835104 Compare March 11, 2025 20:39
@renovate-self-hosted-apter renovate-self-hosted-apter Bot changed the title chore(deps): update dependency org.kodein.mock.mockmp to v2 chore(deps): update dependency org.kodein.mock.mockmp to v3 Jul 30, 2026
@renovate-self-hosted-apter
renovate-self-hosted-apter Bot force-pushed the renovate/major-mockmp branch 2 times, most recently from 8a440c5 to db2c206 Compare July 31, 2026 14:30
@renovate-self-hosted-apter
renovate-self-hosted-apter Bot force-pushed the renovate/major-mockmp branch 3 times, most recently from 7c79bad to 3b837b1 Compare August 24, 2026 10:53
@renovate-self-hosted-apter
renovate-self-hosted-apter Bot force-pushed the renovate/major-mockmp branch 2 times, most recently from 1addec2 to de2ff03 Compare August 25, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants