diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index b94dcd8f2..e35730e1f 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false # in case one JDK fails, we still want to see results from others timeout-minutes: 30 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Gradle Dependencies Cache uses: actions/cache@v3 @@ -37,15 +37,20 @@ jobs: key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} - name: Set up JDK ${{ matrix.java-version }} - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: + distribution: temurin java-version: ${{ matrix.java-version }} - - name: Grant execute permission for gradlew - run: chmod +x gradlew + - name: Run tests with Gradle uses: eskatos/gradle-command-action@v1 with: - arguments: test --stacktrace -Pkotlin.version=${{ matrix.kotlin-version }} -Pkotlin.ir.enabled=${{ matrix.kotlin-ir-enabled }} + arguments: | + test + --stacktrace + -Pkotlin.version=${{ matrix.kotlin-version }} + -Pkotlin.ir.enabled=${{ matrix.kotlin-ir-enabled }} + -PjavaToolchainTestVersion=${{ matrix.java-version }} android-instrumented-tests: runs-on: macos-latest @@ -55,11 +60,12 @@ jobs: fail-fast: false # in case one API-level fails, we still want to see results from others timeout-minutes: 30 steps: - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + + - uses: actions/setup-java@v3 with: - distribution: 'adopt' - java-version: '11' - - uses: actions/checkout@v2 + distribution: adopt + java-version: 11 - name: Setup Gradle Dependencies Cache uses: actions/cache@v3 diff --git a/.gitignore b/.gitignore index 331cc8fdf..830bd5f35 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,18 @@ -.idea +.idea/ .cxx -out + +out/ +build/ + +.gradle/ + *.iml -.gradle -build hs_err_* replay_* agent/android/.externalNativeBuild/ matrix/results local.properties -/mockk-js/node_modules -/cloud-badge/credentials.json -/cloud-badge/node_modules/ -/cloud-badge/package-lock.json -.java-version +mockk-js/node_modules/ +cloud-badge/credentials.json +cloud-badge/node_modules/ +cloud-badge/package-lock.json diff --git a/MAINTAINING.md b/MAINTAINING.md index 8fdd5ce47..ede229589 100644 --- a/MAINTAINING.md +++ b/MAINTAINING.md @@ -28,4 +28,3 @@ - [ ] push to github - [ ] create github release based on tag and describe changes there - [ ] announce on reddit/kotlinlang/potentially at "announcement place" on mockk.io - diff --git a/agent/android/build.gradle b/agent/android/build.gradle deleted file mode 100644 index fefb70697..000000000 --- a/agent/android/build.gradle +++ /dev/null @@ -1,92 +0,0 @@ -plugins { - id("mpp-android") -} - -ext { - mavenName = 'MockK Android Agent' - mavenDescription = 'Android instrumented testing MockK inline mocking agent' -} - -apply from: "${gradles}/upload.gradle" - -def dispatcherApkResPath = file("$buildDir/generated/dispatcher-apk") -def dispatcherDexResPath = file("$buildDir/generated/dispatcher-dex") -def dispatcherJarResPath = file("$buildDir/generated/dispatcher-jar") -def apkReleaseDispatcherPath = new File(project(':mockk-agent-android-dispatcher').buildDir, "outputs/apk/release") - -task copyDispatcherApk(type: Copy) { - dependsOn ':mockk-agent-android-dispatcher:assembleRelease' - from apkReleaseDispatcherPath - into dispatcherApkResPath - include '*.apk' - rename { "dispatcher.apk" } -} - -task unzipDispatcherApk(type: Copy) { - dependsOn copyDispatcherApk - from zipTree(new File(dispatcherApkResPath, 'dispatcher.apk')) - into dispatcherDexResPath - include '*.dex' - rename { "classes.dex" } -} - -task packageDispatcherJar(type: Jar) { - dependsOn unzipDispatcherApk - archiveFileName.set("dispatcher.jar") - destinationDirectory.set(dispatcherJarResPath) - - from dispatcherDexResPath -} -preBuild.dependsOn(packageDispatcherJar) - -android { - compileSdkVersion 'android-32' - - lintOptions { - abortOnError false - disable 'InvalidPackage' - warning 'NewApi' - } - - sourceSets { - main.resources.srcDirs += dispatcherJarResPath - main.resources.includes += "**/*.jar" - main.java.srcDirs += 'src/main/kotlin' - } - - packagingOptions { - exclude 'META-INF/main.kotlin_module' - } - - defaultConfig { - minSdkVersion 26 - targetSdkVersion 32 - versionName project['version'] - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - testInstrumentationRunnerArgument "notAnnotation", "io.mockk.test.SkipInstrumentedAndroidTest" - - ndk { - abiFilters "armeabi-v7a", "x86", "x86_64", "arm64-v8a" - } - } - - externalNativeBuild { - cmake { - path = 'CMakeLists.txt' - } - } -} - - -dependencies { - api project(':mockk-agent-api') - api project(':mockk-agent-common') - implementation "com.linkedin.dexmaker:dexmaker:$dexmaker_version" - implementation "org.objenesis:objenesis:$objenesis_android_version" - androidTestImplementation('androidx.test.espresso:espresso-core:3.4.0', { - exclude group: 'com.android.support', module: 'support-annotations' - }) - androidTestImplementation 'junit:junit:4.13.1' - - implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" -} diff --git a/agent/android/dispatcher/build.gradle.kts b/agent/android/dispatcher/build.gradle.kts deleted file mode 100644 index b723604fb..000000000 --- a/agent/android/dispatcher/build.gradle.kts +++ /dev/null @@ -1,31 +0,0 @@ -import org.jetbrains.kotlin.ir.backend.js.compile - -plugins { - id("com.android.application") -} - -android { - compileSdkVersion = "android-32" - - android { - lintOptions { - disable("InvalidPackage") - warning("NewApi") - } - - packagingOptions { - exclude("META-INF/main.kotlin_module") - } - } - - defaultConfig { - minSdk = 26 - targetSdk = 32 - applicationId = "com.android.dexmaker.mockito.inline.dispatcher" - } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } -} diff --git a/agent/api/build.gradle.kts b/agent/api/build.gradle.kts deleted file mode 100644 index 37458d398..000000000 --- a/agent/api/build.gradle.kts +++ /dev/null @@ -1,10 +0,0 @@ -plugins { - id("mpp-jvm") -} - -extra["mavenName"] = "MockK Java Agent API" -extra["mavenDescription"] = "API to build MockK agents" - -apply(from = "${rootProject.extensions.extraProperties["gradles"]}/jacoco.gradle") -apply(from = "${rootProject.extensions.extraProperties["gradles"]}/additional-archives.gradle") -apply(from = "${rootProject.extensions.extraProperties["gradles"]}/upload.gradle") diff --git a/agent/common/build.gradle.kts b/agent/common/build.gradle.kts deleted file mode 100644 index dc017bea7..000000000 --- a/agent/common/build.gradle.kts +++ /dev/null @@ -1,14 +0,0 @@ -plugins { - id("mpp-jvm") -} - -extra["mavenName"] = "MockK Common Agent classes" -extra["mavenDescription"] = "Common classes for agents" - -apply(from = "${rootProject.extensions.extraProperties["gradles"]}/jacoco.gradle") -apply(from = "${rootProject.extensions.extraProperties["gradles"]}/additional-archives.gradle") -apply(from = "${rootProject.extensions.extraProperties["gradles"]}/upload.gradle") - -dependencies { - api(project(":mockk-agent-api")) -} \ No newline at end of file diff --git a/agent/jvm/build.gradle b/agent/jvm/build.gradle deleted file mode 100644 index 770664f8b..000000000 --- a/agent/jvm/build.gradle +++ /dev/null @@ -1,55 +0,0 @@ -plugins { - id("mpp-jvm") -} - -ext { - mavenName = 'MockK Java Agent' - mavenDescription = 'MockK inline mocking agent' -} - -apply from: "${gradles}/jacoco.gradle" -apply from: "${gradles}/additional-archives.gradle" -apply from: "${gradles}/upload.gradle" - -dependencies { - api project(':mockk-agent-api') - api project(':mockk-agent-common') - - api "org.objenesis:objenesis:$objenesis_version" - - api "net.bytebuddy:byte-buddy:$byte_buddy_version" - api "net.bytebuddy:byte-buddy-agent:$byte_buddy_version" - - implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" -} - -def copyMockKDispatcher = - tasks.register("copyMockKDispatcher", Copy) { - dependsOn compileJava - dependsOn compileKotlin - - def mockKDispatcherDir = - sourceSets.main.java.classesDirectory - .map { "$it/io/mockk/proxy/jvm/dispatcher" } - - from(mockKDispatcherDir) { - include "JvmMockKDispatcher.class" - include "JvmMockKWeakMap.class" - include "JvmMockKWeakMap\$StrongKey.class" - include "JvmMockKWeakMap\$WeakKey.class" - - rename { String fileName -> - fileName.replace('.class', '.clazz') - } - } - into mockKDispatcherDir - } - -tasks.named("classes") { - dependsOn copyMockKDispatcher -} - -jar { - exclude "io/mockk/proxy/jvm/dispatcher/JvmMockKDispatcher.class" - exclude "io/mockk/proxy/jvm/dispatcher/JvmMockKWeakMap*.class" -} diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 463fc85ca..000000000 --- a/build.gradle +++ /dev/null @@ -1,54 +0,0 @@ -import java.time.Duration - -buildscript { - ext.kotlin_gradle_version = findProperty('kotlin.version')?.toString() ?: '1.7.10' - ext.android_gradle_version = '7.2.1' - ext.byte_buddy_version = '1.12.10' - ext.coroutines_version = '1.6.4' - ext.dexmaker_version = '2.28.1' - ext.objenesis_version = '3.2' - ext.objenesis_android_version = '3.2' - ext.junit_jupiter_version = '5.8.2' - ext.junit_vintage_version = '5.8.2' - ext.dokka_version = '1.7.10' - ext.gradles = project.projectDir.toString() + "/gradle" - - repositories { - mavenCentral() - google() - } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_gradle_version" - classpath "com.android.tools.build:gradle:$android_gradle_version" - classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version" - } -} - -plugins { - id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.11.0" -} - -subprojects { subProject -> - group = 'io.mockk' - - ext.kotlin_version = findProperty('kotlin.version')?.toString() ?: '1.7.10' - ext.kotlin_gradle_version = findProperty('kotlin.version')?.toString() ?: '1.6.0' - - repositories { - mavenCentral() - google() - } - - tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { - kotlinOptions { - jvmTarget = "1.8" - apiVersion = "1.5" - languageVersion = "1.5" - } - } - - tasks.withType(Test).configureEach { - timeout.set(Duration.ofMinutes(5)) - } -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 000000000..40dbfc695 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,30 @@ +import buildsrc.config.excludeGeneratedGradleDslAccessors + +plugins { + base + org.jetbrains.kotlinx.`binary-compatibility-validator` + org.jetbrains.kotlinx.kover + idea + + // note: plugin versions are set in ./buildSrc/build.gradle.kts +} + +group = "io.mockk" + +tasks.wrapper { + gradleVersion = "7.5.1" + distributionType = Wrapper.DistributionType.ALL +} + +idea { + module { + isDownloadSources = true + isDownloadJavadoc = true + + excludeGeneratedGradleDslAccessors(layout) + excludeDirs = excludeDirs + layout.files( + ".idea", + "gradle/wrapper", + ) + } +} diff --git a/buildSrc/android-sdk-detector.settings.gradle.kts b/buildSrc/android-sdk-detector.settings.gradle.kts new file mode 100644 index 000000000..cb7a0b5bc --- /dev/null +++ b/buildSrc/android-sdk-detector.settings.gradle.kts @@ -0,0 +1,46 @@ +val sdkDirProperty = "sdk.dir" + +val props = java.util.Properties() + +val propsPath = rootProject.projectDir.resolve("local.properties") +if (propsPath.isFile) { + props.load(java.io.FileReader(propsPath)) +} + +val sdkDirFile: java.io.File? = listOf( + providers.provider { props.getProperty(sdkDirProperty) }, + providers.environmentVariable("ANDROID_HOME"), + providers.environmentVariable("ANDROID_SDK_ROOT"), + providers.environmentVariable("HOME").map { "$it/Android/Sdk" }, +).asSequence() + .mapNotNull { pathProvider: Provider -> + pathProvider.orNull + .takeIf { !it.isNullOrBlank() } + ?.let { File(it) } + ?.takeIf { it.exists() } + }.find { it.isDirectory } + +var androidSdkDetected: Boolean by extra + +if (sdkDirFile != null) { + androidSdkDetected = true + logger.lifecycle("[android-sdk-detector] Android SDK detected: ${sdkDirFile.canonicalPath}") + + if ( + sdkDirFile.canonicalPath != props.getProperty(sdkDirProperty) + && props[sdkDirProperty] != null + && sdkDirFile.isDirectory + ) { + val path = sdkDirFile.canonicalPath + props.setProperty(sdkDirProperty, path) + } +} else { + androidSdkDetected = false + logger.lifecycle( + """ + | [WARNING] Skipping build of Android related modules because Android SDK has not been found! + | Define Android SDK location in 'local.properties' file or with ANDROID_HOME + | environment variable to build Android modules + """.trimMargin() + ) +} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 000000000..4b8fac6e7 --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,55 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + `kotlin-dsl` + kotlin("jvm") version embeddedKotlinVersion + // Gradle uses an embedded Kotlin. This doesn't affect the version of Kotlin used to build MockK. + // https://docs.gradle.org/current/userguide/compatibility.html#kotlin + + idea +} + +// set the versions of Gradle plugins that the subprojects will use here +val kotlinPluginVersion: String = "1.7.10" + +val androidGradle = "7.2.1" +val kotlinxKover = "0.5.1" +val dokka = "1.7.10" +val binaryCompatibilityValidator = "0.11.0" + +dependencies { + implementation(platform("org.jetbrains.kotlin:kotlin-bom:$kotlinPluginVersion")) + implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinPluginVersion") + implementation("org.jetbrains.kotlin:kotlin-reflect") + implementation("org.jetbrains.kotlin:kotlin-allopen") + + implementation("org.jetbrains.kotlinx:kover:$kotlinxKover") + + implementation("com.android.tools.build:gradle:$androidGradle") + implementation("org.jetbrains.dokka:dokka-gradle-plugin:$dokka") + + implementation("org.jetbrains.kotlinx:binary-compatibility-validator:$binaryCompatibilityValidator") +} + +tasks.withType().configureEach { + kotlinOptions { + jvmTarget = "1.8" + } +} + +kotlin { + jvmToolchain { + (this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(11)) + } + + kotlinDslPluginOptions { + jvmTarget.set("1.8") + } +} + +idea { + module { + isDownloadSources = true + isDownloadJavadoc = true + } +} diff --git a/buildSrc/repositories.settings.gradle.kts b/buildSrc/repositories.settings.gradle.kts new file mode 100644 index 000000000..497353a04 --- /dev/null +++ b/buildSrc/repositories.settings.gradle.kts @@ -0,0 +1,19 @@ +// A settings.gradle.kts plugin for defining shared repositories used by both buildSrc and the root project + +@Suppress("UnstableApiUsage") // Central declaration of repositories is an incubating feature +dependencyResolutionManagement { + + repositories { + mavenCentral() + google() + gradlePluginPortal() + } + + pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + google() + } + } +} diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts new file mode 100644 index 000000000..8065bb498 --- /dev/null +++ b/buildSrc/settings.gradle.kts @@ -0,0 +1,3 @@ +rootProject.name = "buildSrc" + +apply(from = "./repositories.settings.gradle.kts") diff --git a/buildSrc/src/main/kotlin/buildsrc/config/Deps.kt b/buildSrc/src/main/kotlin/buildsrc/config/Deps.kt new file mode 100644 index 000000000..b6d467f99 --- /dev/null +++ b/buildSrc/src/main/kotlin/buildsrc/config/Deps.kt @@ -0,0 +1,45 @@ +package buildsrc.config + +import org.gradle.api.Project + +fun Project.kotlinVersion() = findProperty("kotlin.version")?.toString() ?: Deps.Versions.kotlinDefault + +object Deps { + object Versions { + const val androidTools = "7.2.1" + const val dokka = "1.7.10" + const val kotlinDefault = "1.7.10" + const val coroutines = "1.6.4" + const val slfj = "1.7.36" + const val logback = "1.2.10" + const val junitJupiter = "5.8.2" + const val junitVintage = "5.8.2" + const val junit4 = "4.13.2" + + const val byteBuddy = "1.12.10" + const val objenesis = "3.2" + const val dexmaker = "2.28.1" + const val androidxEspresso = "3.4.0" + const val androidxTestRules = "1.4.0" + } + + object Libs { + const val slfj = "org.slf4j:slf4j-api:${Versions.slfj}" + const val logback = "ch.qos.logback:logback-classic:${Versions.logback}" + + const val kotlinBom = "org.jetbrains.kotlin:kotlin-bom:${Versions.kotlinDefault}" + const val kotlinReflect = "org.jetbrains.kotlin:kotlin-reflect" + + const val junit4 = "junit:junit:${Versions.junit4}" + const val junitJupiter = "org.junit.jupiter:junit-jupiter:${Versions.junitJupiter}" + const val junitJupiterApi = "org.junit.jupiter:junit-jupiter-api:${Versions.junitJupiter}" + const val junitJupiterEngine = "org.junit.jupiter:junit-jupiter-engine:${Versions.junitJupiter}" + const val junitVintageEngine = "org.junit.vintage:junit-vintage-engine:${Versions.junitJupiter}" + + const val kotlinTest = "org.jetbrains.kotlin:kotlin-test:${Versions.kotlinDefault}" + const val kotlinTestJunit5 = "org.jetbrains.kotlin:kotlin-test-junit5:${Versions.kotlinDefault}" + + const val kotlinCoroutinesBom = "org.jetbrains.kotlinx:kotlinx-coroutines-bom:${Versions.coroutines}" + const val kotlinCoroutinesCore = "org.jetbrains.kotlinx:kotlinx-coroutines-core" + } +} diff --git a/buildSrc/src/main/kotlin/buildsrc/config/artifactDistributions.kt b/buildSrc/src/main/kotlin/buildsrc/config/artifactDistributions.kt new file mode 100644 index 000000000..4c1eb3d62 --- /dev/null +++ b/buildSrc/src/main/kotlin/buildsrc/config/artifactDistributions.kt @@ -0,0 +1,44 @@ +package buildsrc.config + +import org.gradle.api.artifacts.Configuration +import org.gradle.api.attributes.Attribute + + +/** + * Marks this [configuration][Configuration] as a **provider** of artifacts. + * + * See https://docs.gradle.org/current/userguide/declaring_dependencies.html#sec:resolvable-consumable-configs + */ +fun Configuration.asProvider() { + isVisible = false + isCanBeResolved = false + isCanBeConsumed = true +} + + +/** + * Marks this [configuration][Configuration] as a **consumer** of artifacts. + * + * See https://docs.gradle.org/current/userguide/declaring_dependencies.html#sec:resolvable-consumable-configs + */ +fun Configuration.asConsumer() { + isVisible = false + isCanBeResolved = true + isCanBeConsumed = false +} + + +private val mockkResourceAttribute = Attribute.of("io.mockk.resource", String::class.java) + + +/** + * Adds `android-classes-dex` attributes to this [configuration][Configuration]. + * + * This allows for 'variant-aware' sharing of artifacts between projects. + * + * See https://docs.gradle.org/current/userguide/cross_project_publications.html#sec:variant-aware-sharing + */ +fun Configuration.androidClassesDexAttributes(): Configuration = + attributes { + attribute(mockkResourceAttribute, "android-classes-dex") + } diff --git a/buildSrc/src/main/kotlin/buildsrc/config/ide.kt b/buildSrc/src/main/kotlin/buildsrc/config/ide.kt new file mode 100644 index 000000000..3a6243b0c --- /dev/null +++ b/buildSrc/src/main/kotlin/buildsrc/config/ide.kt @@ -0,0 +1,27 @@ +package buildsrc.config + +import org.gradle.api.file.ProjectLayout +import org.gradle.plugins.ide.idea.model.IdeaModule + + +/** + * Exclude generated Gradle accessors code, so it doesn't clog up IntelliJ search results. + * + * This doesn't affect the build. + */ +fun IdeaModule.excludeGeneratedGradleDslAccessors(layout: ProjectLayout) { + excludeDirs.addAll( + layout.files( + "buildSrc/build/generated-sources/kotlin-dsl-accessors", + "buildSrc/build/generated-sources/kotlin-dsl-accessors/kotlin", + "buildSrc/build/generated-sources/kotlin-dsl-accessors/kotlin/gradle", + "buildSrc/build/generated-sources/kotlin-dsl-external-plugin-spec-builders", + "buildSrc/build/generated-sources/kotlin-dsl-external-plugin-spec-builders/kotlin", + "buildSrc/build/generated-sources/kotlin-dsl-external-plugin-spec-builders/kotlin/gradle", + "buildSrc/build/generated-sources/kotlin-dsl-plugins", + "buildSrc/build/generated-sources/kotlin-dsl-plugins/kotlin", + "buildSrc/build/generated-sources/kotlin-dsl-plugins/kotlin/buildsrc", + "buildSrc/build/pluginUnderTestMetadata", + ) + ) +} diff --git a/buildSrc/src/main/kotlin/buildsrc/config/publishing.kt b/buildSrc/src/main/kotlin/buildsrc/config/publishing.kt new file mode 100644 index 000000000..7399cea92 --- /dev/null +++ b/buildSrc/src/main/kotlin/buildsrc/config/publishing.kt @@ -0,0 +1,60 @@ +package buildsrc.config + +import org.gradle.api.Action +import org.gradle.api.artifacts.repositories.PasswordCredentials +import org.gradle.api.provider.Provider +import org.gradle.api.provider.ProviderFactory +import org.gradle.api.publish.maven.MavenPom +import org.gradle.api.publish.maven.MavenPublication + + +fun MavenPublication.createMockKPom( + configure: MavenPom.() -> Unit = {} +): Unit = + pom { + url.set("https://mockk.io") + scm { + connection.set("scm:git:git@github.com:mockk/mockk.git") + developerConnection.set("scm:git:git@github.com:mockk/mockk.git") + url.set("https://github.com/mockk/mockk/") + } + + developers { + developer { + id.set("oleksiyp") + name.set("Oleksii Pylypenko") + email.set("oleksiy.pylypenko@gmail.com") + } + developer { + id.set("Raibaz") + name.set("Mattia Tommasone") + email.set("raibaz@gmail.com") + } + } + + licenses { + license { + name.set("Apache License, Version 2.0") + url.set("https://www.apache.org/licenses/LICENSE-2.0") + } + } + configure() + } + +/** + * Fetches credentials from `gradle.properties`, environment variables, or command line args. + * + * See https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:handling_credentials + */ +// https://github.com/gradle/gradle/issues/20925 +fun ProviderFactory.credentialsAction( + repositoryName: String +): Provider> = zip( + gradleProperty("${repositoryName}Username"), + gradleProperty("${repositoryName}Password"), +) { user, pass -> + Action { + username = user + password = pass + } +} diff --git a/buildSrc/src/main/kotlin/buildsrc/convention/android-application.gradle.kts b/buildSrc/src/main/kotlin/buildsrc/convention/android-application.gradle.kts new file mode 100644 index 000000000..09f064aed --- /dev/null +++ b/buildSrc/src/main/kotlin/buildsrc/convention/android-application.gradle.kts @@ -0,0 +1,50 @@ +package buildsrc.convention + +import org.gradle.jvm.tasks.Jar + +plugins { + id("com.android.application") + + kotlin("android") + kotlin("kapt") + kotlin("plugin.allopen") + + id("org.jetbrains.dokka") + + id("buildsrc.convention.base") +} + +android { + compileSdkVersion = "android-32" + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_1_8.toString() + } + + lint { + abortOnError = false + disable += "InvalidPackage" + warning += "NewApi" + } + + packagingOptions { + resources { + excludes += "META-INF/main.kotlin_module" + } + } + + defaultConfig { + minSdk = 26 + targetSdk = 32 + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } +} + +val javadocJar by tasks.registering(Jar::class) { + from(tasks.dokkaJavadoc) + archiveClassifier.set("javadoc") +} diff --git a/buildSrc/src/main/kotlin/buildsrc/convention/android-library.gradle.kts b/buildSrc/src/main/kotlin/buildsrc/convention/android-library.gradle.kts new file mode 100644 index 000000000..fd9e26055 --- /dev/null +++ b/buildSrc/src/main/kotlin/buildsrc/convention/android-library.gradle.kts @@ -0,0 +1,50 @@ +package buildsrc.convention + +import org.gradle.jvm.tasks.Jar + +plugins { + id("com.android.library") + + kotlin("android") + kotlin("kapt") + kotlin("plugin.allopen") + + id("org.jetbrains.dokka") + + id("buildsrc.convention.base") +} + +android { + compileSdkVersion = "android-32" + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_1_8.toString() + } + + lint { + abortOnError = false + disable += "InvalidPackage" + warning += "NewApi" + } + + packagingOptions { + resources { + excludes += "META-INF/main.kotlin_module" + } + } + + defaultConfig { + minSdk = 26 + targetSdk = 32 + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } +} + +val javadocJar by tasks.registering(Jar::class) { + from(tasks.dokkaJavadoc) + archiveClassifier.set("javadoc") +} diff --git a/buildSrc/src/main/kotlin/buildsrc/convention/base.gradle.kts b/buildSrc/src/main/kotlin/buildsrc/convention/base.gradle.kts new file mode 100644 index 000000000..dea84938b --- /dev/null +++ b/buildSrc/src/main/kotlin/buildsrc/convention/base.gradle.kts @@ -0,0 +1,19 @@ +package buildsrc.convention + +import java.time.Duration + +plugins { + base +} + +description = + "Common build config that can be applied to any project. This should typically be language-independent." + +if (project != rootProject) { + group = rootProject.group + version = rootProject.version +} + +tasks.withType().configureEach { + timeout.set(Duration.ofMinutes(10)) +} diff --git a/buildSrc/src/main/kotlin/buildsrc/convention/kotlin-jvm.gradle.kts b/buildSrc/src/main/kotlin/buildsrc/convention/kotlin-jvm.gradle.kts new file mode 100644 index 000000000..cafa67580 --- /dev/null +++ b/buildSrc/src/main/kotlin/buildsrc/convention/kotlin-jvm.gradle.kts @@ -0,0 +1,35 @@ +package buildsrc.convention + +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + `java-library` + kotlin("jvm") + id("org.jetbrains.dokka") + + id("buildsrc.convention.base") + id("buildsrc.convention.toolchain-jvm") +} + +// note: all subprojects are currently Kotlin Multiplatform, so this convention plugin is unused + +java { + withJavadocJar() + withSourcesJar() +} + +tasks.withType().configureEach { + options.encoding = "UTF-8" +} + +tasks.withType().configureEach { + kotlinOptions.apply { + freeCompilerArgs += listOf("-Xjsr305=strict") + apiVersion = "1.5" + languageVersion = "1.7" + } +} + +tasks.named("javadocJar") { + from(tasks.dokkaJavadoc) +} diff --git a/buildSrc/src/main/kotlin/buildsrc/convention/kotlin-multiplatform.gradle.kts b/buildSrc/src/main/kotlin/buildsrc/convention/kotlin-multiplatform.gradle.kts new file mode 100644 index 000000000..9258aba2e --- /dev/null +++ b/buildSrc/src/main/kotlin/buildsrc/convention/kotlin-multiplatform.gradle.kts @@ -0,0 +1,33 @@ +package buildsrc.convention + +import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget + +plugins { + kotlin("multiplatform") + + id("org.jetbrains.dokka") + + id("buildsrc.convention.base") + id("buildsrc.convention.toolchain-jvm") +} + +kotlin { + targets.configureEach { + compilations.configureEach { + kotlinOptions { + apiVersion = "1.5" + languageVersion = "1.7" + } + } + } + targets.withType().configureEach { + testRuns["test"].executionTask.configure { + useJUnitPlatform() + } + } +} + +val javadocJar by tasks.registering(Jar::class) { + from(tasks.dokkaHtml) + archiveClassifier.set("javadoc") +} diff --git a/buildSrc/src/main/kotlin/buildsrc/convention/mockk-publishing.gradle.kts b/buildSrc/src/main/kotlin/buildsrc/convention/mockk-publishing.gradle.kts new file mode 100644 index 000000000..75d084dc1 --- /dev/null +++ b/buildSrc/src/main/kotlin/buildsrc/convention/mockk-publishing.gradle.kts @@ -0,0 +1,77 @@ +package buildsrc.convention + +import buildsrc.config.createMockKPom +import buildsrc.config.credentialsAction + + +plugins { + `maven-publish` + signing +} + +val sonatypeRepositoryCredentials: Provider> = + providers.credentialsAction("ossrh") + +val sonatypeRepositoryReleaseUrl: Provider = provider { + if (version.toString().endsWith("SNAPSHOT")) { + "https://s01.oss.sonatype.org/content/repositories/snapshots/" + } else { + "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" + } +} + +val signingKeyId: Provider = + providers.gradleProperty("signing.keyId") +val signingKey: Provider = + providers.gradleProperty("signing.key") +val signingPassword: Provider = + providers.gradleProperty("signing.password") +val signingSecretKeyRingFile: Provider = + providers.gradleProperty("signing.secretKeyRingFile") + + +tasks.withType().configureEach { + // Gradle warns about some signing tasks using publishing task outputs without explicit + // dependencies. Here's a quick fix. + dependsOn(tasks.withType()) + mustRunAfter(tasks.withType()) + + doLast { + logger.lifecycle("[task: ${name}] ${publication.groupId}:${publication.artifactId}:${publication.version}") + } +} + +val mavenName: String by project.extra +val mavenDescription: String by project.extra +val localrepo: String by project + +publishing { + repositories { + // publish to local dir, for testing + maven(rootProject.layout.projectDirectory.dir(localrepo)) { + name = "LocalRepo" + } + } + publications.withType().configureEach { + createMockKPom { + name.set(provider { mavenName }) + description.set(provider { mavenDescription }) + } + + artifact(tasks.provider("javadocJar")) + + signing.sign(this) + } +} + +signing { + if (signingKeyId.isPresent() && signingKey.isPresent() && signingPassword.isPresent()) { + logger.debug("[${project.displayName}] Signing is enabled") + useInMemoryPgpKeys(signingKeyId.get(), signingKey.get(), signingPassword.get()) + } +} + +// workaround for https://github.com/gradle/gradle/issues/16543 +inline fun TaskContainer.provider(taskName: String): Provider = + providers.provider { taskName } + .flatMap { named(it) } diff --git a/buildSrc/src/main/kotlin/buildsrc/convention/toolchain-jvm.gradle.kts b/buildSrc/src/main/kotlin/buildsrc/convention/toolchain-jvm.gradle.kts new file mode 100644 index 000000000..c717708e6 --- /dev/null +++ b/buildSrc/src/main/kotlin/buildsrc/convention/toolchain-jvm.gradle.kts @@ -0,0 +1,72 @@ +package buildsrc.convention + +import org.jetbrains.kotlin.gradle.plugin.KotlinBasePlugin +import org.jetbrains.kotlin.gradle.tasks.UsesKotlinJavaToolchain + + +description = "Set JavaToolchain for compiling main and test code" + + +// Retrieve the JavaToolchainService extension +val javaToolchains: JavaToolchainService = extensions.getByType() + + +val javaToolchainMainVersion = javaLanguageVersion("javaToolchainMainVersion") +val javaToolchainTestVersion = javaLanguageVersion("javaToolchainTestVersion") + + +// The Java Toolchains that will compile/launch *main* code +val javaToolchainMainCompiler: Provider = + javaToolchains.compilerFor { + languageVersion.set(javaToolchainMainVersion) + } +val javaToolchainMainLauncher: Provider = + javaToolchains.launcherFor { + languageVersion.set(javaToolchainMainVersion) + } + + +// The Java Toolchains that wil compile/launch *test* code +val javaToolchainTestCompiler: Provider = + javaToolchains.compilerFor { + languageVersion.set(javaToolchainTestVersion) + } +val javaToolchainTestLauncher: Provider = + javaToolchains.launcherFor { + languageVersion.set(javaToolchainTestVersion) + } + + +plugins.withType().configureEach { + tasks.withType() + .matching { it.name.contains("main", ignoreCase = true) } + .configureEach { + kotlinJavaToolchain.toolchain.use(javaToolchainMainLauncher) + } + tasks.withType() + .matching { it.name.contains("test", ignoreCase = true) } + .configureEach { + kotlinJavaToolchain.toolchain.use(javaToolchainTestLauncher) + } +} + + +plugins.withType().configureEach { + tasks.withType() + .matching { it.name.contains("main", ignoreCase = true) } + .configureEach { + javaCompiler.set(javaToolchainMainCompiler) + } + tasks.withType() + .matching { it.name.contains("test", ignoreCase = true) } + .configureEach { + javaCompiler.set(javaToolchainTestCompiler) + } +} + +/** helper function to create JavaLanguageVersion object from a Gradle property */ +fun Project.javaLanguageVersion( + gradleProperty: String +): Provider = + providers.gradleProperty(gradleProperty) + .map { JavaLanguageVersion.of(it) } diff --git a/client-tests/jvm/build.gradle.kts b/client-tests/jvm/build.gradle.kts deleted file mode 100644 index edbb9d5fe..000000000 --- a/client-tests/jvm/build.gradle.kts +++ /dev/null @@ -1,51 +0,0 @@ -buildscript { - ext { - kotlin_version = "1.7.10" - } - repositories { - mavenCentral() - } - dependencies { - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") - classpath("org.jetbrains.kotlin:kotlin-allopen:$kotlin_version") - } -} - -plugins { - kotlin("jvm") version "1.7.10" -} - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} - -configurations.all({ - resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS) - resolutionStrategy.cacheDynamicVersionsFor(0, TimeUnit.SECONDS) -}) - -repositories { - mavenLocal() - maven(url = "https://oss.sonatype.org/content/repositories/snapshots") - mavenCentral() -} - -dependencies { - implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version") - implementation("org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version") - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") - testImplementation(project(":mockk-jvm")) - - testImplementation("org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version") { - exclude(group = "junit", module = "junit") - } - - testImplementation("org.slf4j:slf4j-api:1.7.36") - testImplementation("ch.qos.logback:logback-classic:1.2.11") - - compileOnly("org.junit.jupiter:junit-jupiter-api:$junit_jupiter_version") - testImplementation("org.junit.jupiter:junit-jupiter-api:$junit_jupiter_version") - testImplementation("org.junit.jupiter:junit-jupiter-engine:$junit_jupiter_version") - testImplementation("org.junit.vintage:junit-vintage-engine:$junit_vintage_version") -} diff --git a/wiki/dispatcher-handlers.png b/doc/wiki/dispatcher-handlers.png similarity index 100% rename from wiki/dispatcher-handlers.png rename to doc/wiki/dispatcher-handlers.png diff --git a/dsl/common/build.gradle.kts b/dsl/common/build.gradle.kts deleted file mode 100644 index f508abede..000000000 --- a/dsl/common/build.gradle.kts +++ /dev/null @@ -1,14 +0,0 @@ -plugins { - id("mpp-common") -} - -extra["mavenName"] = "MockK DSL common" -extra["mavenDescription"] = "Common(JS and Java) MockK DSL providing API for MockK implementation" - -apply(from = "${rootProject.extensions.extraProperties["gradles"]}/additional-archives.gradle") -apply(from = "${rootProject.extensions.extraProperties["gradles"]}/upload.gradle") - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} diff --git a/dsl/js/build.gradle.kts b/dsl/js/build.gradle.kts deleted file mode 100644 index e5c4abc8d..000000000 --- a/dsl/js/build.gradle.kts +++ /dev/null @@ -1,31 +0,0 @@ -import io.mockk.dependencies.Deps - -plugins { - id("mpp-js") -} - -extra["mavenName"] = "JS MockK DSL" -extra["mavenDescription"] = "JS MockK DSL providing API for MockK implementation" - -apply from: "${rootProject.extensions.extraProperties["gradles"]}/additional-archives.gradle" -apply from: "${rootProject.extensions.extraProperties["gradles"]}/upload.gradle" - -dependencies { - expectedBy(project(":mockk-dsl")) - compileOnly(Deps.Libs.kotlinCoroutinesCoreJs()) -} - -tasks { - val sourcesJar by creating(Jar::class) { - dependsOn(JavaPlugin.CLASSES_TASK_NAME) - archiveClassifier.set("sources") - from(sourceSets["main"].allSource) - from(project(":mockk-dsl").sourceSets["main"].allJava.files) { - exclude("io/mockk/InternalPlatformDsl.kt") - exclude("io/mockk/MockKSettings.kt") - } - } - artifacts { - add("archives", sourcesJar) - } -} diff --git a/dsl/jvm/build.gradle.kts b/dsl/jvm/build.gradle.kts deleted file mode 100644 index f1a63b8e6..000000000 --- a/dsl/jvm/build.gradle.kts +++ /dev/null @@ -1,36 +0,0 @@ -import io.mockk.dependencies.Deps -import io.mockk.dependencies.kotlinVersion - -plugins { - id("mpp-jvm") -} - -extra["mavenName"] = "Java MockK DSL" -extra["mavenDescription"] = "Java MockK DSL providing API for MockK implementation" - -apply(from = "${rootProject.extensions.extraProperties["gradles"]}/jacoco.gradle") -apply(from = "${rootProject.extensions.extraProperties["gradles"]}/additional-archives.gradle") -apply(from = "${rootProject.extensions.extraProperties["gradles"]}/upload.gradle") - -dependencies { - expectedBy(project(":mockk-dsl")) - implementation(Deps.Libs.kotlinReflect(kotlinVersion())) - compileOnly(Deps.Libs.kotlinCoroutinesCore()) -} - -evaluationDependsOn(":mockk-dsl") - -tasks { - val sourcesJar by creating(Jar::class) { - dependsOn(JavaPlugin.CLASSES_TASK_NAME) - archiveClassifier.set("sources") - from(sourceSets["main"].allSource) - from(project(":mockk-dsl").sourceSets["main"].allJava.files) { - exclude("io/mockk/InternalPlatformDsl.kt") - exclude("io/mockk/MockKSettings.kt") - } - } - artifacts { - add("archives", sourcesJar) - } -} diff --git a/gradle.properties b/gradle.properties index 37d69013f..030492b47 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,11 @@ org.gradle.parallel=true # disable annoying Gradle Welcome in CI/CD org.gradle.welcome=never org.gradle.jvmargs=-XX:MaxMetaspaceSize=768m -# localrepo=build/mockk-repo -localrepo=/Users/raibaz/.m2/repository +kotlin.mpp.stability.nowarn=true +localrepo=build/maven-local-repo kotlin.version=1.7.10 android.useAndroidX=true +# version of Java that will be used to build the project +javaToolchainMainVersion=11 +# the Java version tests will run against - this is overridden in the GitHub actions +javaToolchainTestVersion=11 diff --git a/gradle/additional-archives.gradle b/gradle/additional-archives.gradle deleted file mode 100644 index 5572948b8..000000000 --- a/gradle/additional-archives.gradle +++ /dev/null @@ -1,21 +0,0 @@ - -afterEvaluate { - if (!project.tasks.findByName('javadocJar')) { - task javadocJar(type: Jar) { - archiveClassifier.set('javadoc') - from "$buildDir/no-javadocs" - } - } - - if (!project.tasks.findByName('sourcesJar')) { - task sourcesJar(type: Jar) { - archiveClassifier.set('sources') - from sourceSets.main.allSource - } - } - - artifacts { - archives javadocJar - archives sourcesJar - } -} \ No newline at end of file diff --git a/gradle/detect-android-sdk.gradle b/gradle/detect-android-sdk.gradle deleted file mode 100644 index 008214f29..000000000 --- a/gradle/detect-android-sdk.gradle +++ /dev/null @@ -1,57 +0,0 @@ -def pathExists(String envPath) { - if (envPath != null && !envPath.empty) { - return file(envPath).exists() - } - - return false -} - -def setPropPath(Properties props, String prop, String path) { - if (!file(path).isDirectory()) return - if (props.hasProperty(prop)) return - props[prop] = path -} - -def propsPath = file("../local.properties") -def props = new Properties() - -if (propsPath.isFile()) { - props.load(new FileReader(propsPath)) -} - -ext.hasAndroidSdk = false -String newAndroidSdkPath = null -if (props.containsKey("sdk.dir")) { - ext.hasAndroidSdk = true -} else if (pathExists(System.env.ANDROID_HOME)) { - newAndroidSdkPath = System.env.ANDROID_HOME -} else if (pathExists(System.env.ANDROID_SDK_ROOT)) { - newAndroidSdkPath = System.env.ANDROID_SDK_ROOT -} else if (pathExists(System.env.HOME + "/Android/Sdk")) { - newAndroidSdkPath = System.env.HOME + "/Android/Sdk" -} - -if (newAndroidSdkPath != null) { - setPropPath(props, "sdk.dir", newAndroidSdkPath) - - def oldProps = new Properties(props) - - if (props != oldProps) { - def writer = new FileWriter(propsPath) - try { - props.store(writer, "generated by 'detect-android-sdk.gradle'") - } finally { - writer.close() - } - } - - ext.hasAndroidSdk = true -} - -if (ext.hasAndroidSdk != true){ - println '''\ -[WARNING] Skipping build of Android related modules because Android SDK has not been found! - Define Android SDK location in 'local.properties' file or with ANDROID_HOME - environment variable to build Android modules -''' -} diff --git a/gradle/jacoco.gradle b/gradle/jacoco.gradle deleted file mode 100644 index 550eeb19b..000000000 --- a/gradle/jacoco.gradle +++ /dev/null @@ -1,26 +0,0 @@ -apply plugin: 'jacoco' - -jacoco { - toolVersion = "0.8.8" -} - -afterEvaluate { - jacocoTestReport { - reports { - xml.required = true - html.required = true - } - afterEvaluate { - classDirectories.from(files(classDirectories.files.collect { - fileTree(dir: it, exclude: [ - 'io/mockk/APIKt.class', - 'io/mockk/CapturingSlot.class', - 'io/mockk/LambdaArgs.class', - 'io/mockk/MockK**Scope**.class' - ]) - })) - } - } - - check.dependsOn jacocoTestReport -} diff --git a/gradle/upload.gradle b/gradle/upload.gradle deleted file mode 100644 index d128b0baf..000000000 --- a/gradle/upload.gradle +++ /dev/null @@ -1,91 +0,0 @@ -apply plugin: 'maven-publish' - -afterEvaluate { - publishing { - publications { - mavenJava(MavenPublication) { - if (components.findByName("kotlin") != null) { - from components["kotlin"] - artifact tasks['sourcesJar'] - try { - artifact tasks['javadocJar'] - } catch (UnknownTaskException ignored) { - } - } else if (components.findByName("release") != null) { - from components["release"] - artifact tasks.register("androidSourcesJar", Jar.class) { - archiveClassifier.set("sources") - from android.sourceSets.main.java.srcDirs - } - try { - artifact tasks['javadocJar'] - } catch (UnknownTaskException ignored) { - } - } else { - throw new RuntimeException("missing components to publish") - } - - pom { - name = mavenName - description = mavenDescription - url = 'https://mockk.io' - - scm { - connection = 'scm:git:git@github.com:mockk/mockk.git' - developerConnection = 'scm:git:git@github.com:mockk/mockk.git' - url = 'https://github.com/mockk/mockk/' - } - - developers { - developer { - id = 'oleksiyp' - name = 'Oleksii Pylypenko' - email = 'oleksiy.pylypenko@gmail.com' - } - developer { - id = 'Raibaz' - name = 'Mattia Tommasone' - email = 'raibaz@gmail.com' - } - } - - licenses { - license { - name = 'Apache License, Version 2.0' - url = 'https://www.apache.org/licenses/LICENSE-2.0' - } - } - } - } - } - repositories { - maven { - if (project.hasProperty('localrepo')) { - url = rootProject.properties['localrepo'] - } else if (version.endsWith('SNAPSHOT')) { - url = "https://oss.sonatype.org/content/repositories/snapshots/" - credentials { - username = rootProject.properties['ossrhUsername'] ?: '' - password = rootProject.properties['ossrhPassword'] ?: '' - } - } else { - url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" - credentials { - username = rootProject.properties['ossrhUsername'] ?: '' - password = rootProject.properties['ossrhPassword'] ?: '' - } - } - } - } - } - - if (!project.hasProperty('localrepo')) { - if (!project.hasProperty('signing.keyId')) { - throw new RuntimeException('missing signing.keyId to sign archives') - } - apply plugin: 'signing' - signing { - sign publishing.publications.mavenJava - } - } -} diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8049c684f..8fad3f5a9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/mockk/android/build.gradle.kts b/mockk/android/build.gradle.kts deleted file mode 100644 index ea3b74985..000000000 --- a/mockk/android/build.gradle.kts +++ /dev/null @@ -1,72 +0,0 @@ -import io.mockk.dependencies.Deps -import io.mockk.dependencies.kotlinVersion - -plugins { - id("mpp-android") -} - -extra["mavenName"] = "MockK Android" -extra["mavenDescription"] = "mocking library for Kotlin (Android instrumented test)" - -apply(from = "${rootProject.extensions.extraProperties["gradles"]}/upload.gradle") - -android { - compileSdkVersion("android-31") - - - lintOptions { - isAbortOnError = false - disable("InvalidPackage") - warning("NewApi") - } - - packagingOptions { - exclude("META-INF/main.kotlin_module") - exclude("META-INF/LICENSE.md") - exclude("META-INF/LICENSE-notice.md") - } - - defaultConfig { - minSdk = 26 - targetSdk = 32 - testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner" - testInstrumentationRunnerArguments - testInstrumentationRunnerArguments["notAnnotation"] = "io.mockk.test.SkipInstrumentedAndroidTest" - } - - sourceSets { - getByName("androidTest").assets.srcDirs("$projectDir/common/src/test/kotlin") - } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - -} - -// very weird hack to make it working in IDE (check settings.gradle) -val mockKProject = findProject(":mockk-jvm")?.project ?: project(":mockk") - -dependencies { - api(project(":${mockKProject.name}")) { - exclude(group = "io.mockk", module = "mockk-agent-jvm") - } - implementation(project(":mockk-agent-android")) - implementation(project(":mockk-agent-api")) - - testImplementation("junit:junit:4.13.1") - androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0") { - exclude(group = "com.android.support", module = "support-annotations") - } - androidTestImplementation(Deps.Libs.kotlinReflect(kotlinVersion())) - androidTestImplementation(Deps.Libs.kotlinCoroutinesCore()) - androidTestImplementation(Deps.Libs.kotlinTestJunit()) { - exclude(group = "junit", module = "junit") - } - androidTestImplementation("androidx.test:rules:1.4.0") - - androidTestImplementation(Deps.Libs.junitJupiterApi) - androidTestImplementation(Deps.Libs.junitJupiterEngine) - androidTestImplementation(Deps.Libs.junitVintageEngine) -} diff --git a/mockk/common/build.gradle.kts b/mockk/common/build.gradle.kts deleted file mode 100644 index d04789282..000000000 --- a/mockk/common/build.gradle.kts +++ /dev/null @@ -1,18 +0,0 @@ -plugins { - id("mpp-common") -} - -extra["mavenName"] = "MockK common" -extra["mavenDescription"] = "Common(JS and Java) MockK module" - -apply(from = "${rootProject.extensions.extraProperties["gradles"]}/additional-archives.gradle") -apply(from = "${rootProject.extensions.extraProperties["gradles"]}/upload.gradle") - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} - -dependencies { - api(project(":mockk-dsl")) -} diff --git a/mockk/js/build.gradle b/mockk/js/build.gradle deleted file mode 100644 index 40ce0c0ea..000000000 --- a/mockk/js/build.gradle +++ /dev/null @@ -1,57 +0,0 @@ -plugins { - id("mpp-js") - id("com.moowork.node") version "1.2.0" -} - -ext { - mavenName = 'MockK JS' - mavenDescription = 'mocking library for Kotlin (JS)' -} - -apply from: "${gradles}/additional-archives.gradle" -apply from: "${gradles}/upload.gradle" - - -dependencies { - expectedBy project(":mockk-common") - api project(":mockk-dsl-js") -} - -task sourcesJar(type: Jar) { - archiveClassifier.set('sources') - from sourceSets.main.allSource - from(project(':mockk-common').sourceSets.main.allSource) { - exclude "io/mockk/impl/InternalPlatform.kt" - } -} - -artifacts { - archives sourcesJar -} - -task populateNodeModules(type: Copy, dependsOn: compileKotlin2Js) { - from compileKotlin2Js.destinationDir - - configurations.testCompile.each { - from zipTree(it.absolutePath).matching { include '*.js' } - } - - into "${buildDir}/node_modules" -} - -node { - download = true -} - -task installMocha(type: NpmTask) { - args = ['install', 'mocha'] - workingDir = file("${buildDir}/node_modules") -} - -task runMocha(type: NodeTask, dependsOn: [compileTestKotlin2Js, populateNodeModules, installMocha]) { - script = file("${buildDir}/node_modules/mocha/bin/mocha") - args = [compileTestKotlin2Js.outputs.files[0]] -} - -test.dependsOn runMocha - diff --git a/mockk/jvm/build.gradle.kts b/mockk/jvm/build.gradle.kts deleted file mode 100644 index 672d6ef63..000000000 --- a/mockk/jvm/build.gradle.kts +++ /dev/null @@ -1,43 +0,0 @@ -import io.mockk.dependencies.Deps -import io.mockk.dependencies.kotlinVersion - -plugins { - id("mpp-jvm") -} - -extra["mavenName"] = "MockK" -extra["mavenDescription"] = "mocking library for Kotlin" - -apply(from = "${rootProject.extensions.extraProperties["gradles"]}/jacoco.gradle") -apply(from = "${rootProject.extensions.extraProperties["gradles"]}/additional-archives.gradle") -apply(from = "${rootProject.extensions.extraProperties["gradles"]}/upload.gradle") - -dependencies { - expectedBy(project(":mockk-common")) - api(project(":mockk-dsl-jvm")) - implementation(project(":mockk-agent-jvm")) - - implementation(Deps.Libs.kotlinReflect(kotlinVersion())) - compileOnly(Deps.Libs.kotlinCoroutinesCore()) - compileOnly("org.slf4j:slf4j-api:1.7.36") - compileOnly("junit:junit:4.13.2") - - testImplementation(Deps.Libs.kotlinCoroutinesCore()) -} - -evaluationDependsOn(":mockk-common") -tasks { - val sourcesJar by creating(Jar::class) { - archiveClassifier.set("sources") - from(sourceSets["main"].allSource) - /*from(project(":mockk-dsl").sourceSets["main"].allJava.files) { - exclude("io/mockk/impl/InternalPlatform.kt") - exclude("io/mockk/impl/annotations/AdditionalInterface.kt") - exclude("io/mockk/MockK.kt") - }*/ - } -} - -base { - archivesBaseName = "mockk" -} diff --git a/modules/client-tests/build.gradle.kts b/modules/client-tests/build.gradle.kts new file mode 100644 index 000000000..185cdf2cf --- /dev/null +++ b/modules/client-tests/build.gradle.kts @@ -0,0 +1,41 @@ +plugins { + buildsrc.convention.`kotlin-multiplatform` +} + +kotlin { + jvm() + + sourceSets { + val commonMain by getting { + dependencies { + implementation(dependencies.platform(kotlin("bom"))) + implementation(kotlin("reflect")) + + implementation(dependencies.platform(buildsrc.config.Deps.Libs.kotlinCoroutinesBom)) + implementation(buildsrc.config.Deps.Libs.kotlinCoroutinesCore) + } + } + + val commonTest by getting { + dependencies { + implementation(projects.modules.mockk) + + implementation(kotlin("test-junit5")) + } + } + + val jvmMain by getting { + dependencies { + } + } + + val jvmTest by getting { + dependencies { + implementation(buildsrc.config.Deps.Libs.slfj) + implementation(buildsrc.config.Deps.Libs.logback) + + implementation(buildsrc.config.Deps.Libs.junitJupiter) + } + } + } +} diff --git a/client-tests/jvm/src/test/kotlin/io/mockk/test/AnotherClientTest.kt b/modules/client-tests/src/jvmTest/kotlin/io/mockk/test/AnotherClientTest.kt similarity index 100% rename from client-tests/jvm/src/test/kotlin/io/mockk/test/AnotherClientTest.kt rename to modules/client-tests/src/jvmTest/kotlin/io/mockk/test/AnotherClientTest.kt diff --git a/client-tests/jvm/src/test/kotlin/io/mockk/test/BasicClientTest.kt b/modules/client-tests/src/jvmTest/kotlin/io/mockk/test/BasicClientTest.kt similarity index 100% rename from client-tests/jvm/src/test/kotlin/io/mockk/test/BasicClientTest.kt rename to modules/client-tests/src/jvmTest/kotlin/io/mockk/test/BasicClientTest.kt diff --git a/client-tests/jvm/src/test/kotlin/io/mockk/test/CompileTimeTest.kt b/modules/client-tests/src/jvmTest/kotlin/io/mockk/test/CompileTimeTest.kt similarity index 100% rename from client-tests/jvm/src/test/kotlin/io/mockk/test/CompileTimeTest.kt rename to modules/client-tests/src/jvmTest/kotlin/io/mockk/test/CompileTimeTest.kt diff --git a/modules/mockk-agent-android-dispatcher/api/mockk-agent-android-dispatcher.api b/modules/mockk-agent-android-dispatcher/api/mockk-agent-android-dispatcher.api new file mode 100644 index 000000000..e12986517 --- /dev/null +++ b/modules/mockk-agent-android-dispatcher/api/mockk-agent-android-dispatcher.api @@ -0,0 +1,18 @@ +public class io/mockk/proxy/android/AndroidMockKDispatcher { + public static fun get (Ljava/lang/String;Ljava/lang/Object;)Lio/mockk/proxy/android/AndroidMockKDispatcher; + public fun getOrigin (Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/reflect/Method; + public fun handle (Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/util/concurrent/Callable; + public fun handleConstructor (Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;)Ljava/util/concurrent/Callable; + public fun isMock (Ljava/lang/Object;)Z + public static fun set (Ljava/lang/String;Ljava/lang/Object;)V +} + +public final class io/mockk/proxy/android/dispatcher/BuildConfig { + public static final field APPLICATION_ID Ljava/lang/String; + public static final field BUILD_TYPE Ljava/lang/String; + public static final field DEBUG Z + public static final field VERSION_CODE I + public static final field VERSION_NAME Ljava/lang/String; + public fun ()V +} + diff --git a/modules/mockk-agent-android-dispatcher/build.gradle.kts b/modules/mockk-agent-android-dispatcher/build.gradle.kts new file mode 100644 index 000000000..6bff383b6 --- /dev/null +++ b/modules/mockk-agent-android-dispatcher/build.gradle.kts @@ -0,0 +1,31 @@ +import buildsrc.config.androidClassesDexAttributes +import buildsrc.config.asProvider +import com.android.build.gradle.internal.tasks.DexMergingTask + +plugins { + buildsrc.convention.`android-application` +} + +@Suppress("UnstableApiUsage") +android { + defaultConfig { + applicationId = "com.android.dexmaker.mockito.inline.dispatcher" + versionCode = 1 + } +} + +val androidClassesDexProvider by configurations.registering { + description = "Provide an Android classes.dex" + asProvider() + androidClassesDexAttributes() + + outgoing.artifact( + tasks.provider("mergeDexRelease") + .map { task -> task.outputDir } + ) +} + +// workaround for https://github.com/gradle/gradle/issues/16543 +inline fun TaskContainer.provider(taskName: String): Provider = + providers.provider { taskName } + .flatMap { named(it) } diff --git a/agent/android/dispatcher/src/main/AndroidManifest.xml b/modules/mockk-agent-android-dispatcher/src/main/AndroidManifest.xml similarity index 100% rename from agent/android/dispatcher/src/main/AndroidManifest.xml rename to modules/mockk-agent-android-dispatcher/src/main/AndroidManifest.xml diff --git a/agent/android/dispatcher/src/main/java/io.mockk.proxy.android/AndroidMockKDispatcher.java b/modules/mockk-agent-android-dispatcher/src/main/java/io.mockk.proxy.android/AndroidMockKDispatcher.java similarity index 100% rename from agent/android/dispatcher/src/main/java/io.mockk.proxy.android/AndroidMockKDispatcher.java rename to modules/mockk-agent-android-dispatcher/src/main/java/io.mockk.proxy.android/AndroidMockKDispatcher.java diff --git a/agent/android/CMakeLists.txt b/modules/mockk-agent-android/CMakeLists.txt similarity index 100% rename from agent/android/CMakeLists.txt rename to modules/mockk-agent-android/CMakeLists.txt diff --git a/agent/android/README.txt b/modules/mockk-agent-android/README.txt similarity index 100% rename from agent/android/README.txt rename to modules/mockk-agent-android/README.txt diff --git a/agent/android/api/mockk-agent-android.api b/modules/mockk-agent-android/api/mockk-agent-android.api similarity index 97% rename from agent/android/api/mockk-agent-android.api rename to modules/mockk-agent-android/api/mockk-agent-android.api index 4ac44056a..7ba2bd2ea 100644 --- a/agent/android/api/mockk-agent-android.api +++ b/modules/mockk-agent-android/api/mockk-agent-android.api @@ -1,4 +1,4 @@ -public final class io/mockk/ValueClassSupportKt { +public final class io/mockk/ValueClassSupportAndroidKt { public static final fun getBoxedClass (Lkotlin/reflect/KClass;)Lkotlin/reflect/KClass; public static final fun getBoxedValue (Ljava/lang/Object;)Ljava/lang/Object; } diff --git a/modules/mockk-agent-android/build.gradle.kts b/modules/mockk-agent-android/build.gradle.kts new file mode 100644 index 000000000..0d0546d6f --- /dev/null +++ b/modules/mockk-agent-android/build.gradle.kts @@ -0,0 +1,74 @@ +import buildsrc.config.androidClassesDexAttributes +import buildsrc.config.asConsumer + +plugins { + buildsrc.convention.`android-library` + + buildsrc.convention.`mockk-publishing` +} + +description = "Android instrumented testing MockK inline mocking agent" + +val mavenName: String by extra("MockK Android Agent") +val mavenDescription: String by extra("${project.description}") + +@Suppress("UnstableApiUsage") +android { + externalNativeBuild { + cmake { + path = file("CMakeLists.txt") + } + } + + sourceSets { + named("main").configure { + resources { + srcDirs(dispatcherJarResPath) + } + } + } + + defaultConfig { + testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunnerArguments["notAnnotation"] = "io.mockk.test.SkipInstrumentedAndroidTest" + ndk { + abiFilters += setOf("armeabi-v7a", "x86", "x86_64", "arm64-v8a") + } + } +} + +val androidClassesDex: Configuration by configurations.creating { + description = "Fetch Android classes.dex files" + asConsumer() + androidClassesDexAttributes() +} + +dependencies { + api(projects.modules.mockkAgentApi) + api(projects.modules.mockkAgent) + + implementation(kotlin("reflect")) + implementation("com.linkedin.dexmaker:dexmaker:${buildsrc.config.Deps.Versions.dexmaker}") + implementation("org.objenesis:objenesis:${buildsrc.config.Deps.Versions.objenesis}") + + androidTestImplementation("androidx.test.espresso:espresso-core:${buildsrc.config.Deps.Versions.androidxEspresso}") { + exclude("com.android.support:support-annotations") + } + + androidTestImplementation(kotlin("test")) + + androidClassesDex(projects.modules.mockkAgentAndroidDispatcher) +} + +val dispatcherJarResPath: Provider = layout.buildDirectory.dir("generated/dispatcher-jar") + +val packageDispatcherJar by tasks.registering(Jar::class) { + group = LifecycleBasePlugin.BUILD_GROUP + from(androidClassesDex.asFileTree) + archiveFileName.set("dispatcher.jar") + destinationDirectory.set(dispatcherJarResPath) +} + +tasks.preBuild { + dependsOn(packageDispatcherJar) +} diff --git a/agent/android/external/jdk/README.txt b/modules/mockk-agent-android/external/jdk/README.txt similarity index 100% rename from agent/android/external/jdk/README.txt rename to modules/mockk-agent-android/external/jdk/README.txt diff --git a/agent/android/external/jdk/jvmti.h b/modules/mockk-agent-android/external/jdk/jvmti.h similarity index 100% rename from agent/android/external/jdk/jvmti.h rename to modules/mockk-agent-android/external/jdk/jvmti.h diff --git a/agent/android/external/slicer/README.txt b/modules/mockk-agent-android/external/slicer/README.txt similarity index 100% rename from agent/android/external/slicer/README.txt rename to modules/mockk-agent-android/external/slicer/README.txt diff --git a/agent/android/external/slicer/bytecode_encoder.cc b/modules/mockk-agent-android/external/slicer/bytecode_encoder.cc similarity index 100% rename from agent/android/external/slicer/bytecode_encoder.cc rename to modules/mockk-agent-android/external/slicer/bytecode_encoder.cc diff --git a/agent/android/external/slicer/code_ir.cc b/modules/mockk-agent-android/external/slicer/code_ir.cc similarity index 100% rename from agent/android/external/slicer/code_ir.cc rename to modules/mockk-agent-android/external/slicer/code_ir.cc diff --git a/agent/android/external/slicer/common.cc b/modules/mockk-agent-android/external/slicer/common.cc similarity index 100% rename from agent/android/external/slicer/common.cc rename to modules/mockk-agent-android/external/slicer/common.cc diff --git a/agent/android/external/slicer/control_flow_graph.cc b/modules/mockk-agent-android/external/slicer/control_flow_graph.cc similarity index 100% rename from agent/android/external/slicer/control_flow_graph.cc rename to modules/mockk-agent-android/external/slicer/control_flow_graph.cc diff --git a/agent/android/external/slicer/debuginfo_encoder.cc b/modules/mockk-agent-android/external/slicer/debuginfo_encoder.cc similarity index 100% rename from agent/android/external/slicer/debuginfo_encoder.cc rename to modules/mockk-agent-android/external/slicer/debuginfo_encoder.cc diff --git a/agent/android/external/slicer/dex_bytecode.cc b/modules/mockk-agent-android/external/slicer/dex_bytecode.cc similarity index 100% rename from agent/android/external/slicer/dex_bytecode.cc rename to modules/mockk-agent-android/external/slicer/dex_bytecode.cc diff --git a/agent/android/external/slicer/dex_format.cc b/modules/mockk-agent-android/external/slicer/dex_format.cc similarity index 100% rename from agent/android/external/slicer/dex_format.cc rename to modules/mockk-agent-android/external/slicer/dex_format.cc diff --git a/agent/android/external/slicer/dex_ir.cc b/modules/mockk-agent-android/external/slicer/dex_ir.cc similarity index 100% rename from agent/android/external/slicer/dex_ir.cc rename to modules/mockk-agent-android/external/slicer/dex_ir.cc diff --git a/agent/android/external/slicer/dex_ir_builder.cc b/modules/mockk-agent-android/external/slicer/dex_ir_builder.cc similarity index 100% rename from agent/android/external/slicer/dex_ir_builder.cc rename to modules/mockk-agent-android/external/slicer/dex_ir_builder.cc diff --git a/agent/android/external/slicer/dex_utf8.cc b/modules/mockk-agent-android/external/slicer/dex_utf8.cc similarity index 100% rename from agent/android/external/slicer/dex_utf8.cc rename to modules/mockk-agent-android/external/slicer/dex_utf8.cc diff --git a/agent/android/external/slicer/export/slicer/arrayview.h b/modules/mockk-agent-android/external/slicer/export/slicer/arrayview.h similarity index 100% rename from agent/android/external/slicer/export/slicer/arrayview.h rename to modules/mockk-agent-android/external/slicer/export/slicer/arrayview.h diff --git a/agent/android/external/slicer/export/slicer/buffer.h b/modules/mockk-agent-android/external/slicer/export/slicer/buffer.h similarity index 100% rename from agent/android/external/slicer/export/slicer/buffer.h rename to modules/mockk-agent-android/external/slicer/export/slicer/buffer.h diff --git a/agent/android/external/slicer/export/slicer/bytecode_encoder.h b/modules/mockk-agent-android/external/slicer/export/slicer/bytecode_encoder.h similarity index 100% rename from agent/android/external/slicer/export/slicer/bytecode_encoder.h rename to modules/mockk-agent-android/external/slicer/export/slicer/bytecode_encoder.h diff --git a/agent/android/external/slicer/export/slicer/chronometer.h b/modules/mockk-agent-android/external/slicer/export/slicer/chronometer.h similarity index 100% rename from agent/android/external/slicer/export/slicer/chronometer.h rename to modules/mockk-agent-android/external/slicer/export/slicer/chronometer.h diff --git a/agent/android/external/slicer/export/slicer/code_ir.h b/modules/mockk-agent-android/external/slicer/export/slicer/code_ir.h similarity index 100% rename from agent/android/external/slicer/export/slicer/code_ir.h rename to modules/mockk-agent-android/external/slicer/export/slicer/code_ir.h diff --git a/agent/android/external/slicer/export/slicer/common.h b/modules/mockk-agent-android/external/slicer/export/slicer/common.h similarity index 100% rename from agent/android/external/slicer/export/slicer/common.h rename to modules/mockk-agent-android/external/slicer/export/slicer/common.h diff --git a/agent/android/external/slicer/export/slicer/control_flow_graph.h b/modules/mockk-agent-android/external/slicer/export/slicer/control_flow_graph.h similarity index 100% rename from agent/android/external/slicer/export/slicer/control_flow_graph.h rename to modules/mockk-agent-android/external/slicer/export/slicer/control_flow_graph.h diff --git a/agent/android/external/slicer/export/slicer/debuginfo_encoder.h b/modules/mockk-agent-android/external/slicer/export/slicer/debuginfo_encoder.h similarity index 100% rename from agent/android/external/slicer/export/slicer/debuginfo_encoder.h rename to modules/mockk-agent-android/external/slicer/export/slicer/debuginfo_encoder.h diff --git a/agent/android/external/slicer/export/slicer/dex_bytecode.h b/modules/mockk-agent-android/external/slicer/export/slicer/dex_bytecode.h similarity index 100% rename from agent/android/external/slicer/export/slicer/dex_bytecode.h rename to modules/mockk-agent-android/external/slicer/export/slicer/dex_bytecode.h diff --git a/agent/android/external/slicer/export/slicer/dex_format.h b/modules/mockk-agent-android/external/slicer/export/slicer/dex_format.h similarity index 100% rename from agent/android/external/slicer/export/slicer/dex_format.h rename to modules/mockk-agent-android/external/slicer/export/slicer/dex_format.h diff --git a/agent/android/external/slicer/export/slicer/dex_ir.h b/modules/mockk-agent-android/external/slicer/export/slicer/dex_ir.h similarity index 100% rename from agent/android/external/slicer/export/slicer/dex_ir.h rename to modules/mockk-agent-android/external/slicer/export/slicer/dex_ir.h diff --git a/agent/android/external/slicer/export/slicer/dex_ir_builder.h b/modules/mockk-agent-android/external/slicer/export/slicer/dex_ir_builder.h similarity index 100% rename from agent/android/external/slicer/export/slicer/dex_ir_builder.h rename to modules/mockk-agent-android/external/slicer/export/slicer/dex_ir_builder.h diff --git a/agent/android/external/slicer/export/slicer/dex_leb128.h b/modules/mockk-agent-android/external/slicer/export/slicer/dex_leb128.h similarity index 100% rename from agent/android/external/slicer/export/slicer/dex_leb128.h rename to modules/mockk-agent-android/external/slicer/export/slicer/dex_leb128.h diff --git a/agent/android/external/slicer/export/slicer/dex_utf8.h b/modules/mockk-agent-android/external/slicer/export/slicer/dex_utf8.h similarity index 100% rename from agent/android/external/slicer/export/slicer/dex_utf8.h rename to modules/mockk-agent-android/external/slicer/export/slicer/dex_utf8.h diff --git a/agent/android/external/slicer/export/slicer/hash_table.h b/modules/mockk-agent-android/external/slicer/export/slicer/hash_table.h similarity index 100% rename from agent/android/external/slicer/export/slicer/hash_table.h rename to modules/mockk-agent-android/external/slicer/export/slicer/hash_table.h diff --git a/agent/android/external/slicer/export/slicer/index_map.h b/modules/mockk-agent-android/external/slicer/export/slicer/index_map.h similarity index 100% rename from agent/android/external/slicer/export/slicer/index_map.h rename to modules/mockk-agent-android/external/slicer/export/slicer/index_map.h diff --git a/agent/android/external/slicer/export/slicer/instrumentation.h b/modules/mockk-agent-android/external/slicer/export/slicer/instrumentation.h similarity index 100% rename from agent/android/external/slicer/export/slicer/instrumentation.h rename to modules/mockk-agent-android/external/slicer/export/slicer/instrumentation.h diff --git a/agent/android/external/slicer/export/slicer/intrusive_list.h b/modules/mockk-agent-android/external/slicer/export/slicer/intrusive_list.h similarity index 100% rename from agent/android/external/slicer/export/slicer/intrusive_list.h rename to modules/mockk-agent-android/external/slicer/export/slicer/intrusive_list.h diff --git a/agent/android/external/slicer/export/slicer/memview.h b/modules/mockk-agent-android/external/slicer/export/slicer/memview.h similarity index 100% rename from agent/android/external/slicer/export/slicer/memview.h rename to modules/mockk-agent-android/external/slicer/export/slicer/memview.h diff --git a/agent/android/external/slicer/export/slicer/reader.h b/modules/mockk-agent-android/external/slicer/export/slicer/reader.h similarity index 100% rename from agent/android/external/slicer/export/slicer/reader.h rename to modules/mockk-agent-android/external/slicer/export/slicer/reader.h diff --git a/agent/android/external/slicer/export/slicer/scopeguard.h b/modules/mockk-agent-android/external/slicer/export/slicer/scopeguard.h similarity index 100% rename from agent/android/external/slicer/export/slicer/scopeguard.h rename to modules/mockk-agent-android/external/slicer/export/slicer/scopeguard.h diff --git a/agent/android/external/slicer/export/slicer/tryblocks_encoder.h b/modules/mockk-agent-android/external/slicer/export/slicer/tryblocks_encoder.h similarity index 100% rename from agent/android/external/slicer/export/slicer/tryblocks_encoder.h rename to modules/mockk-agent-android/external/slicer/export/slicer/tryblocks_encoder.h diff --git a/agent/android/external/slicer/export/slicer/writer.h b/modules/mockk-agent-android/external/slicer/export/slicer/writer.h similarity index 100% rename from agent/android/external/slicer/export/slicer/writer.h rename to modules/mockk-agent-android/external/slicer/export/slicer/writer.h diff --git a/agent/android/external/slicer/instrumentation.cc b/modules/mockk-agent-android/external/slicer/instrumentation.cc similarity index 100% rename from agent/android/external/slicer/instrumentation.cc rename to modules/mockk-agent-android/external/slicer/instrumentation.cc diff --git a/agent/android/external/slicer/reader.cc b/modules/mockk-agent-android/external/slicer/reader.cc similarity index 100% rename from agent/android/external/slicer/reader.cc rename to modules/mockk-agent-android/external/slicer/reader.cc diff --git a/agent/android/external/slicer/tryblocks_encoder.cc b/modules/mockk-agent-android/external/slicer/tryblocks_encoder.cc similarity index 100% rename from agent/android/external/slicer/tryblocks_encoder.cc rename to modules/mockk-agent-android/external/slicer/tryblocks_encoder.cc diff --git a/agent/android/external/slicer/writer.cc b/modules/mockk-agent-android/external/slicer/writer.cc similarity index 100% rename from agent/android/external/slicer/writer.cc rename to modules/mockk-agent-android/external/slicer/writer.cc diff --git a/agent/android/src/androidTest/java/io/mockk/proxy/android/AndroidMockKProxyMakerTest.java b/modules/mockk-agent-android/src/androidTest/java/io/mockk/proxy/android/AndroidMockKProxyMakerTest.java similarity index 100% rename from agent/android/src/androidTest/java/io/mockk/proxy/android/AndroidMockKProxyMakerTest.java rename to modules/mockk-agent-android/src/androidTest/java/io/mockk/proxy/android/AndroidMockKProxyMakerTest.java diff --git a/agent/android/src/main/AndroidManifest.xml b/modules/mockk-agent-android/src/main/AndroidManifest.xml similarity index 100% rename from agent/android/src/main/AndroidManifest.xml rename to modules/mockk-agent-android/src/main/AndroidManifest.xml diff --git a/agent/android/src/main/java/io/mockk/proxy/android/AndroidMockKMap.java b/modules/mockk-agent-android/src/main/java/io/mockk/proxy/android/AndroidMockKMap.java similarity index 100% rename from agent/android/src/main/java/io/mockk/proxy/android/AndroidMockKMap.java rename to modules/mockk-agent-android/src/main/java/io/mockk/proxy/android/AndroidMockKMap.java diff --git a/agent/android/src/main/jni/mockkjvmtiagent/proxy-agent.cc b/modules/mockk-agent-android/src/main/jni/mockkjvmtiagent/proxy-agent.cc similarity index 100% rename from agent/android/src/main/jni/mockkjvmtiagent/proxy-agent.cc rename to modules/mockk-agent-android/src/main/jni/mockkjvmtiagent/proxy-agent.cc diff --git a/agent/android/src/main/kotlin/io/mockk/ValueClassSupport.kt b/modules/mockk-agent-android/src/main/kotlin/io/mockk/ValueClassSupportAndroid.kt similarity index 100% rename from agent/android/src/main/kotlin/io/mockk/ValueClassSupport.kt rename to modules/mockk-agent-android/src/main/kotlin/io/mockk/ValueClassSupportAndroid.kt diff --git a/agent/android/src/main/kotlin/io/mockk/proxy/android/AndroidMockKAgentFactory.kt b/modules/mockk-agent-android/src/main/kotlin/io/mockk/proxy/android/AndroidMockKAgentFactory.kt similarity index 100% rename from agent/android/src/main/kotlin/io/mockk/proxy/android/AndroidMockKAgentFactory.kt rename to modules/mockk-agent-android/src/main/kotlin/io/mockk/proxy/android/AndroidMockKAgentFactory.kt diff --git a/agent/android/src/main/kotlin/io/mockk/proxy/android/ConstructorProxyMaker.kt b/modules/mockk-agent-android/src/main/kotlin/io/mockk/proxy/android/ConstructorProxyMaker.kt similarity index 100% rename from agent/android/src/main/kotlin/io/mockk/proxy/android/ConstructorProxyMaker.kt rename to modules/mockk-agent-android/src/main/kotlin/io/mockk/proxy/android/ConstructorProxyMaker.kt diff --git a/agent/android/src/main/kotlin/io/mockk/proxy/android/JvmtiAgent.kt b/modules/mockk-agent-android/src/main/kotlin/io/mockk/proxy/android/JvmtiAgent.kt similarity index 100% rename from agent/android/src/main/kotlin/io/mockk/proxy/android/JvmtiAgent.kt rename to modules/mockk-agent-android/src/main/kotlin/io/mockk/proxy/android/JvmtiAgent.kt diff --git a/agent/android/src/main/kotlin/io/mockk/proxy/android/MethodDescriptor.kt b/modules/mockk-agent-android/src/main/kotlin/io/mockk/proxy/android/MethodDescriptor.kt similarity index 100% rename from agent/android/src/main/kotlin/io/mockk/proxy/android/MethodDescriptor.kt rename to modules/mockk-agent-android/src/main/kotlin/io/mockk/proxy/android/MethodDescriptor.kt diff --git a/agent/android/src/main/kotlin/io/mockk/proxy/android/OnjenesisInstantiator.kt b/modules/mockk-agent-android/src/main/kotlin/io/mockk/proxy/android/OnjenesisInstantiator.kt similarity index 100% rename from agent/android/src/main/kotlin/io/mockk/proxy/android/OnjenesisInstantiator.kt rename to modules/mockk-agent-android/src/main/kotlin/io/mockk/proxy/android/OnjenesisInstantiator.kt diff --git a/agent/android/src/main/kotlin/io/mockk/proxy/android/StaticProxyMaker.kt b/modules/mockk-agent-android/src/main/kotlin/io/mockk/proxy/android/StaticProxyMaker.kt similarity index 100% rename from agent/android/src/main/kotlin/io/mockk/proxy/android/StaticProxyMaker.kt rename to modules/mockk-agent-android/src/main/kotlin/io/mockk/proxy/android/StaticProxyMaker.kt diff --git a/agent/android/src/main/kotlin/io/mockk/proxy/android/advice/Advice.kt b/modules/mockk-agent-android/src/main/kotlin/io/mockk/proxy/android/advice/Advice.kt similarity index 100% rename from agent/android/src/main/kotlin/io/mockk/proxy/android/advice/Advice.kt rename to modules/mockk-agent-android/src/main/kotlin/io/mockk/proxy/android/advice/Advice.kt diff --git a/agent/android/src/main/kotlin/io/mockk/proxy/android/transformation/AndroidInlineInstrumentation.kt b/modules/mockk-agent-android/src/main/kotlin/io/mockk/proxy/android/transformation/AndroidInlineInstrumentation.kt similarity index 100% rename from agent/android/src/main/kotlin/io/mockk/proxy/android/transformation/AndroidInlineInstrumentation.kt rename to modules/mockk-agent-android/src/main/kotlin/io/mockk/proxy/android/transformation/AndroidInlineInstrumentation.kt diff --git a/agent/android/src/main/kotlin/io/mockk/proxy/android/transformation/AndroidSubclassInstrumentation.kt b/modules/mockk-agent-android/src/main/kotlin/io/mockk/proxy/android/transformation/AndroidSubclassInstrumentation.kt similarity index 100% rename from agent/android/src/main/kotlin/io/mockk/proxy/android/transformation/AndroidSubclassInstrumentation.kt rename to modules/mockk-agent-android/src/main/kotlin/io/mockk/proxy/android/transformation/AndroidSubclassInstrumentation.kt diff --git a/agent/android/src/main/kotlin/io/mockk/proxy/android/transformation/InliningClassTransformer.kt b/modules/mockk-agent-android/src/main/kotlin/io/mockk/proxy/android/transformation/InliningClassTransformer.kt similarity index 100% rename from agent/android/src/main/kotlin/io/mockk/proxy/android/transformation/InliningClassTransformer.kt rename to modules/mockk-agent-android/src/main/kotlin/io/mockk/proxy/android/transformation/InliningClassTransformer.kt diff --git a/agent/api/api/mockk-agent-api.api b/modules/mockk-agent-api/api-old/mockk-agent-api.api similarity index 100% rename from agent/api/api/mockk-agent-api.api rename to modules/mockk-agent-api/api-old/mockk-agent-api.api diff --git a/agent/common/api/mockk-agent-common.api b/modules/mockk-agent-api/api-old/mockk-agent-common.api similarity index 100% rename from agent/common/api/mockk-agent-common.api rename to modules/mockk-agent-api/api-old/mockk-agent-common.api diff --git a/modules/mockk-agent-api/api/mockk-agent-api.api b/modules/mockk-agent-api/api/mockk-agent-api.api new file mode 100644 index 000000000..781b393a4 --- /dev/null +++ b/modules/mockk-agent-api/api/mockk-agent-api.api @@ -0,0 +1,156 @@ +public abstract interface class io/mockk/proxy/Cancelable { + public abstract fun cancel ()V + public abstract fun get ()Ljava/lang/Object; +} + +public final class io/mockk/proxy/MockKAgentException : java/lang/RuntimeException { + public fun (Ljava/lang/String;)V + public fun (Ljava/lang/String;Ljava/lang/Throwable;)V +} + +public abstract interface class io/mockk/proxy/MockKAgentFactory { + public abstract fun getConstructorProxyMaker ()Lio/mockk/proxy/MockKConstructorProxyMaker; + public abstract fun getInstantiator ()Lio/mockk/proxy/MockKInstantiatior; + public abstract fun getProxyMaker ()Lio/mockk/proxy/MockKProxyMaker; + public abstract fun getStaticProxyMaker ()Lio/mockk/proxy/MockKStaticProxyMaker; + public abstract fun init (Lio/mockk/proxy/MockKAgentLogFactory;)V +} + +public abstract interface class io/mockk/proxy/MockKAgentLogFactory { + public static final field Companion Lio/mockk/proxy/MockKAgentLogFactory$Companion; + public abstract fun logger (Ljava/lang/Class;)Lio/mockk/proxy/MockKAgentLogger; +} + +public final class io/mockk/proxy/MockKAgentLogFactory$Companion { + public final fun getSimpleConsoleLogFactory ()Lio/mockk/proxy/MockKAgentLogFactory; +} + +public abstract interface class io/mockk/proxy/MockKAgentLogger { + public abstract fun debug (Ljava/lang/String;)V + public abstract fun trace (Ljava/lang/String;)V + public abstract fun trace (Ljava/lang/Throwable;Ljava/lang/String;)V + public abstract fun warn (Ljava/lang/String;)V + public abstract fun warn (Ljava/lang/Throwable;Ljava/lang/String;)V +} + +public abstract interface class io/mockk/proxy/MockKConstructorProxyMaker { + public abstract fun constructorProxy (Ljava/lang/Class;Lio/mockk/proxy/MockKInvocationHandler;)Lio/mockk/proxy/Cancelable; +} + +public abstract interface class io/mockk/proxy/MockKInstantiatior { + public abstract fun instance (Ljava/lang/Class;)Ljava/lang/Object; +} + +public abstract interface class io/mockk/proxy/MockKInvocationHandler { + public abstract fun invocation (Ljava/lang/Object;Ljava/lang/reflect/Method;Ljava/util/concurrent/Callable;[Ljava/lang/Object;)Ljava/lang/Object; +} + +public abstract interface class io/mockk/proxy/MockKProxyMaker { + public abstract fun proxy (Ljava/lang/Class;[Ljava/lang/Class;Lio/mockk/proxy/MockKInvocationHandler;ZLjava/lang/Object;)Lio/mockk/proxy/Cancelable; +} + +public abstract interface class io/mockk/proxy/MockKStaticProxyMaker { + public abstract fun staticProxy (Ljava/lang/Class;Lio/mockk/proxy/MockKInvocationHandler;)Lio/mockk/proxy/Cancelable; +} + +public class io/mockk/proxy/common/CancelableResult : io/mockk/proxy/Cancelable { + public fun ()V + public fun (Ljava/lang/Object;Lkotlin/jvm/functions/Function0;)V + public synthetic fun (Ljava/lang/Object;Lkotlin/jvm/functions/Function0;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun alsoOnCancel (Lkotlin/jvm/functions/Function0;)Lio/mockk/proxy/common/CancelableResult; + public fun cancel ()V + public fun get ()Ljava/lang/Object; + public final fun getFired ()Ljava/util/concurrent/atomic/AtomicBoolean; + public final fun withValue (Ljava/lang/Object;)Lio/mockk/proxy/common/CancelableResult; +} + +public final class io/mockk/proxy/common/ProxyInvocationHandler : java/lang/reflect/InvocationHandler { + public static final field Companion Lio/mockk/proxy/common/ProxyInvocationHandler$Companion; + public fun (Lio/mockk/proxy/MockKInvocationHandler;)V + public fun invoke (Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object; +} + +public final class io/mockk/proxy/common/ProxyInvocationHandler$Companion { +} + +public final class io/mockk/proxy/common/ProxyMaker : io/mockk/proxy/MockKProxyMaker { + public static final field Companion Lio/mockk/proxy/common/ProxyMaker$Companion; + public fun (Lio/mockk/proxy/MockKAgentLogger;Lio/mockk/proxy/common/transformation/InlineInstrumentation;Lio/mockk/proxy/common/transformation/SubclassInstrumentation;Lio/mockk/proxy/MockKInstantiatior;Ljava/util/Map;)V + public fun proxy (Ljava/lang/Class;[Ljava/lang/Class;Lio/mockk/proxy/MockKInvocationHandler;ZLjava/lang/Object;)Lio/mockk/proxy/Cancelable; +} + +public final class io/mockk/proxy/common/ProxyMaker$Companion { +} + +public final class io/mockk/proxy/common/transformation/ClassTransformationSpec { + public fun (Ljava/lang/Class;III)V + public synthetic fun (Ljava/lang/Class;IIIILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/Class; + public final fun component2 ()I + public final fun component3 ()I + public final fun component4 ()I + public final fun copy (Ljava/lang/Class;III)Lio/mockk/proxy/common/transformation/ClassTransformationSpec; + public static synthetic fun copy$default (Lio/mockk/proxy/common/transformation/ClassTransformationSpec;Ljava/lang/Class;IIIILjava/lang/Object;)Lio/mockk/proxy/common/transformation/ClassTransformationSpec; + public fun equals (Ljava/lang/Object;)Z + public final fun getCls ()Ljava/lang/Class; + public final fun getConstructorIntercept ()I + public final fun getShouldDoConstructorIntercept ()Z + public final fun getShouldDoSimpleIntercept ()Z + public final fun getShouldDoSomething ()Z + public final fun getShouldDoStaticIntercept ()Z + public final fun getSimpleIntercept ()I + public final fun getStaticIntercept ()I + public fun hashCode ()I + public final fun sameTransforms (Lio/mockk/proxy/common/transformation/ClassTransformationSpec;)Z + public fun toString ()Ljava/lang/String; +} + +public final class io/mockk/proxy/common/transformation/ClassTransformationSpecMap { + public fun ()V + public final fun applyTransformation (Lio/mockk/proxy/common/transformation/TransformationRequest;Lkotlin/jvm/functions/Function1;)V + public final fun get (Ljava/lang/Class;)Lio/mockk/proxy/common/transformation/ClassTransformationSpec; + public final fun shouldTransform (Ljava/lang/Class;)Z + public final fun transformationMap (Lio/mockk/proxy/common/transformation/TransformationRequest;)Ljava/util/Map; +} + +public abstract interface class io/mockk/proxy/common/transformation/InlineInstrumentation { + public abstract fun execute (Lio/mockk/proxy/common/transformation/TransformationRequest;)Lkotlin/jvm/functions/Function0; +} + +public abstract class io/mockk/proxy/common/transformation/RetransformInlineInstrumentation : io/mockk/proxy/common/transformation/InlineInstrumentation { + public fun (Lio/mockk/proxy/MockKAgentLogger;Lio/mockk/proxy/common/transformation/ClassTransformationSpecMap;)V + public fun execute (Lio/mockk/proxy/common/transformation/TransformationRequest;)Lkotlin/jvm/functions/Function0; + protected final fun getLog ()Lio/mockk/proxy/MockKAgentLogger; + protected abstract fun retransform (Ljava/util/Collection;)V +} + +public abstract interface class io/mockk/proxy/common/transformation/SubclassInstrumentation { + public abstract fun setProxyHandler (Ljava/lang/Object;Lio/mockk/proxy/MockKInvocationHandler;)V + public abstract fun subclass (Ljava/lang/Class;[Ljava/lang/Class;)Ljava/lang/Class; +} + +public final class io/mockk/proxy/common/transformation/TransformationRequest { + public fun (Ljava/util/Set;Lio/mockk/proxy/common/transformation/TransformationType;Z)V + public synthetic fun (Ljava/util/Set;Lio/mockk/proxy/common/transformation/TransformationType;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/util/Set; + public final fun component2 ()Lio/mockk/proxy/common/transformation/TransformationType; + public final fun component3 ()Z + public final fun copy (Ljava/util/Set;Lio/mockk/proxy/common/transformation/TransformationType;Z)Lio/mockk/proxy/common/transformation/TransformationRequest; + public static synthetic fun copy$default (Lio/mockk/proxy/common/transformation/TransformationRequest;Ljava/util/Set;Lio/mockk/proxy/common/transformation/TransformationType;ZILjava/lang/Object;)Lio/mockk/proxy/common/transformation/TransformationRequest; + public fun equals (Ljava/lang/Object;)Z + public final fun getClasses ()Ljava/util/Set; + public final fun getType ()Lio/mockk/proxy/common/transformation/TransformationType; + public final fun getUntransform ()Z + public fun hashCode ()I + public final fun reverse ()Lio/mockk/proxy/common/transformation/TransformationRequest; + public fun toString ()Ljava/lang/String; +} + +public final class io/mockk/proxy/common/transformation/TransformationType : java/lang/Enum { + public static final field CONSTRUCTOR Lio/mockk/proxy/common/transformation/TransformationType; + public static final field SIMPLE Lio/mockk/proxy/common/transformation/TransformationType; + public static final field STATIC Lio/mockk/proxy/common/transformation/TransformationType; + public static fun valueOf (Ljava/lang/String;)Lio/mockk/proxy/common/transformation/TransformationType; + public static fun values ()[Lio/mockk/proxy/common/transformation/TransformationType; +} + diff --git a/modules/mockk-agent-api/build.gradle.kts b/modules/mockk-agent-api/build.gradle.kts new file mode 100644 index 000000000..0c985f6dc --- /dev/null +++ b/modules/mockk-agent-api/build.gradle.kts @@ -0,0 +1,38 @@ +import buildsrc.config.Deps + +plugins { + buildsrc.convention.`kotlin-multiplatform` + + buildsrc.convention.`mockk-publishing` +} + +description = "API to build MockK agents" + +val mavenName: String by extra("MockK Agent API") +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 { + } + } + val jvmTest by getting { + dependencies { + implementation(kotlin("test-junit5")) + implementation(Deps.Libs.junitJupiter) + } + } + } +} diff --git a/agent/api/src/main/kotlin/io/mockk/proxy/Cancelable.kt b/modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/Cancelable.kt similarity index 100% rename from agent/api/src/main/kotlin/io/mockk/proxy/Cancelable.kt rename to modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/Cancelable.kt diff --git a/agent/api/src/main/kotlin/io/mockk/proxy/MockKAgentException.kt b/modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/MockKAgentException.kt similarity index 100% rename from agent/api/src/main/kotlin/io/mockk/proxy/MockKAgentException.kt rename to modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/MockKAgentException.kt diff --git a/agent/api/src/main/kotlin/io/mockk/proxy/MockKAgentFactory.kt b/modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/MockKAgentFactory.kt similarity index 100% rename from agent/api/src/main/kotlin/io/mockk/proxy/MockKAgentFactory.kt rename to modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/MockKAgentFactory.kt diff --git a/agent/api/src/main/kotlin/io/mockk/proxy/MockKAgentLogFactory.kt b/modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/MockKAgentLogFactory.kt similarity index 100% rename from agent/api/src/main/kotlin/io/mockk/proxy/MockKAgentLogFactory.kt rename to modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/MockKAgentLogFactory.kt diff --git a/agent/api/src/main/kotlin/io/mockk/proxy/MockKAgentLogger.kt b/modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/MockKAgentLogger.kt similarity index 100% rename from agent/api/src/main/kotlin/io/mockk/proxy/MockKAgentLogger.kt rename to modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/MockKAgentLogger.kt diff --git a/agent/api/src/main/kotlin/io/mockk/proxy/MockKConstructorProxyMaker.kt b/modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/MockKConstructorProxyMaker.kt similarity index 100% rename from agent/api/src/main/kotlin/io/mockk/proxy/MockKConstructorProxyMaker.kt rename to modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/MockKConstructorProxyMaker.kt diff --git a/agent/api/src/main/kotlin/io/mockk/proxy/MockKInstantiatior.kt b/modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/MockKInstantiatior.kt similarity index 100% rename from agent/api/src/main/kotlin/io/mockk/proxy/MockKInstantiatior.kt rename to modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/MockKInstantiatior.kt diff --git a/agent/api/src/main/kotlin/io/mockk/proxy/MockKInvocationHandler.kt b/modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/MockKInvocationHandler.kt similarity index 100% rename from agent/api/src/main/kotlin/io/mockk/proxy/MockKInvocationHandler.kt rename to modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/MockKInvocationHandler.kt diff --git a/agent/api/src/main/kotlin/io/mockk/proxy/MockKProxyMaker.kt b/modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/MockKProxyMaker.kt similarity index 100% rename from agent/api/src/main/kotlin/io/mockk/proxy/MockKProxyMaker.kt rename to modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/MockKProxyMaker.kt diff --git a/agent/api/src/main/kotlin/io/mockk/proxy/MockKStaticProxyMaker.kt b/modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/MockKStaticProxyMaker.kt similarity index 100% rename from agent/api/src/main/kotlin/io/mockk/proxy/MockKStaticProxyMaker.kt rename to modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/MockKStaticProxyMaker.kt diff --git a/agent/common/src/main/kotlin/io/mockk/proxy/common/transformation/InlineInstrumentation.kt b/modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/common/transformation/InlineInstrumentation.kt similarity index 100% rename from agent/common/src/main/kotlin/io/mockk/proxy/common/transformation/InlineInstrumentation.kt rename to modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/common/transformation/InlineInstrumentation.kt diff --git a/agent/common/src/main/kotlin/io/mockk/proxy/common/transformation/SubclassInstrumentation.kt b/modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/common/transformation/SubclassInstrumentation.kt similarity index 100% rename from agent/common/src/main/kotlin/io/mockk/proxy/common/transformation/SubclassInstrumentation.kt rename to modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/common/transformation/SubclassInstrumentation.kt diff --git a/agent/common/src/main/kotlin/io/mockk/proxy/common/transformation/TransformationRequest.kt b/modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/common/transformation/TransformationRequest.kt similarity index 100% rename from agent/common/src/main/kotlin/io/mockk/proxy/common/transformation/TransformationRequest.kt rename to modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/common/transformation/TransformationRequest.kt diff --git a/agent/common/src/main/kotlin/io/mockk/proxy/common/transformation/TransformationType.kt b/modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/common/transformation/TransformationType.kt similarity index 100% rename from agent/common/src/main/kotlin/io/mockk/proxy/common/transformation/TransformationType.kt rename to modules/mockk-agent-api/src/commonMain/kotlin/io/mockk/proxy/common/transformation/TransformationType.kt diff --git a/agent/common/src/main/kotlin/io/mockk/proxy/common/CancelableResult.kt b/modules/mockk-agent-api/src/jvmMain/kotlin/io/mockk/proxy/common/CancelableResult.kt similarity index 100% rename from agent/common/src/main/kotlin/io/mockk/proxy/common/CancelableResult.kt rename to modules/mockk-agent-api/src/jvmMain/kotlin/io/mockk/proxy/common/CancelableResult.kt diff --git a/agent/common/src/main/kotlin/io/mockk/proxy/common/ProxyInvocationHandler.kt b/modules/mockk-agent-api/src/jvmMain/kotlin/io/mockk/proxy/common/ProxyInvocationHandler.kt similarity index 100% rename from agent/common/src/main/kotlin/io/mockk/proxy/common/ProxyInvocationHandler.kt rename to modules/mockk-agent-api/src/jvmMain/kotlin/io/mockk/proxy/common/ProxyInvocationHandler.kt diff --git a/agent/common/src/main/kotlin/io/mockk/proxy/common/ProxyMaker.kt b/modules/mockk-agent-api/src/jvmMain/kotlin/io/mockk/proxy/common/ProxyMaker.kt similarity index 100% rename from agent/common/src/main/kotlin/io/mockk/proxy/common/ProxyMaker.kt rename to modules/mockk-agent-api/src/jvmMain/kotlin/io/mockk/proxy/common/ProxyMaker.kt diff --git a/agent/common/src/main/kotlin/io/mockk/proxy/common/transformation/ClassTransformationSpec.kt b/modules/mockk-agent-api/src/jvmMain/kotlin/io/mockk/proxy/common/transformation/ClassTransformationSpec.kt similarity index 100% rename from agent/common/src/main/kotlin/io/mockk/proxy/common/transformation/ClassTransformationSpec.kt rename to modules/mockk-agent-api/src/jvmMain/kotlin/io/mockk/proxy/common/transformation/ClassTransformationSpec.kt diff --git a/agent/common/src/main/kotlin/io/mockk/proxy/common/transformation/ClassTransformationSpecMap.kt b/modules/mockk-agent-api/src/jvmMain/kotlin/io/mockk/proxy/common/transformation/ClassTransformationSpecMap.kt similarity index 100% rename from agent/common/src/main/kotlin/io/mockk/proxy/common/transformation/ClassTransformationSpecMap.kt rename to modules/mockk-agent-api/src/jvmMain/kotlin/io/mockk/proxy/common/transformation/ClassTransformationSpecMap.kt diff --git a/agent/common/src/main/kotlin/io/mockk/proxy/common/transformation/RetransformInlineInstrumentation.kt b/modules/mockk-agent-api/src/jvmMain/kotlin/io/mockk/proxy/common/transformation/RetransformInlineInstrumentation.kt similarity index 100% rename from agent/common/src/main/kotlin/io/mockk/proxy/common/transformation/RetransformInlineInstrumentation.kt rename to modules/mockk-agent-api/src/jvmMain/kotlin/io/mockk/proxy/common/transformation/RetransformInlineInstrumentation.kt diff --git a/agent/jvm/api/mockk-agent-jvm.api b/modules/mockk-agent/api/mockk-agent.api similarity index 100% rename from agent/jvm/api/mockk-agent-jvm.api rename to modules/mockk-agent/api/mockk-agent.api diff --git a/modules/mockk-agent/build.gradle.kts b/modules/mockk-agent/build.gradle.kts new file mode 100644 index 000000000..a660bc601 --- /dev/null +++ b/modules/mockk-agent/build.gradle.kts @@ -0,0 +1,48 @@ +import buildsrc.config.Deps + +plugins { + buildsrc.convention.`kotlin-multiplatform` + + buildsrc.convention.`mockk-publishing` +} + +description = "MockK inline mocking agent" + +val mavenName: String by extra("MockK") +val mavenDescription: String by extra("${project.description}") + +val byteBuddyVersion = Deps.Versions.byteBuddy +val objenesisVersion = Deps.Versions.objenesis + +kotlin { + jvm { + withJava() + } + + sourceSets { + val commonMain by getting { + dependencies { + api(projects.modules.mockkAgentApi) + implementation(kotlin("reflect")) + } + } + val commonTest by getting { + dependencies { + implementation(kotlin("test-junit5")) + } + } + val jvmMain by getting { + dependencies { + api("org.objenesis:objenesis:$objenesisVersion") + + api("net.bytebuddy:byte-buddy:$byteBuddyVersion") + api("net.bytebuddy:byte-buddy-agent:$byteBuddyVersion") + } + } + val jvmTest by getting { + dependencies { + implementation(Deps.Libs.junitJupiter) + } + } + } +} diff --git a/agent/jvm/src/main/java/io/mockk/proxy/jvm/ClassLoadingStrategyChooser.java b/modules/mockk-agent/src/jvmMain/java/io/mockk/proxy/jvm/ClassLoadingStrategyChooser.java similarity index 100% rename from agent/jvm/src/main/java/io/mockk/proxy/jvm/ClassLoadingStrategyChooser.java rename to modules/mockk-agent/src/jvmMain/java/io/mockk/proxy/jvm/ClassLoadingStrategyChooser.java diff --git a/agent/jvm/src/main/java/io/mockk/proxy/jvm/advice/jvm/JvmMockKConstructorProxyAdvice.java b/modules/mockk-agent/src/jvmMain/java/io/mockk/proxy/jvm/advice/jvm/JvmMockKConstructorProxyAdvice.java similarity index 100% rename from agent/jvm/src/main/java/io/mockk/proxy/jvm/advice/jvm/JvmMockKConstructorProxyAdvice.java rename to modules/mockk-agent/src/jvmMain/java/io/mockk/proxy/jvm/advice/jvm/JvmMockKConstructorProxyAdvice.java diff --git a/agent/jvm/src/main/java/io/mockk/proxy/jvm/advice/jvm/JvmMockKHashMapStaticProxyAdvice.java b/modules/mockk-agent/src/jvmMain/java/io/mockk/proxy/jvm/advice/jvm/JvmMockKHashMapStaticProxyAdvice.java similarity index 100% rename from agent/jvm/src/main/java/io/mockk/proxy/jvm/advice/jvm/JvmMockKHashMapStaticProxyAdvice.java rename to modules/mockk-agent/src/jvmMain/java/io/mockk/proxy/jvm/advice/jvm/JvmMockKHashMapStaticProxyAdvice.java diff --git a/agent/jvm/src/main/java/io/mockk/proxy/jvm/advice/jvm/JvmMockKProxyAdvice.java b/modules/mockk-agent/src/jvmMain/java/io/mockk/proxy/jvm/advice/jvm/JvmMockKProxyAdvice.java similarity index 100% rename from agent/jvm/src/main/java/io/mockk/proxy/jvm/advice/jvm/JvmMockKProxyAdvice.java rename to modules/mockk-agent/src/jvmMain/java/io/mockk/proxy/jvm/advice/jvm/JvmMockKProxyAdvice.java diff --git a/agent/jvm/src/main/java/io/mockk/proxy/jvm/advice/jvm/JvmMockKProxyInterceptor.java b/modules/mockk-agent/src/jvmMain/java/io/mockk/proxy/jvm/advice/jvm/JvmMockKProxyInterceptor.java similarity index 100% rename from agent/jvm/src/main/java/io/mockk/proxy/jvm/advice/jvm/JvmMockKProxyInterceptor.java rename to modules/mockk-agent/src/jvmMain/java/io/mockk/proxy/jvm/advice/jvm/JvmMockKProxyInterceptor.java diff --git a/agent/jvm/src/main/java/io/mockk/proxy/jvm/advice/jvm/JvmMockKStaticProxyAdvice.java b/modules/mockk-agent/src/jvmMain/java/io/mockk/proxy/jvm/advice/jvm/JvmMockKStaticProxyAdvice.java similarity index 100% rename from agent/jvm/src/main/java/io/mockk/proxy/jvm/advice/jvm/JvmMockKStaticProxyAdvice.java rename to modules/mockk-agent/src/jvmMain/java/io/mockk/proxy/jvm/advice/jvm/JvmMockKStaticProxyAdvice.java diff --git a/agent/jvm/src/main/java/io/mockk/proxy/jvm/advice/jvm/MockHandlerMap.kt b/modules/mockk-agent/src/jvmMain/java/io/mockk/proxy/jvm/advice/jvm/MockHandlerMap.kt similarity index 100% rename from agent/jvm/src/main/java/io/mockk/proxy/jvm/advice/jvm/MockHandlerMap.kt rename to modules/mockk-agent/src/jvmMain/java/io/mockk/proxy/jvm/advice/jvm/MockHandlerMap.kt diff --git a/agent/jvm/src/main/java/io/mockk/proxy/jvm/dispatcher/JvmMockKDispatcher.java b/modules/mockk-agent/src/jvmMain/java/io/mockk/proxy/jvm/dispatcher/JvmMockKDispatcher.java similarity index 100% rename from agent/jvm/src/main/java/io/mockk/proxy/jvm/dispatcher/JvmMockKDispatcher.java rename to modules/mockk-agent/src/jvmMain/java/io/mockk/proxy/jvm/dispatcher/JvmMockKDispatcher.java diff --git a/agent/jvm/src/main/java/io/mockk/proxy/jvm/dispatcher/JvmMockKWeakMap.java b/modules/mockk-agent/src/jvmMain/java/io/mockk/proxy/jvm/dispatcher/JvmMockKWeakMap.java similarity index 100% rename from agent/jvm/src/main/java/io/mockk/proxy/jvm/dispatcher/JvmMockKWeakMap.java rename to modules/mockk-agent/src/jvmMain/java/io/mockk/proxy/jvm/dispatcher/JvmMockKWeakMap.java diff --git a/agent/jvm/src/main/kotlin/io/mockk/ValueClassSupport.kt b/modules/mockk-agent/src/jvmMain/kotlin/io/mockk/ValueClassSupport.kt similarity index 100% rename from agent/jvm/src/main/kotlin/io/mockk/ValueClassSupport.kt rename to modules/mockk-agent/src/jvmMain/kotlin/io/mockk/ValueClassSupport.kt diff --git a/agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/ConstructorProxyMaker.kt b/modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/ConstructorProxyMaker.kt similarity index 100% rename from agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/ConstructorProxyMaker.kt rename to modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/ConstructorProxyMaker.kt diff --git a/agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/JvmMockKAgentFactory.kt b/modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/JvmMockKAgentFactory.kt similarity index 100% rename from agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/JvmMockKAgentFactory.kt rename to modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/JvmMockKAgentFactory.kt diff --git a/agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/ObjenesisInstantiator.kt b/modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/ObjenesisInstantiator.kt similarity index 100% rename from agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/ObjenesisInstantiator.kt rename to modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/ObjenesisInstantiator.kt diff --git a/agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/ProxyMaker.kt b/modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/ProxyMaker.kt similarity index 100% rename from agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/ProxyMaker.kt rename to modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/ProxyMaker.kt diff --git a/agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/StaticProxyMaker.kt b/modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/StaticProxyMaker.kt similarity index 100% rename from agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/StaticProxyMaker.kt rename to modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/StaticProxyMaker.kt diff --git a/agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/advice/BaseAdvice.kt b/modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/advice/BaseAdvice.kt similarity index 100% rename from agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/advice/BaseAdvice.kt rename to modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/advice/BaseAdvice.kt diff --git a/agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/advice/Interceptor.kt b/modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/advice/Interceptor.kt similarity index 100% rename from agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/advice/Interceptor.kt rename to modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/advice/Interceptor.kt diff --git a/agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/advice/MethodCall.kt b/modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/advice/MethodCall.kt similarity index 100% rename from agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/advice/MethodCall.kt rename to modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/advice/MethodCall.kt diff --git a/agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/advice/ProxyAdviceId.kt b/modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/advice/ProxyAdviceId.kt similarity index 100% rename from agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/advice/ProxyAdviceId.kt rename to modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/advice/ProxyAdviceId.kt diff --git a/agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/advice/SelfCallEliminator.kt b/modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/advice/SelfCallEliminator.kt similarity index 100% rename from agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/advice/SelfCallEliminator.kt rename to modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/advice/SelfCallEliminator.kt diff --git a/agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/advice/SelfCallEliminatorCallable.kt b/modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/advice/SelfCallEliminatorCallable.kt similarity index 100% rename from agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/advice/SelfCallEliminatorCallable.kt rename to modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/advice/SelfCallEliminatorCallable.kt diff --git a/agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/dispatcher/BootJarLoader.kt b/modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/dispatcher/BootJarLoader.kt similarity index 100% rename from agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/dispatcher/BootJarLoader.kt rename to modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/dispatcher/BootJarLoader.kt diff --git a/agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/transformation/CacheKey.kt b/modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/transformation/CacheKey.kt similarity index 100% rename from agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/transformation/CacheKey.kt rename to modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/transformation/CacheKey.kt diff --git a/agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/transformation/FixParameterNamesVisitor.kt b/modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/transformation/FixParameterNamesVisitor.kt similarity index 100% rename from agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/transformation/FixParameterNamesVisitor.kt rename to modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/transformation/FixParameterNamesVisitor.kt diff --git a/agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/transformation/InliningClassTransformer.kt b/modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/transformation/InliningClassTransformer.kt similarity index 100% rename from agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/transformation/InliningClassTransformer.kt rename to modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/transformation/InliningClassTransformer.kt diff --git a/agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/transformation/JvmInlineInstrumentation.kt b/modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/transformation/JvmInlineInstrumentation.kt similarity index 100% rename from agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/transformation/JvmInlineInstrumentation.kt rename to modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/transformation/JvmInlineInstrumentation.kt diff --git a/agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/transformation/SubclassInstrumentation.kt b/modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/transformation/SubclassInstrumentation.kt similarity index 100% rename from agent/jvm/src/main/kotlin/io/mockk/proxy/jvm/transformation/SubclassInstrumentation.kt rename to modules/mockk-agent/src/jvmMain/kotlin/io/mockk/proxy/jvm/transformation/SubclassInstrumentation.kt diff --git a/agent/jvm/src/test/java/io/mockk/proxy/JvmMockKProxyMakerTest.java b/modules/mockk-agent/src/jvmTest/java/io/mockk/proxy/JvmMockKProxyMakerTest.java similarity index 96% rename from agent/jvm/src/test/java/io/mockk/proxy/JvmMockKProxyMakerTest.java rename to modules/mockk-agent/src/jvmTest/java/io/mockk/proxy/JvmMockKProxyMakerTest.java index b81e69eb4..410468cb3 100644 --- a/agent/jvm/src/test/java/io/mockk/proxy/JvmMockKProxyMakerTest.java +++ b/modules/mockk-agent/src/jvmTest/java/io/mockk/proxy/JvmMockKProxyMakerTest.java @@ -1,10 +1,6 @@ package io.mockk.proxy; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - +import io.mockk.proxy.jvm.JvmMockKAgentFactory; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -14,11 +10,11 @@ import java.util.Arrays; import java.util.List; import java.util.concurrent.Callable; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -import org.junit.Before; -import org.junit.Test; - -import io.mockk.proxy.jvm.JvmMockKAgentFactory; +import static org.junit.jupiter.api.Assertions.*; @SuppressWarnings("unchecked") public class JvmMockKProxyMakerTest { @@ -30,7 +26,7 @@ public class JvmMockKProxyMakerTest { ListAppendingHandler handler; - @Before + @BeforeEach public void setUp() { Arrays.fill(executed, false); handler = new ListAppendingHandler(); @@ -59,7 +55,7 @@ public void openClassProxy() { proxy.a(); - assertFalse(executed[0]); + Assertions.assertFalse(executed[0]); checkProxyHandlerCalled(1, proxy, "a"); } @@ -408,9 +404,9 @@ private void checkProxyHandlerCalled(int nTimes, Object proxy, String methodName } assertEquals( - "Amount of calls differ. Calls:\n" + sb.toString(), nTimes, - handler.calls.size() + handler.calls.size(), + "Amount of calls differ. Calls:\n" + sb ); Call call = handler.calls.get(0); assertSame(proxy, call.self); diff --git a/modules/mockk-android/build.gradle.kts b/modules/mockk-android/build.gradle.kts new file mode 100644 index 000000000..52194884d --- /dev/null +++ b/modules/mockk-android/build.gradle.kts @@ -0,0 +1,53 @@ +import buildsrc.config.Deps + +plugins { + buildsrc.convention.`android-library` + + buildsrc.convention.`mockk-publishing` +} + +description = "Mocking library for Kotlin (Android instrumented test)" + +val mavenName: String by extra("MockK Android") +val mavenDescription: String by extra("${project.description}") + +@Suppress("UnstableApiUsage") +android { + packagingOptions { + resources { + excludes += "META-INF/LICENSE.md" + excludes += "META-INF/LICENSE-notice.md" + } + } + + defaultConfig { + testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunnerArguments["notAnnotation"] = "io.mockk.test.SkipInstrumentedAndroidTest" + } + + sourceSets { + getByName("androidTest").assets.srcDirs("$projectDir/common/src/test/kotlin") + } +} + +dependencies { + implementation(projects.modules.mockk) + implementation(projects.modules.mockkAgentApi) + implementation(projects.modules.mockkAgentAndroid) + + testImplementation("junit:junit:${Deps.Versions.junit4}") + androidTestImplementation("androidx.test.espresso:espresso-core:${Deps.Versions.androidxEspresso}") { + exclude(group = "com.android.support", module = "support-annotations") + } + androidTestImplementation(kotlin("reflect")) + + implementation(platform(Deps.Libs.kotlinCoroutinesBom)) + implementation(Deps.Libs.kotlinCoroutinesCore) + + androidTestImplementation("androidx.test:rules:${Deps.Versions.androidxTestRules}") + + androidTestImplementation(kotlin("test")) + androidTestImplementation(kotlin("test-junit")) + androidTestImplementation(Deps.Libs.junitJupiter) + androidTestImplementation(Deps.Libs.junitVintageEngine) +} diff --git a/mockk/android/src/androidTest/java/TestKeep.java b/modules/mockk-android/src/androidTest/java/TestKeep.java similarity index 100% rename from mockk/android/src/androidTest/java/TestKeep.java rename to modules/mockk-android/src/androidTest/java/TestKeep.java diff --git a/mockk/android/src/androidTest/java/io/mockk/MethodDescriptionTest.kt b/modules/mockk-android/src/androidTest/java/io/mockk/MethodDescriptionTest.kt similarity index 100% rename from mockk/android/src/androidTest/java/io/mockk/MethodDescriptionTest.kt rename to modules/mockk-android/src/androidTest/java/io/mockk/MethodDescriptionTest.kt diff --git a/mockk/android/src/androidTest/java/io/mockk/ait/MockAbstractArgTest.kt b/modules/mockk-android/src/androidTest/java/io/mockk/ait/MockAbstractArgTest.kt similarity index 100% rename from mockk/android/src/androidTest/java/io/mockk/ait/MockAbstractArgTest.kt rename to modules/mockk-android/src/androidTest/java/io/mockk/ait/MockAbstractArgTest.kt diff --git a/mockk/android/src/androidTest/java/io/mockk/ait/PrePTest.kt b/modules/mockk-android/src/androidTest/java/io/mockk/ait/PrePTest.kt similarity index 100% rename from mockk/android/src/androidTest/java/io/mockk/ait/PrePTest.kt rename to modules/mockk-android/src/androidTest/java/io/mockk/ait/PrePTest.kt diff --git a/mockk/android/src/androidTest/java/io/mockk/proxy/android/AndroidMockKAgentFactoryTest.kt b/modules/mockk-android/src/androidTest/java/io/mockk/proxy/android/AndroidMockKAgentFactoryTest.kt similarity index 100% rename from mockk/android/src/androidTest/java/io/mockk/proxy/android/AndroidMockKAgentFactoryTest.kt rename to modules/mockk-android/src/androidTest/java/io/mockk/proxy/android/AndroidMockKAgentFactoryTest.kt diff --git a/mockk/android/src/debug/AndroidManifest.xml b/modules/mockk-android/src/debug/AndroidManifest.xml similarity index 100% rename from mockk/android/src/debug/AndroidManifest.xml rename to modules/mockk-android/src/debug/AndroidManifest.xml diff --git a/mockk/android/src/debug/java/io/mockk/debug/TestActivity.kt b/modules/mockk-android/src/debug/java/io/mockk/debug/TestActivity.kt similarity index 100% rename from mockk/android/src/debug/java/io/mockk/debug/TestActivity.kt rename to modules/mockk-android/src/debug/java/io/mockk/debug/TestActivity.kt diff --git a/mockk/android/src/main/AndroidManifest.xml b/modules/mockk-android/src/main/AndroidManifest.xml similarity index 100% rename from mockk/android/src/main/AndroidManifest.xml rename to modules/mockk-android/src/main/AndroidManifest.xml diff --git a/dsl/jvm/api/mockk-dsl-jvm.api b/modules/mockk-dsl/api/mockk-dsl.api similarity index 99% rename from dsl/jvm/api/mockk-dsl-jvm.api rename to modules/mockk-dsl/api/mockk-dsl.api index 7b26ec1ce..10ced70e5 100644 --- a/dsl/jvm/api/mockk-dsl-jvm.api +++ b/modules/mockk-dsl/api/mockk-dsl.api @@ -311,7 +311,6 @@ public abstract interface class io/mockk/InternalCounter { public final class io/mockk/InternalPlatformDsl { public static final field INSTANCE Lio/mockk/InternalPlatformDsl; - public final fun boxCast (Lkotlin/reflect/KClass;Ljava/lang/Object;)Ljava/lang/Object; public final fun classForName (Ljava/lang/String;)Ljava/lang/Object; public final fun coroutineCall (Lkotlin/jvm/functions/Function1;)Lio/mockk/CoroutineCall; public final fun counter ()Lio/mockk/InternalCounter; @@ -494,6 +493,7 @@ public final class io/mockk/MockKAnswerScope { public final fun getFieldValue ()Ljava/lang/Object; public final fun getFieldValueAny ()Ljava/lang/Object; public final fun getInvocation ()Lio/mockk/Invocation; + public final fun getLambda ()Lio/mockk/CapturingSlot; public final fun getMatcher ()Lio/mockk/InvocationMatcher; public final fun getMethod ()Lio/mockk/MethodDescription; public final fun getNArgs ()I @@ -523,7 +523,6 @@ public final class io/mockk/MockKCancellationRegistry$RegistryPerType { public final fun cancel (Ljava/lang/Object;)V public final fun cancelAll ()V public final fun cancelPut (Ljava/lang/Object;Lkotlin/jvm/functions/Function0;)V - public final fun putIfNotThere (Ljava/lang/Object;Lkotlin/jvm/functions/Function0;)V } public final class io/mockk/MockKCancellationRegistry$Type : java/lang/Enum { @@ -824,6 +823,7 @@ public class io/mockk/MockKMatcherScope { public final fun anyLongVararg ()[J public final fun anyShortVararg ()[S public final fun get (Ljava/lang/Object;Ljava/lang/String;)Lio/mockk/MockKMatcherScope$DynamicCall; + public final fun getCallRecorder ()Lio/mockk/MockKGateway$CallRecorder; public final fun getLambda ()Lio/mockk/CapturingSlot; public final fun getProperty (Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; public final fun hint (Ljava/lang/Object;Lkotlin/reflect/KClass;I)Ljava/lang/Object; diff --git a/modules/mockk-dsl/build.gradle.kts b/modules/mockk-dsl/build.gradle.kts new file mode 100644 index 000000000..4324bd3cf --- /dev/null +++ b/modules/mockk-dsl/build.gradle.kts @@ -0,0 +1,41 @@ +import buildsrc.config.Deps + +plugins { + buildsrc.convention.`kotlin-multiplatform` + + buildsrc.convention.`mockk-publishing` +} + +description = "MockK DSL providing API for MockK implementation" + +val mavenName: String by extra("MockK DSL") +val mavenDescription: String by extra("${project.description}") + +kotlin { + jvm() + + sourceSets { + val commonMain by getting { + dependencies { + implementation(dependencies.platform(Deps.Libs.kotlinCoroutinesBom)) + implementation(Deps.Libs.kotlinCoroutinesCore) + implementation(kotlin("reflect")) + } + } + val commonTest by getting { + dependencies { + implementation(kotlin("test")) + } + } + val jvmMain by getting { + dependencies { + } + } + val jvmTest by getting { + dependencies { + implementation(kotlin("test-junit5")) + implementation(Deps.Libs.junitJupiter) + } + } + } +} diff --git a/dsl/common/src/main/kotlin/io/mockk/API.kt b/modules/mockk-dsl/src/commonMain/kotlin/io/mockk/API.kt similarity index 100% rename from dsl/common/src/main/kotlin/io/mockk/API.kt rename to modules/mockk-dsl/src/commonMain/kotlin/io/mockk/API.kt diff --git a/dsl/common/src/main/kotlin/io/mockk/Answers.kt b/modules/mockk-dsl/src/commonMain/kotlin/io/mockk/Answers.kt similarity index 100% rename from dsl/common/src/main/kotlin/io/mockk/Answers.kt rename to modules/mockk-dsl/src/commonMain/kotlin/io/mockk/Answers.kt diff --git a/dsl/common/src/main/kotlin/io/mockk/GatewayAPI.kt b/modules/mockk-dsl/src/commonMain/kotlin/io/mockk/GatewayAPI.kt similarity index 100% rename from dsl/common/src/main/kotlin/io/mockk/GatewayAPI.kt rename to modules/mockk-dsl/src/commonMain/kotlin/io/mockk/GatewayAPI.kt diff --git a/dsl/common/src/main/kotlin/io/mockk/InternalPlatformDsl.kt b/modules/mockk-dsl/src/commonMain/kotlin/io/mockk/InternalPlatformDsl.kt similarity index 94% rename from dsl/common/src/main/kotlin/io/mockk/InternalPlatformDsl.kt rename to modules/mockk-dsl/src/commonMain/kotlin/io/mockk/InternalPlatformDsl.kt index e55b0d14d..461c3247d 100644 --- a/dsl/common/src/main/kotlin/io/mockk/InternalPlatformDsl.kt +++ b/modules/mockk-dsl/src/commonMain/kotlin/io/mockk/InternalPlatformDsl.kt @@ -44,7 +44,7 @@ expect object InternalPlatformDsl { * * @return [KClass] of boxed value, if this is `value class`, else [cls]. */ - fun unboxClass(cls: KClass<*>): KClass<*> + internal fun unboxClass(cls: KClass<*>): KClass<*> /** * Normally this simply casts [arg] to `T` @@ -52,7 +52,7 @@ expect object InternalPlatformDsl { * However, if `T` is a `value class` (of type [cls]) this will construct a new instance of the * value class, and set [arg] as the value. */ - fun boxCast( + internal fun boxCast( cls: KClass<*>, arg: Any, ): T diff --git a/dsl/common/src/main/kotlin/io/mockk/Matchers.kt b/modules/mockk-dsl/src/commonMain/kotlin/io/mockk/Matchers.kt similarity index 100% rename from dsl/common/src/main/kotlin/io/mockk/Matchers.kt rename to modules/mockk-dsl/src/commonMain/kotlin/io/mockk/Matchers.kt diff --git a/dsl/common/src/main/kotlin/io/mockk/MockKSettings.kt b/modules/mockk-dsl/src/commonMain/kotlin/io/mockk/MockKSettings.kt similarity index 100% rename from dsl/common/src/main/kotlin/io/mockk/MockKSettings.kt rename to modules/mockk-dsl/src/commonMain/kotlin/io/mockk/MockKSettings.kt diff --git a/dsl/js/src/main/kotlin/io/mockk/InternalPlatformDsl.kt b/modules/mockk-dsl/src/jsMain/kotlin/io/mockk/InternalPlatformDsl.kt similarity index 100% rename from dsl/js/src/main/kotlin/io/mockk/InternalPlatformDsl.kt rename to modules/mockk-dsl/src/jsMain/kotlin/io/mockk/InternalPlatformDsl.kt diff --git a/dsl/js/src/main/kotlin/io/mockk/MockKSettings.kt b/modules/mockk-dsl/src/jsMain/kotlin/io/mockk/MockKSettings.kt similarity index 100% rename from dsl/js/src/main/kotlin/io/mockk/MockKSettings.kt rename to modules/mockk-dsl/src/jsMain/kotlin/io/mockk/MockKSettings.kt diff --git a/dsl/jvm/src/main/kotlin/io/mockk/InternalPlatformDsl.kt b/modules/mockk-dsl/src/jvmMain/kotlin/io/mockk/InternalPlatformDsl.kt similarity index 99% rename from dsl/jvm/src/main/kotlin/io/mockk/InternalPlatformDsl.kt rename to modules/mockk-dsl/src/jvmMain/kotlin/io/mockk/InternalPlatformDsl.kt index 1419a1367..7ad64fc0f 100644 --- a/dsl/jvm/src/main/kotlin/io/mockk/InternalPlatformDsl.kt +++ b/modules/mockk-dsl/src/jvmMain/kotlin/io/mockk/InternalPlatformDsl.kt @@ -221,7 +221,7 @@ actual object InternalPlatformDsl { actual fun unboxClass(cls: KClass<*>): KClass<*> = cls.boxedClass @Suppress("UNCHECKED_CAST") - actual fun boxCast( + internal actual fun boxCast( cls: KClass<*>, arg: Any, ): T { diff --git a/dsl/jvm/src/main/kotlin/io/mockk/MockKSettings.kt b/modules/mockk-dsl/src/jvmMain/kotlin/io/mockk/MockKSettings.kt similarity index 100% rename from dsl/jvm/src/main/kotlin/io/mockk/MockKSettings.kt rename to modules/mockk-dsl/src/jvmMain/kotlin/io/mockk/MockKSettings.kt diff --git a/dsl/jvm/src/main/kotlin/io/mockk/ValueClassSupportDsl.kt b/modules/mockk-dsl/src/jvmMain/kotlin/io/mockk/ValueClassSupportDsl.kt similarity index 100% rename from dsl/jvm/src/main/kotlin/io/mockk/ValueClassSupportDsl.kt rename to modules/mockk-dsl/src/jvmMain/kotlin/io/mockk/ValueClassSupportDsl.kt diff --git a/mockk/jvm/api/mockk-jvm.api b/modules/mockk/api/mockk.api similarity index 100% rename from mockk/jvm/api/mockk-jvm.api rename to modules/mockk/api/mockk.api diff --git a/modules/mockk/build.gradle.kts b/modules/mockk/build.gradle.kts new file mode 100644 index 000000000..06c30e2be --- /dev/null +++ b/modules/mockk/build.gradle.kts @@ -0,0 +1,51 @@ +import buildsrc.config.Deps + +plugins { + buildsrc.convention.`kotlin-multiplatform` + + buildsrc.convention.`mockk-publishing` +} + +description = "Mocking library for Kotlin" + +val mavenName: String by extra("MockK") +val mavenDescription: String by extra("${project.description}") + +kotlin { + jvm { + withJava() + } + + sourceSets { + val commonMain by getting { + dependencies { + api(projects.modules.mockkDsl) + implementation(projects.modules.mockkAgent) + implementation(projects.modules.mockkAgentApi) + + implementation(dependencies.platform(Deps.Libs.kotlinCoroutinesBom)) + implementation(Deps.Libs.kotlinCoroutinesCore) + + implementation(kotlin("reflect")) + } + } + val commonTest by getting { + dependencies { + implementation(kotlin("test-junit5")) + } + } + val jvmMain by getting { + dependencies { + implementation(Deps.Libs.slfj) + + implementation(Deps.Libs.junit4) + implementation(Deps.Libs.junitJupiter) + } + } + val jvmTest by getting { + dependencies { + implementation(Deps.Libs.junitJupiter) + } + } + } +} diff --git a/mockk/common/src/main/kotlin/io/mockk/MockK.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/MockK.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/MockK.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/MockK.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/InternalPlatform.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/InternalPlatform.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/InternalPlatform.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/InternalPlatform.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/annotations/AdditionalInterface.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/annotations/AdditionalInterface.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/annotations/AdditionalInterface.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/annotations/AdditionalInterface.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/annotations/InjectMockKs.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/annotations/InjectMockKs.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/annotations/InjectMockKs.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/annotations/InjectMockKs.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/annotations/MockK.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/annotations/MockK.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/annotations/MockK.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/annotations/MockK.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/annotations/RelaxedMockK.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/annotations/RelaxedMockK.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/annotations/RelaxedMockK.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/annotations/RelaxedMockK.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/annotations/SpyK.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/annotations/SpyK.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/annotations/SpyK.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/annotations/SpyK.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/eval/EveryBlockEvaluator.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/eval/EveryBlockEvaluator.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/eval/EveryBlockEvaluator.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/eval/EveryBlockEvaluator.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/eval/ExcludeBlockEvaluator.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/eval/ExcludeBlockEvaluator.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/eval/ExcludeBlockEvaluator.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/eval/ExcludeBlockEvaluator.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/eval/RecordedBlockEvaluator.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/eval/RecordedBlockEvaluator.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/eval/RecordedBlockEvaluator.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/eval/RecordedBlockEvaluator.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/eval/VerifyBlockEvaluator.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/eval/VerifyBlockEvaluator.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/eval/VerifyBlockEvaluator.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/eval/VerifyBlockEvaluator.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/instantiation/AbstractInstantiator.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/instantiation/AbstractInstantiator.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/instantiation/AbstractInstantiator.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/instantiation/AbstractInstantiator.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/instantiation/AbstractMockFactory.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/instantiation/AbstractMockFactory.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/instantiation/AbstractMockFactory.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/instantiation/AbstractMockFactory.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/instantiation/AnyValueGenerator.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/instantiation/AnyValueGenerator.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/instantiation/AnyValueGenerator.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/instantiation/AnyValueGenerator.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/instantiation/CommonInstanceFactoryRegistry.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/instantiation/CommonInstanceFactoryRegistry.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/instantiation/CommonInstanceFactoryRegistry.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/instantiation/CommonInstanceFactoryRegistry.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/instantiation/CommonMockTypeChecker.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/instantiation/CommonMockTypeChecker.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/instantiation/CommonMockTypeChecker.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/instantiation/CommonMockTypeChecker.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/log/FilterLogger.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/log/FilterLogger.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/log/FilterLogger.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/log/FilterLogger.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/log/LogLevel.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/log/LogLevel.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/log/LogLevel.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/log/LogLevel.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/log/Logger.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/log/Logger.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/log/Logger.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/log/Logger.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/log/NoOpLogger.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/log/NoOpLogger.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/log/NoOpLogger.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/log/NoOpLogger.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/log/SafeLogger.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/log/SafeLogger.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/log/SafeLogger.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/log/SafeLogger.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/log/SafeToString.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/log/SafeToString.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/log/SafeToString.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/log/SafeToString.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/platform/CommonIdentityHashMapOf.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/platform/CommonIdentityHashMapOf.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/platform/CommonIdentityHashMapOf.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/platform/CommonIdentityHashMapOf.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/platform/CommonRef.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/platform/CommonRef.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/platform/CommonRef.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/platform/CommonRef.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/platform/Disposable.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/platform/Disposable.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/platform/Disposable.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/platform/Disposable.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/AutoHinter.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/AutoHinter.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/AutoHinter.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/AutoHinter.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/CallRecorderFactories.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/CallRecorderFactories.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/CallRecorderFactories.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/CallRecorderFactories.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/CallRound.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/CallRound.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/CallRound.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/CallRound.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/CallRoundBuilder.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/CallRoundBuilder.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/CallRoundBuilder.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/CallRoundBuilder.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/ChainedCallDetector.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/ChainedCallDetector.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/ChainedCallDetector.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/ChainedCallDetector.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/ChildHinter.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/ChildHinter.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/ChildHinter.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/ChildHinter.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/CommonCallRecorder.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/CommonCallRecorder.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/CommonCallRecorder.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/CommonCallRecorder.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/CommonVerificationAcknowledger.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/CommonVerificationAcknowledger.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/CommonVerificationAcknowledger.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/CommonVerificationAcknowledger.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/PermanentMocker.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/PermanentMocker.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/PermanentMocker.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/PermanentMocker.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/SignatureMatcherDetector.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/SignatureMatcherDetector.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/SignatureMatcherDetector.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/SignatureMatcherDetector.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/SignatureValueGenerator.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/SignatureValueGenerator.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/SignatureValueGenerator.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/SignatureValueGenerator.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/SignedCall.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/SignedCall.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/SignedCall.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/SignedCall.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/SignedMatcher.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/SignedMatcher.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/SignedMatcher.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/SignedMatcher.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/VerificationCallSorter.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/VerificationCallSorter.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/VerificationCallSorter.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/VerificationCallSorter.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/WasNotCalled.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/WasNotCalled.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/WasNotCalled.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/WasNotCalled.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/states/AnsweringState.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/states/AnsweringState.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/states/AnsweringState.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/states/AnsweringState.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/states/CallRecordingState.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/states/CallRecordingState.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/states/CallRecordingState.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/states/CallRecordingState.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/states/ExclusionState.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/states/ExclusionState.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/states/ExclusionState.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/states/ExclusionState.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/states/RecordingState.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/states/RecordingState.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/states/RecordingState.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/states/RecordingState.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/states/SafeLoggingState.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/states/SafeLoggingState.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/states/SafeLoggingState.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/states/SafeLoggingState.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/states/StubbingAwaitingAnswerState.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/states/StubbingAwaitingAnswerState.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/states/StubbingAwaitingAnswerState.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/states/StubbingAwaitingAnswerState.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/states/StubbingState.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/states/StubbingState.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/states/StubbingState.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/states/StubbingState.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/recording/states/VerifyingState.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/states/VerifyingState.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/recording/states/VerifyingState.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/recording/states/VerifyingState.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/stub/AnswerAnsweringOpportunity.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/stub/AnswerAnsweringOpportunity.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/stub/AnswerAnsweringOpportunity.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/stub/AnswerAnsweringOpportunity.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/stub/CommonClearer.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/stub/CommonClearer.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/stub/CommonClearer.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/stub/CommonClearer.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/stub/ConstructorStub.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/stub/ConstructorStub.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/stub/ConstructorStub.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/stub/ConstructorStub.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/stub/MockKStub.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/stub/MockKStub.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/stub/MockKStub.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/stub/MockKStub.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/stub/MockType.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/stub/MockType.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/stub/MockType.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/stub/MockType.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/stub/SpyKStub.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/stub/SpyKStub.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/stub/SpyKStub.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/stub/SpyKStub.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/stub/Stub.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/stub/Stub.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/stub/Stub.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/stub/Stub.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/stub/StubGatewayAccess.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/stub/StubGatewayAccess.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/stub/StubGatewayAccess.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/stub/StubGatewayAccess.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/stub/StubRepository.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/stub/StubRepository.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/stub/StubRepository.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/stub/StubRepository.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/verify/AllCallsCallVerifier.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/verify/AllCallsCallVerifier.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/verify/AllCallsCallVerifier.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/verify/AllCallsCallVerifier.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/verify/LCSMatchingAlgo.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/verify/LCSMatchingAlgo.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/verify/LCSMatchingAlgo.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/verify/LCSMatchingAlgo.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/verify/OrderedCallVerifier.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/verify/OrderedCallVerifier.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/verify/OrderedCallVerifier.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/verify/OrderedCallVerifier.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/verify/SequenceCallVerifier.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/verify/SequenceCallVerifier.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/verify/SequenceCallVerifier.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/verify/SequenceCallVerifier.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/verify/TimeoutVerifier.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/verify/TimeoutVerifier.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/verify/TimeoutVerifier.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/verify/TimeoutVerifier.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/verify/UnorderedCallVerifier.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/verify/UnorderedCallVerifier.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/verify/UnorderedCallVerifier.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/verify/UnorderedCallVerifier.kt diff --git a/mockk/common/src/main/kotlin/io/mockk/impl/verify/VerificationHelpers.kt b/modules/mockk/src/commonMain/kotlin/io/mockk/impl/verify/VerificationHelpers.kt similarity index 100% rename from mockk/common/src/main/kotlin/io/mockk/impl/verify/VerificationHelpers.kt rename to modules/mockk/src/commonMain/kotlin/io/mockk/impl/verify/VerificationHelpers.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/ManyAnswersAnswerTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/ManyAnswersAnswerTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/ManyAnswersAnswerTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/ManyAnswersAnswerTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/impl/eval/RecordedBlockEvaluatorTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/impl/eval/RecordedBlockEvaluatorTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/impl/eval/RecordedBlockEvaluatorTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/impl/eval/RecordedBlockEvaluatorTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/impl/instantiation/AbstractInstantiatorTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/impl/instantiation/AbstractInstantiatorTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/impl/instantiation/AbstractInstantiatorTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/impl/instantiation/AbstractInstantiatorTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/impl/instantiation/AbstractMockFactoryTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/impl/instantiation/AbstractMockFactoryTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/impl/instantiation/AbstractMockFactoryTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/impl/instantiation/AbstractMockFactoryTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/impl/instantiation/AnyValueGeneratorTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/impl/instantiation/AnyValueGeneratorTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/impl/instantiation/AnyValueGeneratorTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/impl/instantiation/AnyValueGeneratorTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/impl/instantiation/CommonInstanceFactoryRegistryTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/impl/instantiation/CommonInstanceFactoryRegistryTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/impl/instantiation/CommonInstanceFactoryRegistryTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/impl/instantiation/CommonInstanceFactoryRegistryTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/impl/log/FilterLoggerTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/impl/log/FilterLoggerTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/impl/log/FilterLoggerTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/impl/log/FilterLoggerTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/impl/log/NoOpLoggerTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/impl/log/NoOpLoggerTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/impl/log/NoOpLoggerTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/impl/log/NoOpLoggerTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/impl/platform/CommonRefTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/impl/platform/CommonRefTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/impl/platform/CommonRefTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/impl/platform/CommonRefTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/impl/recording/AutoHinterTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/AutoHinterTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/impl/recording/AutoHinterTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/AutoHinterTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/impl/recording/CallRoundBuilderTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/CallRoundBuilderTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/impl/recording/CallRoundBuilderTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/CallRoundBuilderTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/impl/recording/ChainedCallDetectorTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/ChainedCallDetectorTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/impl/recording/ChainedCallDetectorTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/ChainedCallDetectorTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/impl/recording/ChildHinterTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/ChildHinterTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/impl/recording/ChildHinterTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/ChildHinterTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/impl/recording/CommonCallRecorderTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/CommonCallRecorderTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/impl/recording/CommonCallRecorderTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/CommonCallRecorderTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/impl/recording/states/AnsweringStateTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/states/AnsweringStateTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/impl/recording/states/AnsweringStateTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/states/AnsweringStateTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/impl/recording/states/CallRecordingStateTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/states/CallRecordingStateTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/impl/recording/states/CallRecordingStateTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/states/CallRecordingStateTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/impl/recording/states/RecordingStateTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/states/RecordingStateTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/impl/recording/states/RecordingStateTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/states/RecordingStateTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/impl/recording/states/StubbingAwaitingAnswerStateTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/states/StubbingAwaitingAnswerStateTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/impl/recording/states/StubbingAwaitingAnswerStateTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/states/StubbingAwaitingAnswerStateTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/impl/recording/states/StubbingStateTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/states/StubbingStateTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/impl/recording/states/StubbingStateTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/states/StubbingStateTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/impl/recording/states/VerifyingStateTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/states/VerifyingStateTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/impl/recording/states/VerifyingStateTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/impl/recording/states/VerifyingStateTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/AdditionalAnswerTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/AdditionalAnswerTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/AdditionalAnswerTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/AdditionalAnswerTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/AnnotationsTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/AnnotationsTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/AnnotationsTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/AnnotationsTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/AnswersTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/AnswersTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/AnswersTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/AnswersTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/ArraysTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/ArraysTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/ArraysTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/ArraysTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/BackingFieldTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/BackingFieldTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/BackingFieldTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/BackingFieldTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/CapturingGenericArgumentsTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/CapturingGenericArgumentsTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/CapturingGenericArgumentsTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/CapturingGenericArgumentsTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/CapturingTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/CapturingTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/CapturingTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/CapturingTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/ChainedCallsMatchingTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/ChainedCallsMatchingTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/ChainedCallsMatchingTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/ChainedCallsMatchingTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/ClearMocksTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/ClearMocksTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/ClearMocksTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/ClearMocksTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/CoVerifyTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/CoVerifyTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/CoVerifyTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/CoVerifyTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/ConstructorMockTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/ConstructorMockTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/ConstructorMockTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/ConstructorMockTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/CoroutinesTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/CoroutinesTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/CoroutinesTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/CoroutinesTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/EnumTests.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/EnumTests.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/EnumTests.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/EnumTests.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/ExtensionFunctionsTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/ExtensionFunctionsTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/ExtensionFunctionsTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/ExtensionFunctionsTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/HierarchicalMockingTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/HierarchicalMockingTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/HierarchicalMockingTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/HierarchicalMockingTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/InitializationBlockTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/InitializationBlockTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/InitializationBlockTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/InitializationBlockTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/InjectMocksTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/InjectMocksTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/InjectMocksTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/InjectMocksTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/IntTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/IntTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/IntTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/IntTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/LambdaTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/LambdaTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/LambdaTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/LambdaTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/MapsTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/MapsTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/MapsTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/MapsTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/MatcherTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/MatcherTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/MatcherTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/MatcherTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/MockTypesTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/MockTypesTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/MockTypesTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/MockTypesTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/MockkClassTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/MockkClassTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/MockkClassTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/MockkClassTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/NullsTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/NullsTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/NullsTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/NullsTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/ObjectMockTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/ObjectMockTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/ObjectMockTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/ObjectMockTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/ParametersWhitDefaultTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/ParametersWhitDefaultTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/ParametersWhitDefaultTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/ParametersWhitDefaultTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/PartialArgumentMatchingTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/PartialArgumentMatchingTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/PartialArgumentMatchingTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/PartialArgumentMatchingTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/PrivateFunctionsTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/PrivateFunctionsTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/PrivateFunctionsTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/PrivateFunctionsTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/PrivatePropertiesTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/PrivatePropertiesTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/PrivatePropertiesTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/PrivatePropertiesTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/RelaxedMockingTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/RelaxedMockingTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/RelaxedMockingTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/RelaxedMockingTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/SealedClassTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/SealedClassTest.kt similarity index 84% rename from mockk/common/src/test/kotlin/io/mockk/it/SealedClassTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/SealedClassTest.kt index efa39cab2..f48c8b1f4 100644 --- a/mockk/common/src/test/kotlin/io/mockk/it/SealedClassTest.kt +++ b/modules/mockk/src/commonTest/kotlin/io/mockk/it/SealedClassTest.kt @@ -2,6 +2,7 @@ package io.mockk.it import io.mockk.every import io.mockk.mockk +import kotlin.test.Ignore import kotlin.test.Test import kotlin.test.assertEquals @@ -9,6 +10,7 @@ import kotlin.test.assertEquals class SealedClassTest { @Test + @Ignore("Fails on JDK17+ https://github.com/mockk/mockk/issues/832") fun serviceReturnsSealedClassImpl() { val factory = mockk { every { create() } returns Leaf(1) @@ -20,6 +22,7 @@ class SealedClassTest { } @Test + @Ignore("Fails on JDK17+ https://github.com/mockk/mockk/issues/832") fun serviceAnswersSealedClassImpl() { val factory = mockk { every { create() } answers { Leaf(1) } diff --git a/mockk/common/src/test/kotlin/io/mockk/it/SealedInterfaceTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/SealedInterfaceTest.kt similarity index 84% rename from mockk/common/src/test/kotlin/io/mockk/it/SealedInterfaceTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/SealedInterfaceTest.kt index 91f727abf..4abe70221 100644 --- a/mockk/common/src/test/kotlin/io/mockk/it/SealedInterfaceTest.kt +++ b/modules/mockk/src/commonTest/kotlin/io/mockk/it/SealedInterfaceTest.kt @@ -3,12 +3,14 @@ package io.mockk.it import io.mockk.every import io.mockk.mockk import kotlin.test.Test +import kotlin.test.Ignore import kotlin.test.assertEquals class SealedInterfaceTest { @Test + @Ignore("Fails on JDK17+ https://github.com/mockk/mockk/issues/832") fun serviceReturnsSealedClassImpl() { val factory = mockk { every { create() } returns Leaf(1) @@ -20,6 +22,7 @@ class SealedInterfaceTest { } @Test + @Ignore("Fails on JDK17+ https://github.com/mockk/mockk/issues/832") fun serviceAnswersSealedClassImpl() { val factory = mockk { every { create() } answers { Leaf(1) } diff --git a/mockk/common/src/test/kotlin/io/mockk/it/SetsTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/SetsTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/SetsTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/SetsTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/SpyGenericClassTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/SpyGenericClassTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/SpyGenericClassTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/SpyGenericClassTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/SpyTestCls.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/SpyTestCls.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/SpyTestCls.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/SpyTestCls.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/StaticMockTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/StaticMockTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/StaticMockTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/StaticMockTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/ValueClassTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/ValueClassTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/ValueClassTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/ValueClassTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/VarargsTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/VarargsTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/VarargsTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/VarargsTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/VerificationErrorsTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/VerificationErrorsTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/VerificationErrorsTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/VerificationErrorsTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/VerifyAtLeastAtMostExactlyTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/VerifyAtLeastAtMostExactlyTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/VerifyAtLeastAtMostExactlyTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/VerifyAtLeastAtMostExactlyTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/it/VerifyTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/it/VerifyTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/it/VerifyTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/it/VerifyTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/test/SkipInstrumentedAndroidTest.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/test/SkipInstrumentedAndroidTest.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/test/SkipInstrumentedAndroidTest.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/test/SkipInstrumentedAndroidTest.kt diff --git a/mockk/common/src/test/kotlin/io/mockk/util/ArrayAsserts.kt b/modules/mockk/src/commonTest/kotlin/io/mockk/util/ArrayAsserts.kt similarity index 100% rename from mockk/common/src/test/kotlin/io/mockk/util/ArrayAsserts.kt rename to modules/mockk/src/commonTest/kotlin/io/mockk/util/ArrayAsserts.kt diff --git a/mockk/js/src/main/kotlin/io/mockk/MockK.kt b/modules/mockk/src/jsMain/kotlin/io/mockk/MockK.kt similarity index 100% rename from mockk/js/src/main/kotlin/io/mockk/MockK.kt rename to modules/mockk/src/jsMain/kotlin/io/mockk/MockK.kt diff --git a/mockk/js/src/main/kotlin/io/mockk/impl/InternalPlatform.kt b/modules/mockk/src/jsMain/kotlin/io/mockk/impl/InternalPlatform.kt similarity index 100% rename from mockk/js/src/main/kotlin/io/mockk/impl/InternalPlatform.kt rename to modules/mockk/src/jsMain/kotlin/io/mockk/impl/InternalPlatform.kt diff --git a/mockk/js/src/main/kotlin/io/mockk/impl/JsMockKGateway.kt b/modules/mockk/src/jsMain/kotlin/io/mockk/impl/JsMockKGateway.kt similarity index 100% rename from mockk/js/src/main/kotlin/io/mockk/impl/JsMockKGateway.kt rename to modules/mockk/src/jsMain/kotlin/io/mockk/impl/JsMockKGateway.kt diff --git a/mockk/js/src/main/kotlin/io/mockk/impl/annotations/AdditionalInterface.kt b/modules/mockk/src/jsMain/kotlin/io/mockk/impl/annotations/AdditionalInterface.kt similarity index 100% rename from mockk/js/src/main/kotlin/io/mockk/impl/annotations/AdditionalInterface.kt rename to modules/mockk/src/jsMain/kotlin/io/mockk/impl/annotations/AdditionalInterface.kt diff --git a/mockk/js/src/main/kotlin/io/mockk/impl/instantiation/JsInstantiator.kt b/modules/mockk/src/jsMain/kotlin/io/mockk/impl/instantiation/JsInstantiator.kt similarity index 100% rename from mockk/js/src/main/kotlin/io/mockk/impl/instantiation/JsInstantiator.kt rename to modules/mockk/src/jsMain/kotlin/io/mockk/impl/instantiation/JsInstantiator.kt diff --git a/mockk/js/src/main/kotlin/io/mockk/impl/instantiation/JsMockFactory.kt b/modules/mockk/src/jsMain/kotlin/io/mockk/impl/instantiation/JsMockFactory.kt similarity index 100% rename from mockk/js/src/main/kotlin/io/mockk/impl/instantiation/JsMockFactory.kt rename to modules/mockk/src/jsMain/kotlin/io/mockk/impl/instantiation/JsMockFactory.kt diff --git a/mockk/js/src/main/kotlin/io/mockk/impl/log/JsConsoleLogger.kt b/modules/mockk/src/jsMain/kotlin/io/mockk/impl/log/JsConsoleLogger.kt similarity index 100% rename from mockk/js/src/main/kotlin/io/mockk/impl/log/JsConsoleLogger.kt rename to modules/mockk/src/jsMain/kotlin/io/mockk/impl/log/JsConsoleLogger.kt diff --git a/mockk/js/src/main/kotlin/io/mockk/impl/platform/JsCounter.kt b/modules/mockk/src/jsMain/kotlin/io/mockk/impl/platform/JsCounter.kt similarity index 100% rename from mockk/js/src/main/kotlin/io/mockk/impl/platform/JsCounter.kt rename to modules/mockk/src/jsMain/kotlin/io/mockk/impl/platform/JsCounter.kt diff --git a/mockk/js/src/main/kotlin/io/mockk/impl/platform/JsHexLongHelper.kt b/modules/mockk/src/jsMain/kotlin/io/mockk/impl/platform/JsHexLongHelper.kt similarity index 100% rename from mockk/js/src/main/kotlin/io/mockk/impl/platform/JsHexLongHelper.kt rename to modules/mockk/src/jsMain/kotlin/io/mockk/impl/platform/JsHexLongHelper.kt diff --git a/mockk/js/src/main/kotlin/io/mockk/impl/recording/JsSignatureValueGenerator.kt b/modules/mockk/src/jsMain/kotlin/io/mockk/impl/recording/JsSignatureValueGenerator.kt similarity index 100% rename from mockk/js/src/main/kotlin/io/mockk/impl/recording/JsSignatureValueGenerator.kt rename to modules/mockk/src/jsMain/kotlin/io/mockk/impl/recording/JsSignatureValueGenerator.kt diff --git a/mockk/js/src/test/kotlin/io/mockk/MockKTestSuite.kt b/modules/mockk/src/jsTest/kotlin/io/mockk/MockKTestSuite.kt similarity index 100% rename from mockk/js/src/test/kotlin/io/mockk/MockKTestSuite.kt rename to modules/mockk/src/jsTest/kotlin/io/mockk/MockKTestSuite.kt diff --git a/mockk/js/src/test/kotlin/io/mockk/StringSpec.kt b/modules/mockk/src/jsTest/kotlin/io/mockk/StringSpec.kt similarity index 100% rename from mockk/js/src/test/kotlin/io/mockk/StringSpec.kt rename to modules/mockk/src/jsTest/kotlin/io/mockk/StringSpec.kt diff --git a/mockk/js/test.html b/modules/mockk/src/jsTest/test.html similarity index 100% rename from mockk/js/test.html rename to modules/mockk/src/jsTest/test.html diff --git a/mockk/jvm/src/main/kotlin/io/mockk/MockK.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/MockK.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/MockK.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/MockK.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/InternalPlatform.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/InternalPlatform.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/InternalPlatform.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/InternalPlatform.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/JvmMockKGateway.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/JvmMockKGateway.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/JvmMockKGateway.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/JvmMockKGateway.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/JvmMultiNotifier.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/JvmMultiNotifier.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/JvmMultiNotifier.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/JvmMultiNotifier.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/annotations/AdditionalInterface.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/annotations/AdditionalInterface.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/annotations/AdditionalInterface.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/annotations/AdditionalInterface.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/annotations/InjectionHelpers.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/annotations/InjectionHelpers.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/annotations/InjectionHelpers.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/annotations/InjectionHelpers.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/annotations/JvmMockInitializer.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/annotations/JvmMockInitializer.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/annotations/JvmMockInitializer.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/annotations/JvmMockInitializer.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/annotations/MockInjector.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/annotations/MockInjector.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/annotations/MockInjector.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/annotations/MockInjector.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/instantiation/JvmAnyValueGenerator.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/instantiation/JvmAnyValueGenerator.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/instantiation/JvmAnyValueGenerator.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/instantiation/JvmAnyValueGenerator.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/instantiation/JvmConstructorMockFactory.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/instantiation/JvmConstructorMockFactory.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/instantiation/JvmConstructorMockFactory.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/instantiation/JvmConstructorMockFactory.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/instantiation/JvmInstantiator.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/instantiation/JvmInstantiator.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/instantiation/JvmInstantiator.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/instantiation/JvmInstantiator.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/instantiation/JvmMockFactory.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/instantiation/JvmMockFactory.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/instantiation/JvmMockFactory.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/instantiation/JvmMockFactory.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/instantiation/JvmMockFactoryHelper.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/instantiation/JvmMockFactoryHelper.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/instantiation/JvmMockFactoryHelper.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/instantiation/JvmMockFactoryHelper.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/instantiation/JvmMockTypeChecker.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/instantiation/JvmMockTypeChecker.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/instantiation/JvmMockTypeChecker.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/instantiation/JvmMockTypeChecker.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/instantiation/JvmObjectMockFactory.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/instantiation/JvmObjectMockFactory.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/instantiation/JvmObjectMockFactory.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/instantiation/JvmObjectMockFactory.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/instantiation/JvmStaticMockFactory.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/instantiation/JvmStaticMockFactory.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/instantiation/JvmStaticMockFactory.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/instantiation/JvmStaticMockFactory.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/instantiation/RefCounterMap.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/instantiation/RefCounterMap.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/instantiation/RefCounterMap.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/instantiation/RefCounterMap.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/log/JULLogger.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/log/JULLogger.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/log/JULLogger.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/log/JULLogger.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/log/JvmLogging.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/log/JvmLogging.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/log/JvmLogging.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/log/JvmLogging.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/log/Slf4jLogger.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/log/Slf4jLogger.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/log/Slf4jLogger.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/log/Slf4jLogger.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/platform/JvmWeakConcurrentMap.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/platform/JvmWeakConcurrentMap.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/platform/JvmWeakConcurrentMap.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/platform/JvmWeakConcurrentMap.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/recording/JvmAutoHinter.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/recording/JvmAutoHinter.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/recording/JvmAutoHinter.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/recording/JvmAutoHinter.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/impl/recording/JvmSignatureValueGenerator.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/impl/recording/JvmSignatureValueGenerator.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/impl/recording/JvmSignatureValueGenerator.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/impl/recording/JvmSignatureValueGenerator.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/junit4/MockKRule.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/junit4/MockKRule.kt similarity index 100% rename from mockk/jvm/src/main/kotlin/io/mockk/junit4/MockKRule.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/junit4/MockKRule.kt diff --git a/mockk/jvm/src/main/kotlin/io/mockk/junit5/MockKExtension.kt b/modules/mockk/src/jvmMain/kotlin/io/mockk/junit5/MockKExtension.kt old mode 100755 new mode 100644 similarity index 96% rename from mockk/jvm/src/main/kotlin/io/mockk/junit5/MockKExtension.kt rename to modules/mockk/src/jvmMain/kotlin/io/mockk/junit5/MockKExtension.kt index 41597dcd0..0316f8945 --- a/mockk/jvm/src/main/kotlin/io/mockk/junit5/MockKExtension.kt +++ b/modules/mockk/src/jvmMain/kotlin/io/mockk/junit5/MockKExtension.kt @@ -20,10 +20,10 @@ import java.util.Optional * * Usage: declare @ExtendWith(MockKExtension.class) on a test class * - * Alternatively –Djunit.extensions.autodetection.enabled=true may be placed on a command line. + * Alternatively `–Djunit.extensions.autodetection.enabled=true` may be placed on a command line. * * (*) [unmockkAll] default behavior can be disabled by adding [KeepMocks] to your test class or method or - * –Dmockk.junit.extension.keepmocks=true on a command line + * `–Dmockk.junit.extension.keepmocks=true` on a command line */ class MockKExtension : TestInstancePostProcessor, ParameterResolver, AfterAllCallback { override fun supportsParameter(parameterContext: ParameterContext, extensionContext: ExtensionContext): Boolean { diff --git a/mockk/jvm/src/main/resources/META-INF/services/org.junit.jupiter.api.extension.Extension b/modules/mockk/src/jvmMain/resources/META-INF/services/org.junit.jupiter.api.extension.Extension similarity index 100% rename from mockk/jvm/src/main/resources/META-INF/services/org.junit.jupiter.api.extension.Extension rename to modules/mockk/src/jvmMain/resources/META-INF/services/org.junit.jupiter.api.extension.Extension diff --git a/mockk/jvm/src/test/java/io/mockk/JvmVarArgsCls.java b/modules/mockk/src/jvmTest/java/io/mockk/JvmVarArgsCls.java similarity index 100% rename from mockk/jvm/src/test/java/io/mockk/JvmVarArgsCls.java rename to modules/mockk/src/jvmTest/java/io/mockk/JvmVarArgsCls.java diff --git a/mockk/jvm/src/test/java/io/mockk/RurfMockCls.java b/modules/mockk/src/jvmTest/java/io/mockk/RurfMockCls.java similarity index 100% rename from mockk/jvm/src/test/java/io/mockk/RurfMockCls.java rename to modules/mockk/src/jvmTest/java/io/mockk/RurfMockCls.java diff --git a/mockk/jvm/src/test/java/io/mockk/it/PackagePrivateCls.java b/modules/mockk/src/jvmTest/java/io/mockk/it/PackagePrivateCls.java similarity index 100% rename from mockk/jvm/src/test/java/io/mockk/it/PackagePrivateCls.java rename to modules/mockk/src/jvmTest/java/io/mockk/it/PackagePrivateCls.java diff --git a/mockk/jvm/src/test/kotlin/io/mockk/impl/JvmMockKGatewayTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/impl/JvmMockKGatewayTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/impl/JvmMockKGatewayTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/impl/JvmMockKGatewayTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/impl/annotations/MockInjectorTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/impl/annotations/MockInjectorTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/impl/annotations/MockInjectorTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/impl/annotations/MockInjectorTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/impl/instantiation/JvmMockFactoryHelperTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/impl/instantiation/JvmMockFactoryHelperTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/impl/instantiation/JvmMockFactoryHelperTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/impl/instantiation/JvmMockFactoryHelperTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/BackingFieldsTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/BackingFieldsTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/BackingFieldsTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/BackingFieldsTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/CallableTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/CallableTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/CallableTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/CallableTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/CollectionChainStubbingTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/CollectionChainStubbingTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/CollectionChainStubbingTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/CollectionChainStubbingTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/CollectionsReturnOnRelaxedMockTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/CollectionsReturnOnRelaxedMockTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/CollectionsReturnOnRelaxedMockTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/CollectionsReturnOnRelaxedMockTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/ConcurrentStubInvocationTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/ConcurrentStubInvocationTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/ConcurrentStubInvocationTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/ConcurrentStubInvocationTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/CoroutineTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/CoroutineTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/CoroutineTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/CoroutineTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/JavaClassParamTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/JavaClassParamTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/JavaClassParamTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/JavaClassParamTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/JvmConstructorOverridenTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/JvmConstructorOverridenTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/JvmConstructorOverridenTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/JvmConstructorOverridenTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/JvmVarargsTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/JvmVarargsTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/JvmVarargsTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/JvmVarargsTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/LocaleTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/LocaleTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/LocaleTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/LocaleTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/MockKExtensionOnNestedClassTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/MockKExtensionOnNestedClassTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/MockKExtensionOnNestedClassTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/MockKExtensionOnNestedClassTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/NullableValueTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/NullableValueTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/NullableValueTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/NullableValueTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/PackagePrivateParentTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/PackagePrivateParentTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/PackagePrivateParentTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/PackagePrivateParentTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/ParallelTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/ParallelTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/ParallelTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/ParallelTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/PrivateParentMethodTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/PrivateParentMethodTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/PrivateParentMethodTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/PrivateParentMethodTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/RaceConditionInMockCreationTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/RaceConditionInMockCreationTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/RaceConditionInMockCreationTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/RaceConditionInMockCreationTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/RelaxedSuspendingMockingTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/RelaxedSuspendingMockingTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/RelaxedSuspendingMockingTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/RelaxedSuspendingMockingTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/RurfTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/RurfTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/RurfTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/RurfTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/SafeCallSuspendingTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/SafeCallSuspendingTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/SafeCallSuspendingTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/SafeCallSuspendingTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/StackTraceLineNumberTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/StackTraceLineNumberTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/StackTraceLineNumberTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/StackTraceLineNumberTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/StaticMockkTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/StaticMockkTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/StaticMockkTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/StaticMockkTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/ThrowExceptionOnNonMockedClassTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/ThrowExceptionOnNonMockedClassTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/ThrowExceptionOnNonMockedClassTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/ThrowExceptionOnNonMockedClassTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/TimeoutTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/TimeoutTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/TimeoutTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/TimeoutTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/VerificationAcknowledgeTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/VerificationAcknowledgeTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/VerificationAcknowledgeTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/VerificationAcknowledgeTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/it/VoidReturnTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/it/VoidReturnTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/it/VoidReturnTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/it/VoidReturnTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/junit4/MockKRuleTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/junit4/MockKRuleTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/junit4/MockKRuleTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/junit4/MockKRuleTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/junit5/ExtensionAndInitMocksTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/junit5/ExtensionAndInitMocksTest.kt old mode 100755 new mode 100644 similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/junit5/ExtensionAndInitMocksTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/junit5/ExtensionAndInitMocksTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/junit5/MockKExtensionAfterAllTestTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/junit5/MockKExtensionAfterAllTestTest.kt old mode 100755 new mode 100644 similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/junit5/MockKExtensionAfterAllTestTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/junit5/MockKExtensionAfterAllTestTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/junit5/MockKExtensionTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/junit5/MockKExtensionTest.kt old mode 100755 new mode 100644 similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/junit5/MockKExtensionTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/junit5/MockKExtensionTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/jvm/ClassLoadingStrategyTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/jvm/ClassLoadingStrategyTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/jvm/ClassLoadingStrategyTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/jvm/ClassLoadingStrategyTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/jvm/HashMapMockTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/jvm/HashMapMockTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/jvm/HashMapMockTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/jvm/HashMapMockTest.kt diff --git a/mockk/jvm/src/test/kotlin/io/mockk/jvm/JvmAnyValueGeneratorTest.kt b/modules/mockk/src/jvmTest/kotlin/io/mockk/jvm/JvmAnyValueGeneratorTest.kt similarity index 100% rename from mockk/jvm/src/test/kotlin/io/mockk/jvm/JvmAnyValueGeneratorTest.kt rename to modules/mockk/src/jvmTest/kotlin/io/mockk/jvm/JvmAnyValueGeneratorTest.kt diff --git a/mockk/jvm/src/test/resources/logback-test.xml b/modules/mockk/src/jvmTest/resources/logback-test.xml similarity index 100% rename from mockk/jvm/src/test/resources/logback-test.xml rename to modules/mockk/src/jvmTest/resources/logback-test.xml diff --git a/plugins/configuration/build.gradle.kts b/plugins/configuration/build.gradle.kts deleted file mode 100644 index 1c46531c6..000000000 --- a/plugins/configuration/build.gradle.kts +++ /dev/null @@ -1,53 +0,0 @@ -import io.mockk.dependencies.Deps -import io.mockk.dependencies.kotlinVersion -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - -plugins { - `kotlin-dsl` - `java-gradle-plugin` - id("dependencies") -} - -group = "io.mockk.plugins" -version = "SNAPSHOT" - -// Required since Gradle 4.10+. -repositories { - google() - mavenCentral() - gradlePluginPortal() -} - -dependencies { - implementation(Deps.Plugins.androidTools) - implementation(Deps.Plugins.dokka) - implementation(Deps.Plugins.kotlin(kotlinVersion())) - implementation("io.mockk.plugins:dependencies:SNAPSHOT") -} - -gradlePlugin { - plugins { - register("mpp-common") { - id = "mpp-common" - implementationClass = "io.mockk.configuration.CommonConfigurationPlugin" - } - register("mpp-android") { - id = "mpp-android" - implementationClass = "io.mockk.configuration.AndroidConfigurationPlugin" - } - register("mpp-js") { - id = "mpp-js" - implementationClass = "io.mockk.configuration.JsConfigurationPlugin" - } - register("mpp-jvm") { - id = "mpp-jvm" - implementationClass = "io.mockk.configuration.JvmConfigurationPlugin" - } - } -} - -tasks.withType { - kotlinOptions { - freeCompilerArgs = listOf("-Xjsr305=strict") - } -} diff --git a/plugins/configuration/src/main/kotlin/io/mockk/configuration/AndroidConfigurationPlugin.kt b/plugins/configuration/src/main/kotlin/io/mockk/configuration/AndroidConfigurationPlugin.kt deleted file mode 100644 index 931f4be4a..000000000 --- a/plugins/configuration/src/main/kotlin/io/mockk/configuration/AndroidConfigurationPlugin.kt +++ /dev/null @@ -1,53 +0,0 @@ -package io.mockk.configuration - -import com.android.build.gradle.LibraryExtension -import com.android.build.gradle.LibraryPlugin -import io.mockk.dependencies.Deps -import io.mockk.dependencies.kotlinVersion -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.jvm.tasks.Jar -import org.gradle.kotlin.dsl.apply -import org.gradle.kotlin.dsl.configure -import org.gradle.kotlin.dsl.get -import org.gradle.kotlin.dsl.getByType -import org.gradle.kotlin.dsl.invoke -import org.gradle.kotlin.dsl.named -import org.gradle.kotlin.dsl.register -import org.jetbrains.dokka.gradle.DokkaPlugin -import org.jetbrains.dokka.gradle.DokkaTask -import org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension -import org.jetbrains.kotlin.gradle.plugin.KotlinAndroidPluginWrapper - -class AndroidConfigurationPlugin : Plugin { - override fun apply(target: Project) { - target.run { - configureAndroid() - configureDokka() - } - } - - private fun Project.configureAndroid() { - apply() - apply() - extensions.configure(KotlinAndroidProjectExtension::class) { - sourceSets["main"].dependencies { - implementation(Deps.Libs.kotlinStdLib(kotlinVersion())) - } - } - } - - private fun Project.configureDokka() { - apply() - tasks { - val dokkaJavadoc = named("dokkaJavadoc") { - outputDirectory.set(file("$buildDir/javadoc")) - } - register("javadocJar") { - dependsOn(dokkaJavadoc) - archiveClassifier.set("javadoc") - from("$buildDir/javadoc") - } - } - } -} diff --git a/plugins/configuration/src/main/kotlin/io/mockk/configuration/CommonConfigurationPlugin.kt b/plugins/configuration/src/main/kotlin/io/mockk/configuration/CommonConfigurationPlugin.kt deleted file mode 100644 index 9e00cbb86..000000000 --- a/plugins/configuration/src/main/kotlin/io/mockk/configuration/CommonConfigurationPlugin.kt +++ /dev/null @@ -1,29 +0,0 @@ -package io.mockk.configuration - -import io.mockk.dependencies.Deps -import io.mockk.dependencies.kotlinVersion -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.kotlin.dsl.apply -import org.gradle.kotlin.dsl.configure -import org.gradle.kotlin.dsl.get -import org.jetbrains.kotlin.gradle.dsl.KotlinCommonProjectExtension -import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformCommonPlugin - -class CommonConfigurationPlugin : Plugin { - override fun apply(target: Project) { - target.run { - apply() - extensions.configure(KotlinCommonProjectExtension::class) { - sourceSets["main"].dependencies { - implementation(Deps.Libs.kotlinStdLib(kotlinVersion())) - implementation(Deps.Libs.kotlinReflect(kotlinVersion())) - } - sourceSets["test"].dependencies { - implementation(Deps.Libs.kotlinTestCommon(kotlinVersion())) - implementation(Deps.Libs.kotlinTestCommonAnnotations(kotlinVersion())) - } - } - } - } -} diff --git a/plugins/configuration/src/main/kotlin/io/mockk/configuration/JsConfigurationPlugin.kt b/plugins/configuration/src/main/kotlin/io/mockk/configuration/JsConfigurationPlugin.kt deleted file mode 100644 index 82ded3c31..000000000 --- a/plugins/configuration/src/main/kotlin/io/mockk/configuration/JsConfigurationPlugin.kt +++ /dev/null @@ -1,35 +0,0 @@ -package io.mockk.configuration - -import io.mockk.dependencies.Deps -import io.mockk.dependencies.kotlinVersion -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.kotlin.dsl.apply -import org.gradle.kotlin.dsl.configure -import org.gradle.kotlin.dsl.get -import org.jetbrains.kotlin.gradle.dsl.KotlinJsProjectExtension -import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformJsPlugin - -class JsConfigurationPlugin : Plugin { - override fun apply(target: Project) { - target.run { - apply() - extensions.configure(KotlinJsProjectExtension::class) { - sourceSets["main"].dependencies { - compileOnly(Deps.Libs.kotlinStdLibJs(kotlinVersion())) - } - sourceSets["test"].dependencies { - implementation(Deps.Libs.kotlinTestJs(kotlinVersion())) - } - js { - compilations.all { - kotlinOptions { - moduleKind = "commonjs" - sourceMap = true - } - } - } - } - } - } -} diff --git a/plugins/configuration/src/main/kotlin/io/mockk/configuration/JvmConfigurationPlugin.kt b/plugins/configuration/src/main/kotlin/io/mockk/configuration/JvmConfigurationPlugin.kt deleted file mode 100644 index efe064fb5..000000000 --- a/plugins/configuration/src/main/kotlin/io/mockk/configuration/JvmConfigurationPlugin.kt +++ /dev/null @@ -1,82 +0,0 @@ -package io.mockk.configuration - -import io.mockk.dependencies.Deps -import io.mockk.dependencies.kotlinVersion -import org.gradle.api.JavaVersion -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.api.plugins.JavaPluginExtension -import org.gradle.api.tasks.testing.Test -import org.gradle.api.tasks.testing.logging.TestExceptionFormat -import org.gradle.jvm.tasks.Jar -import org.gradle.kotlin.dsl.apply -import org.gradle.kotlin.dsl.configure -import org.gradle.kotlin.dsl.exclude -import org.gradle.kotlin.dsl.get -import org.gradle.kotlin.dsl.invoke -import org.gradle.kotlin.dsl.named -import org.gradle.kotlin.dsl.register -import org.jetbrains.dokka.gradle.DokkaPlugin -import org.jetbrains.dokka.gradle.DokkaTask -import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension -import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformJvmPlugin - -class JvmConfigurationPlugin : Plugin { - override fun apply(target: Project) { - target.run { - configureKotlinJvm() - configureJavaPlugin() - configureDokka() - } - } - - private fun Project.configureKotlinJvm() { - apply() - extensions.configure(KotlinJvmProjectExtension::class) { - sourceSets["main"].dependencies { - implementation(Deps.Libs.kotlinStdLib(kotlinVersion())) - implementation(Deps.Libs.kotlinReflect(kotlinVersion())) - compileOnly(Deps.Libs.junitJupiterApi) - } - sourceSets["test"].dependencies { - implementation(Deps.Libs.kotlinTestJunit(kotlinVersion())) { - exclude(group = "junit", module = "junit") - } - implementation(Deps.Libs.slfj) - implementation(Deps.Libs.logback) - implementation(Deps.Libs.junitJupiterApi) - implementation(Deps.Libs.junitJupiterEngine) - implementation(Deps.Libs.junitVintageEngine) - } - } - } - - private fun Project.configureJavaPlugin() { - extensions.configure(JavaPluginExtension::class) { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - tasks { - named("test") { - testLogging { - exceptionFormat = TestExceptionFormat.FULL - } - useJUnitPlatform() - } - } - } - - private fun Project.configureDokka() { - apply() - tasks { - val dokkaJavadoc = named("dokkaJavadoc") { - outputDirectory.set(file("$buildDir/javadoc")) - } - register("javadocJar") { - dependsOn(dokkaJavadoc) - archiveClassifier.set("javadoc") - from("$buildDir/javadoc") - } - } - } -} diff --git a/plugins/dependencies/build.gradle.kts b/plugins/dependencies/build.gradle.kts deleted file mode 100644 index 6c55d9606..000000000 --- a/plugins/dependencies/build.gradle.kts +++ /dev/null @@ -1,28 +0,0 @@ -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - -plugins { - `kotlin-dsl` - `java-gradle-plugin` -} - -group = "io.mockk.plugins" -version = "SNAPSHOT" - -// Required since Gradle 4.10+. -repositories { - mavenCentral() - gradlePluginPortal() -} - -gradlePlugin { - plugins.register("dependencies") { - id = "dependencies" - implementationClass = "io.mockk.dependencies.DependenciesPlugin" - } -} - -tasks.withType { - kotlinOptions { - freeCompilerArgs = listOf("-Xjsr305=strict") - } -} diff --git a/plugins/dependencies/src/main/kotlin/io/mockk/dependencies/DependenciesPlugin.kt b/plugins/dependencies/src/main/kotlin/io/mockk/dependencies/DependenciesPlugin.kt deleted file mode 100644 index dcc84d13e..000000000 --- a/plugins/dependencies/src/main/kotlin/io/mockk/dependencies/DependenciesPlugin.kt +++ /dev/null @@ -1,10 +0,0 @@ -package io.mockk.dependencies - -import org.gradle.api.Plugin -import org.gradle.api.Project - -class DependenciesPlugin : Plugin { - override fun apply(target: Project) { - // no-op - } -} diff --git a/plugins/dependencies/src/main/kotlin/io/mockk/dependencies/Deps.kt b/plugins/dependencies/src/main/kotlin/io/mockk/dependencies/Deps.kt deleted file mode 100644 index bc78710ea..000000000 --- a/plugins/dependencies/src/main/kotlin/io/mockk/dependencies/Deps.kt +++ /dev/null @@ -1,43 +0,0 @@ -package io.mockk.dependencies - -import org.gradle.api.Project - -fun Project.kotlinVersion() = findProperty("kotlin.version")?.toString() ?: Deps.Versions.kotlinDefault - -object Deps { - object Versions { - const val androidTools = "7.2.1" - const val dokka = "1.7.10" - const val kotlinDefault = "1.7.10" - const val coroutines = "1.6.4" - const val slfj = "1.7.32" - const val logback = "1.2.11" - const val junitJupiter = "5.8.2" - const val junitVintage = "5.8.2" - } - - object Libs { - const val slfj = "org.slf4j:slf4j-api:${Versions.slfj}" - const val logback = "ch.qos.logback:logback-classic:${Versions.logback}" - const val junitJupiterApi = "org.junit.jupiter:junit-jupiter-api:${Versions.junitJupiter}" - const val junitJupiterEngine = "org.junit.jupiter:junit-jupiter-engine:${Versions.junitJupiter}" - const val junitVintageEngine = "org.junit.vintage:junit-vintage-engine:${Versions.junitVintage}" - - fun kotlinStdLib(version: String = Versions.kotlinDefault) = "org.jetbrains.kotlin:kotlin-stdlib:$version" - fun kotlinStdLibJs(version: String = Versions.kotlinDefault) = "org.jetbrains.kotlin:kotlin-stdlib-js:$version" - fun kotlinTestCommon(version: String = Versions.kotlinDefault) = "org.jetbrains.kotlin:kotlin-test-common:$version" - fun kotlinTestCommonAnnotations(version: String = Versions.kotlinDefault) = "org.jetbrains.kotlin:kotlin-test-annotations-common:$version" - fun kotlinTestJunit(version: String = Versions.kotlinDefault) = "org.jetbrains.kotlin:kotlin-test-junit:$version" - fun kotlinTestJs(version: String = Versions.kotlinDefault) = "org.jetbrains.kotlin:kotlin-test-js:$version" - fun kotlinReflect(version: String = Versions.kotlinDefault) = "org.jetbrains.kotlin:kotlin-reflect:$version" - fun kotlinCoroutinesCore(version: String = Versions.coroutines) = "org.jetbrains.kotlinx:kotlinx-coroutines-core:$version" - fun kotlinCoroutinesCoreJs(version: String = Versions.coroutines) = "org.jetbrains.kotlinx:kotlinx-coroutines-core-js:$version" - } - - object Plugins { - const val androidTools = "com.android.tools.build:gradle:${Versions.androidTools}" - const val dokka = "org.jetbrains.dokka:dokka-gradle-plugin:${Versions.dokka}" - - fun kotlin(version: String = Versions.kotlinDefault) = "org.jetbrains.kotlin:kotlin-gradle-plugin:$version" - } -} diff --git a/settings.gradle.kts b/settings.gradle.kts index fb2f8f0a3..8beac794c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,59 +1,30 @@ -pluginManagement { - repositories { - google() - mavenCentral() - gradlePluginPortal() - } -} - -apply(from = "gradle/detect-android-sdk.gradle") - rootProject.name = "mockk-root" -includeBuild("plugins/dependencies") -includeBuild("plugins/configuration") - -include("mockk-jvm") -include("mockk-common") -//include 'mockk-js' -val hasAndroidSdk = extra["hasAndroidSdk"] +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") -if (hasAndroidSdk == true) include("mockk-android") +apply(from = "./buildSrc/repositories.settings.gradle.kts") +apply(from = "./buildSrc/android-sdk-detector.settings.gradle.kts") -include("mockk-agent-api") -include("mockk-agent-common") -include("mockk-agent-jvm") -if (hasAndroidSdk == true) { - include("mockk-agent-android") - include("mockk-agent-android-dispatcher") +dependencyResolutionManagement { + @Suppress("UnstableApiUsage") + repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS) } -include("mockk-dsl") -include("mockk-dsl-jvm") -// include 'mockk-dsl-js' - -// include("mockk-client-tests-jvm") - -project(":mockk-jvm").projectDir = file("mockk/jvm") -project(":mockk-common").projectDir = file("mockk/common") -//project(":mockk-js").projectDir = file("mockk/js") -if (hasAndroidSdk == true) project(":mockk-android").projectDir = file("mockk/android") - -project(":mockk-agent-api").projectDir = file("agent/api") -project(":mockk-agent-common").projectDir = file("agent/common") -project(":mockk-agent-jvm").projectDir = file("agent/jvm") -if (hasAndroidSdk == true) { - project(":mockk-agent-android").projectDir = file("agent/android") - project(":mockk-agent-android-dispatcher").projectDir = file("agent/android/dispatcher") -} +include( + ":modules:mockk", + ":modules:mockk-agent-api", + ":modules:mockk-agent", + ":modules:mockk-dsl", -project(":mockk-dsl").projectDir = file("dsl/common") -project(":mockk-dsl-jvm").projectDir = file("dsl/jvm") -// project(":mockk-dsl-js").projectDir = file("dsl/js") + ":modules:client-tests", +) -// project(":mockk-client-tests-jvm").projectDir = file("client-tests/jvm") +val androidSdkDetected: Boolean? by extra -// very weird hack to make it working in IDE and stay compatible with naming -if (gradle.startParameter.taskNames.contains("publish")) { - project(":mockk-jvm").name = "mockk" +if (androidSdkDetected == true) { + include( + ":modules:mockk-agent-android", + ":modules:mockk-agent-android-dispatcher", + ":modules:mockk-android", + ) } diff --git a/sloc.sh b/sloc.sh deleted file mode 100644 index 81b9dbb0f..000000000 --- a/sloc.sh +++ /dev/null @@ -1,5 +0,0 @@ -git checkout $1 2> /dev/null -echo -n $1 "$(git log -1 --date=format:'%Y/%m/%d' --format='%ad') " -cloc . | egrep "Kotlin|^C\+\+|Java " | sed 's/[ \t]\+/ /g' | cut -f 1,5 -d ' ' | tr ' ' '=' | tr '\n' ',' | sed 's/,$//' -echo - diff --git a/usage-stats-30days.txt b/usage-stats-30days.txt deleted file mode 100644 index 187dbe47f..000000000 --- a/usage-stats-30days.txt +++ /dev/null @@ -1,344 +0,0 @@ -London United Kingdom 282 -Moscow Russia 260 -Boardman United States 254 -Sao Paulo Brazil 211 -Seoul South Korea 188 -Seattle United States 179 -Berlin Germany 158 -Ashburn United States 138 -San Jose United States 117 -Bengaluru India 108 -Singapore Singapore 108 -Frankfurt Germany 104 -Sydney Australia 102 -Kyiv Ukraine 102 -New York United States 97 -Oslo Municipality Norway 93 -Paris France 88 -Saint Petersburg Russia 87 -Munich Germany 86 -Amsterdam Netherlands 86 -Warsaw Poland 84 -Columbus United States 84 -Dublin Ireland 83 -Tel Aviv-Yafo Israel 72 -Minsk Belarus 70 -Suwon-si South Korea 67 -Bangkok Thailand 66 -Istanbul Turkey 66 -Minato City Japan 61 -Pune India 60 -San Francisco United States 58 -Buenos Aires Argentina 56 -Seongnam-si South Korea 56 -Poznan Poland 55 -Toronto Canada 54 -Stockholm Sweden 54 -Mumbai India 53 -Bentonville United States 51 -Prague Czechia 50 -Hamburg Germany 50 -Krakow Poland 50 -Barcelona Spain 49 -Wroclaw Poland 49 -Shenzhen China 46 -Setagaya City Japan 46 -Los Angeles United States 46 -Madrid Spain 45 -Chennai India 44 -Zurich Switzerland 43 -Shanghai China 43 -Jakarta Indonesia 43 -Tysons United States 43 -Belo Horizonte Brazil 41 -Montreal Canada 41 -Kharkiv Ukraine 41 -Austin United States 41 -Hanoi Vietnam 40 -Chiyoda City Japan 38 -Vienna Austria 37 -Menlo Park United States 37 -Melbourne Australia 36 -Bogota Colombia 35 -Yokohama Japan 35 -Ho Chi Minh City Vietnam 35 -Stuttgart Germany 34 -Hyderabad India 34 -Utrecht Netherlands 33 -Campinas Brazil 32 -Chicago United States 32 -Milan Italy 31 -Lviv Ukraine 29 -Sunnyvale United States 29 -Cologne Germany 28 -Delhi India 27 -Rio de Janeiro Brazil 25 -Novosibirsk Russia 25 -San Diego United States 25 -Porto Portugal 24 -Portland United States 24 -Mountain View United States 23 -Beijing China 22 -Budapest Hungary 22 -Koto City Japan 22 -Lisbon Portugal 22 -Minneapolis United States 22 -Noida India 21 -Mexico City Mexico 21 -Santiago Chile 20 -Gdansk Poland 20 -Bucharest Romania 20 -Gothenburg Sweden 20 -Karlsruhe Germany 19 -Dusseldorf Germany 19 -Yongin-si South Korea 19 -Cluj-Napoca Romania 19 -Kazan Russia 19 -Fremont United States 19 -Porto Alegre Brazil 18 -Florianopolis Brazil 18 -Cairo Egypt 18 -Lucknow India 18 -Auckland New Zealand 18 -Lodz Poland 18 -Vilnius Lithuania 18 -Uberlandia Brazil 17 -Curitiba Brazil 17 -Osasco Brazil 17 -Copenhagen Denmark 17 -Zagreb Croatia 17 -Wuhan China 16 -Shinjuku City Japan 16 -Dnipro Ukraine 16 -Phoenix United States 16 -Bellevue United States 16 -Norderstedt Germany 15 -Manchester United Kingdom 15 -Ahmedabad India 15 -Tehran Iran 15 -Denver United States 15 -Atlanta United States 15 -Pittsburgh United States 15 -Recife Brazil 14 -Vancouver Canada 14 -Xi'an China 14 -Katowice Poland 14 -Belgrade Serbia 14 -Bratislava Slovakia 14 -Brisbane Australia 13 -Fortaleza Brazil 13 -Dresden Germany 13 -Kochi India 13 -Incheon South Korea 13 -Karachi Pakistan 13 -Orlando United States 13 -Santo Andre Brazil 12 -Leipzig Germany 12 -Gurgaon India 12 -Coimbatore India 12 -Kolkata India 12 -Meguro City Japan 12 -Shibuya City Japan 12 -Nairobi Kenya 12 -Krasnodar Russia 12 -Skovde Sweden 12 -Montevideo Uruguay 12 -Da Nang Vietnam 12 -Cordoba Argentina 11 -Brasilia Brazil 11 -Joao Pessoa Brazil 11 -Calgary Canada 11 -Medellin Colombia 11 -Brno Czechia 11 -Lyon France 11 -Patna India 11 -Jaipur India 11 -Kawasaki Japan 11 -Kuala Lumpur Malaysia 11 -Ulyanovsk Russia 11 -Ankara Turkey 11 -Hurlingham Argentina 11 -Tallinn Estonia 11 -Kaunas Lithuania 11 -Guangzhou China 10 -Chengdu China 10 -Helsinki Finland 10 -Brighton United Kingdom 10 -New Delhi India 10 -Shinagawa City Japan 10 -Odesa Ukraine 10 -Irvine United States 10 -Los Gatos United States 10 -Durham United States 10 -Dallas United States 10 -Salvador Brazil 9 -Ottawa Canada 9 -Giza Egypt 9 -Rennes France 9 -Toulouse France 9 -Nantes France 9 -Vijayawada India 9 -Bhubaneswar India 9 -Wellington New Zealand 9 -Voronezh Russia 9 -Boise United States 9 -West Bloomfield Township United States 9 -Cincinnati United States 9 -Cape Town South Africa 9 -Richfield United States 9 -South Tangerang Indonesia 9 -Banska Bystrica Slovakia 9 -Quito Ecuador 9 -Dubai United Arab Emirates 8 -Blumenau Brazil 8 -Indaiatuba Brazil 8 -Nuremberg Germany 8 -Cambridge United Kingdom 8 -Leeds United Kingdom 8 -Surabaya Indonesia 8 -Ghaziabad India 8 -Osaka Japan 8 -Rotterdam Netherlands 8 -Nizhny Novgorod Russia 8 -Yekaterinburg Russia 8 -Tunis Tunisia 8 -Santa Clara United States 8 -Pimpri-Chinchwad India 8 -Trondheim Municipality Norway 8 -Plymouth United States 8 -Tuckahoe United States 8 -Brest Belarus 8 -Moron Argentina 7 -Sofia Bulgaria 7 -Goiania Brazil 7 -Sao Luis Brazil 7 -Americana Brazil 7 -Araraquara Brazil 7 -Quebec City Canada 7 -Zhengzhou China 7 -Leinfelden-Echterdingen Germany 7 -Nanterre France 7 -Birmingham United Kingdom 7 -Brentford United Kingdom 7 -Bristol United Kingdom 7 -York United Kingdom 7 -Ludhiana India 7 -Rome Italy 7 -Kobe Japan 7 -Lagos Nigeria 7 -Eindhoven Netherlands 7 -Szczecin Poland 7 -Sao Domingos de Rana Portugal 7 -Samara Russia 7 -Burbank United States 7 -Pleasanton United States 7 -Boston United States 7 -Jersey City United States 7 -Beaverton United States 7 -San Antonio United States 7 -Baerum Norway 7 -Athens Greece 7 -Almaty Kazakhstan 7 -Accra Ghana 7 -Vitoria Brazil 6 -Aracaju Brazil 6 -Bauru Brazil 6 -Sao Caetano do Sul Brazil 6 -Sorocaba Brazil 6 -Brampton Canada 6 -Kitchener Canada 6 -Mississauga Canada 6 -Jinan China 6 -Dortmund Germany 6 -Malaga Spain 6 -Bordeaux France 6 -Newcastle upon Tyne United Kingdom 6 -Tbilisi Georgia 6 -Bandung Indonesia 6 -Tangerang Indonesia 6 -Indore India 6 -Anyang South Korea 6 -Colombo Sri Lanka 6 -Petaling Jaya Malaysia 6 -The Hague Netherlands 6 -Christchurch New Zealand 6 -Quezon City Philippines 6 -Balashikha Russia 6 -Rostov-on-Don Russia 6 -Tolyatti Russia 6 -Izhevsk Russia 6 -Oakland United States 6 -Aurora United States 6 -Jacksonville United States 6 -Naperville United States 6 -Acton United States 6 -Somerville United States 6 -Maryland Heights United States 6 -Charlotte United States 6 -Houston United States 6 -Irving United States 6 -Washington United States 6 -Bergen Municipality Norway 6 -Riga Latvia 6 -Grodno Belarus 6 -Yerevan Armenia 6 -Mogi das Cruzes Brazil 6 -Abu Dhabi United Arab Emirates 5 -Graz Austria 5 -Baku Azerbaijan 5 -Ghent Belgium 5 -Dhaka Bangladesh 5 -Manaus Brazil 5 -Campina Grande Brazil 5 -Sao Jose dos Campos Brazil 5 -Hangzhou China 5 -Envigado Colombia 5 -Heilbronn Germany 5 -Hanover Germany 5 -Essen Germany 5 -Worms Germany 5 -Erfurt Germany 5 -Granada Spain 5 -Zaragoza Spain 5 -Lannion France 5 -Boulogne-Billancourt France 5 -Nottingham United Kingdom 5 -Watford United Kingdom 5 -Depok Indonesia 5 -Surat India 5 -Turin Italy 5 -Nakano City Japan 5 -Suginami City Japan 5 -Bishkek Kyrgyzstan 5 -Amstelveen Netherlands 5 -Haarlem Netherlands 5 -Cebu City Philippines 5 -Krasnoyarsk Russia 5 -Lipetsk Russia 5 -Omsk Russia 5 -Adana Turkey 5 -Izmir Turkey 5 -Vinnytsia Ukraine 5 -Dublin United States 5 -Long Beach United States 5 -Pasadena United States 5 -Redwood City United States 5 -San Mateo United States 5 -Saint Paul United States 5 -Providence United States 5 -South Jordan United States 5 -Sammamish United States 5 -Novi Sad Serbia 5 -Saitama Japan 5 -Chuo City Japan 5 -Betim Brazil 5 -Meerut India 5 -Navi Mumbai India 5 -Sahibzada Ajit Singh Nagar India 5 -Maple Grove United States 5 -Bengkulu Indonesia 5 -Depok Indonesia 5 -Ljubljana Slovenia 5 -Presov Slovakia 5 -Tijuana Mexico 5 -Son Tay Vietnam 5