Skip to content

Commit 8f7ead5

Browse files
authored
Merge pull request #140 from lupuuss/release-3.4.0
Release 3.4.0
2 parents ffb2524 + a500524 commit 8f7ead5

107 files changed

Lines changed: 1432 additions & 895 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@ build/
33
!gradle/wrapper/gradle-wrapper.jar
44
!**/src/main/**/build/
55
!**/src/test/**/build/
6-
/test-mokkery-gradle/local.properties
6+
/local.properties
77

88
### IntelliJ IDEA ###
9-
.idea/modules.xml
10-
.idea/jarRepositories.xml
11-
.idea/compiler.xml
12-
.idea/libraries/
9+
/.idea/
1310
*.iws
1411
*.iml
1512
*.ipr
@@ -42,6 +39,6 @@ bin/
4239

4340
### Mac OS ###
4441
.DS_Store
45-
/.idea/
46-
/test-mokkery-gradle/.idea/
47-
/local.properties
42+
43+
### AI ###
44+
AGENTS.md

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</br>
99

1010
[![Gradle Plugin Portal Stable](https://img.shields.io/gradle-plugin-portal/v/dev.mokkery)](https://plugins.gradle.org/plugin/dev.mokkery)
11-
[![Kotlin](https://img.shields.io/badge/kotlin-2.3.20-blue.svg?logo=kotlin)](http://kotlinlang.org)
11+
[![Kotlin](https://img.shields.io/badge/kotlin-2.4.0-blue.svg?logo=kotlin)](http://kotlinlang.org)
1212
[![GitHub](https://img.shields.io/github/license/lupuuss/Mokkery)](https://github.com/lupuuss/Mokkery/blob/main/LICENSE)
1313
[![Docs](https://img.shields.io/static/v1?label=api&message=reference&labelColor=gray&color=blueviolet&logo=gitbook&logoColor=white)](https://mokkery.dev/api_reference)
1414

build-mokkery/src/main/kotlin/mokkery-multiplatform.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ kotlin {
6464
androidNativeX86()
6565
androidNativeX64()
6666

67-
@OptIn(ExperimentalKotlinGradlePluginApi::class)
6867
compilerOptions {
6968
freeCompilerArgs.add("-Xexpect-actual-classes")
70-
freeCompilerArgs.add("-Xcontext-parameters")
7169
}
7270
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
77
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
88
org.gradle.parallel=true
99
kotlin.js.stdlib.dom.api.included=false
10-
version=3.3.0
10+
version=3.4.0
1111

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[versions]
2-
kotlinMininumSupported = "2.3.0"
3-
kotlin = "2.3.20"
2+
kotlinMininumSupported = "2.4.0"
3+
kotlin = "2.4.0"
44
kotlinx-coroutines = "1.10.2"
55
buildconfig = "5.7.0"
66
google-autoservice = "1.1.1"
77
atomicfu = "0.31.0"
88
dokka = "2.1.0"
9-
poko = "0.21.1"
9+
poko = "0.23.0"
1010
vanniktech-publish-plugin = "0.36.0"
1111
gradle-portal-publish = "2.0.0"
1212

kotlin-js-store/yarn.lock

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,7 +1761,16 @@ streamroller@^3.1.5:
17611761
debug "^4.3.4"
17621762
fs-extra "^8.1.0"
17631763

1764-
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
1764+
"string-width-cjs@npm:string-width@^4.2.0":
1765+
version "4.2.3"
1766+
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
1767+
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
1768+
dependencies:
1769+
emoji-regex "^8.0.0"
1770+
is-fullwidth-code-point "^3.0.0"
1771+
strip-ansi "^6.0.1"
1772+
1773+
string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
17651774
version "4.2.3"
17661775
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
17671776
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -1779,7 +1788,14 @@ string-width@^5.0.1, string-width@^5.1.2:
17791788
emoji-regex "^9.2.2"
17801789
strip-ansi "^7.0.1"
17811790

1782-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
1791+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
1792+
version "6.0.1"
1793+
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
1794+
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
1795+
dependencies:
1796+
ansi-regex "^5.0.1"
1797+
1798+
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
17831799
version "6.0.1"
17841800
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
17851801
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -2011,7 +2027,16 @@ workerpool@^9.2.0:
20112027
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-9.3.3.tgz#e75281fe62e851afb21cdeef8fa85f6a62ec3583"
20122028
integrity sha512-slxCaKbYjEdFT/o2rH9xS1hf4uRDch1w7Uo+apxhZ+sf/1d9e0ZVkn42kPNGP2dgjIx6YFvSevj0zHvbWe2jdw==
20132029

2014-
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
2030+
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
2031+
version "7.0.0"
2032+
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
2033+
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
2034+
dependencies:
2035+
ansi-styles "^4.0.0"
2036+
string-width "^4.1.0"
2037+
strip-ansi "^6.0.0"
2038+
2039+
wrap-ansi@^7.0.0:
20152040
version "7.0.0"
20162041
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
20172042
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
plugins {
2+
kotlin("jvm")
3+
// no publishing - it's embedded into the plugin
4+
}
5+
6+
kotlin.sourceSets.all {
7+
languageSettings.apply {
8+
optIn("org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi")
9+
optIn("org.jetbrains.kotlin.ir.symbols.UnsafeDuringIrConstructionAPI")
10+
optIn("dev.mokkery.annotations.InternalMokkeryApi")
11+
}
12+
}
13+
14+
dependencies {
15+
compileOnly(libs.kotlin.compiler)
16+
compileOnly(libs.kotlin.stdlib)
17+
compileOnly(project(":mokkery-core"))
18+
compileOnly(project(":mokkery-core-tooling"))
19+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package dev.mokkery.plugin.core
2+
3+
import dev.mokkery.internal.options.MokkeryOptionsContainer
4+
import org.jetbrains.kotlin.compiler.plugin.AbstractCliOption
5+
import org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor
6+
import org.jetbrains.kotlin.config.CompilerConfiguration
7+
8+
abstract class BaseMokkeryCommandLineProcessor(
9+
override val pluginId: String,
10+
private val mokkeryOptions: MokkeryOptionsContainer,
11+
) : CommandLineProcessor {
12+
13+
override val pluginOptions: Collection<AbstractCliOption> = mokkeryOptions.map { it.cliOption }
14+
15+
override fun processOption(
16+
option: AbstractCliOption,
17+
value: String,
18+
configuration: CompilerConfiguration
19+
) {
20+
val option = mokkeryOptions[option.optionName] ?: error("Unknown $pluginId CLI option: ${option.optionName}")
21+
val key = option.configurationKey
22+
try {
23+
val deserialized = option.type
24+
.serializer
25+
.deserialize(value)
26+
configuration.add(key, deserialized)
27+
} catch (e: Throwable) {
28+
throw IllegalStateException(
29+
"Could not deserialize value for $pluginId CLI option ${option.name} = <$value> Expected: ${option.type.description}",
30+
e
31+
)
32+
}
33+
}
34+
}
35+

mokkery-plugin/src/main/kotlin/dev/mokkery/plugin/Cache.kt renamed to mokkery-core-plugin/src/main/kotlin/dev/mokkery/plugin/core/Cache.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package dev.mokkery.plugin
1+
package dev.mokkery.plugin.core
22

33
import dev.mokkery.context.MokkeryContext
44
import dev.mokkery.context.require
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package dev.mokkery.plugin.core
2+
3+
import dev.mokkery.internal.options.MokkeryOption
4+
import org.jetbrains.kotlin.config.CompilerConfiguration
5+
6+
fun <T> CompilerConfiguration.getSingleOrDefault(option: MokkeryOption<T>): T {
7+
require(!option.allowMultipleOccurrences) { "`getSingleOrDefault` is not supported for `allowMultipleOccurrences = true`" }
8+
return get(option.configurationKey)
9+
?.singleOrNull()
10+
?: option.defaultValues.singleOrNull()
11+
?: error("No value for ${option.configurationKey}")
12+
}

0 commit comments

Comments
 (0)