Skip to content

Commit

Permalink
MocKMP 2.0: support for Kotlin 2!
Browse files Browse the repository at this point in the history
  • Loading branch information
SalomonBrys committed Nov 30, 2024
1 parent f80704b commit a454f38
Show file tree
Hide file tree
Showing 77 changed files with 3,604 additions and 1,217 deletions.
23 changes: 0 additions & 23 deletions .github/actions/check/action.yml

This file was deleted.

5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ jobs:
- name: Setup
uses: kosi-libs/kodein-internal-github-actions/setup@main
- name: Check
uses: ./.github/actions/check
run: ./gradlew --stacktrace --scan :tests-projects:check
shell: bash
- name: Upload
run: ./gradlew --stacktrace --scan publishAllPublicationsToOssrhStagingRepository -Porg.kodein.sonatype.repositoryId=${{ needs.create-staging-repository.outputs.repository-id }}
run: ./gradlew --stacktrace --scan :mockmp:publishAllPublicationsToOssrhStagingRepository -Porg.kodein.sonatype.repositoryId=${{ needs.create-staging-repository.outputs.repository-id }}
shell: bash

drop-or-release-staging-repository:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: build and publish a snapshot
on:
push:
branches:
- master
- main
- 'snapshot/*'
- 'kotlin-*'
paths-ignore:
Expand All @@ -23,7 +23,8 @@ jobs:
- name: Setup
uses: kosi-libs/kodein-internal-github-actions/setup@main
- name: Check
uses: ./.github/actions/check
run: ./gradlew --stacktrace --scan :tests-projects:check
shell: bash
- name: Upload
run: ./gradlew --stacktrace --scan publishAllPublicationsToOssrhStagingRepository -PgitRef=${{ github.ref }} -Psnapshot=true
run: ./gradlew --stacktrace --scan :mockmp:publishAllPublicationsToOssrhStagingRepository -PgitRef=${{ github.ref }} -Psnapshot=true
shell: bash
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ jobs:
- name: Setup
uses: kosi-libs/kodein-internal-github-actions/setup@main
- name: Check
uses: ./.github/actions/check
run: ./gradlew --stacktrace --scan :tests-projects:check
shell: bash
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@
build/
out/
.gradletasknamecache
*local.properties
tests-projects/local.properties

# JS
node_modules/
package-lock.json

# Kotlin
.kotlin/
3 changes: 3 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
:icons: font
:version: 1.17.0

WARNING: MocKMP is currently NOT compatible with Kotlin 2.x.
We are currently working on the new MocKMP version 2.0 that will be.

A Kotlin/Multiplatform Kotlin Symbol Processor that generates Mocks & Fakes.

Built in collaboration with https://www.deezer.com/[Deezer].
Expand Down
8 changes: 0 additions & 8 deletions build.gradle.kts

This file was deleted.

7 changes: 0 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# Gradle
org.gradle.jvmargs = -Xmx4g -XX:MaxMetaspaceSize=2g
org.gradle.parallel = true

# KSP
ksp.incremental.intermodule = true

# Kosi
org.kodein.no-default-junit = true
org.kodein.native.enableCrossCompilation=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

This file was deleted.

This file was deleted.

37 changes: 37 additions & 0 deletions mockmp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
plugins {
kodein.root
}

allprojects {
group = "org.kodein.mock"
version = "2.0.0"
}

/*
In a composite build, tasks run from the root will not automatically propagate to subprojects (see
https://github.com/gradle/gradle/issues/20863).
This plugin is for root build scripts that do not themselves have a "publish" task. It adds a
"publish" task that depends on the "publish" tasks of all subprojects, to emulate typical Gradle
behavior.
*/
apply { plugin("org.gradle.lifecycle-base") }
afterEvaluate {
listOf(
"publishToMavenLocal" to "publishing",
"publishAllPublicationsToOssrhStagingRepository" to "release",
"publishPlugins" to "plugin portal",
).forEach { (taskName, taskGroup) ->
if (taskName !in project.tasks.names) {
project.tasks.register(taskName) {
group = taskGroup
dependsOn(subprojects.map { ":${it.path}:$taskName" })
}
}
}

listOf("build", "clean", "assemble").forEach { taskName ->
tasks.named(taskName) {
dependsOn(subprojects.map { ":${it.path}:$taskName" })
}
}
}
11 changes: 11 additions & 0 deletions mockmp/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Gradle
org.gradle.jvmargs = -Xmx4g -XX:MaxMetaspaceSize=2g
org.gradle.parallel = true

# KSP
ksp.incremental.intermodule = true
#ksp.useKSP2 = true

# Kosi
org.kodein.no-default-junit = true
org.kodein.native.enableCrossCompilation=true
14 changes: 7 additions & 7 deletions gradle/libs.versions.toml → mockmp/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[versions]
buildConfig = "3.1.0"
coroutines = "1.7.3"
datetime = "0.4.0"
javassist = "3.29.2-GA"
kotlinPoet = "1.15.1"
ksp = "1.9.22-1.0.17"
objenesis = "3.2"
buildConfig = "5.3.5"
coroutines = "1.9.0-RC"
datetime = "0.6.0"
javassist = "3.30.2-GA"
kotlinPoet = "1.17.0"
ksp = "2.0.21-1.0.28"
objenesis = "3.4"

[plugins]
buildConfig = { id = "com.github.gmazzo.buildconfig", version.ref = "buildConfig" }
Expand Down
Loading

0 comments on commit a454f38

Please sign in to comment.