-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Don't crash when running on Kotlin before 2.1.20+ #1647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0600a43
to
1231947
Compare
This crash impacts people using FakeFileSystem in code that runs in a Gradle plugin.
1231947
to
dd4c01b
Compare
public fun <init> ()V | ||
public fun <init> (Lkotlin/time/Clock;)V | ||
public synthetic fun <init> (Lkotlin/time/Clock;ILkotlin/jvm/internal/DefaultConstructorMarker;)V | ||
public synthetic fun <init> (Lkotlinx/datetime/Clock;)V | ||
public synthetic fun <init> (Lkotlinx/datetime/Clock;ILkotlin/jvm/internal/DefaultConstructorMarker;)V |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the function I very much want to restore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without it, lots of downstream tests fail like this:
java.lang.NoSuchMethodError: 'void okio.fakefilesystem.FakeFileSystem.<init>(kotlinx.datetime.Clock, int, kotlin.jvm.internal.DefaultConstructorMarker)'
at com.squareup.wire.SchemaBuilder.<init>(SchemaBuilder.kt:32)
at app.cash.api.ProguardRulesGeneratorTest.stuff(ProguardRulesGeneratorTest.kt:68)
```
@@ -1,8 +1,9 @@ | |||
public final class okio/fakefilesystem/FakeFileSystem : okio/FileSystem { | |||
public final field clock Lkotlin/time/Clock; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can’t have this field and maintain compatibility with Gradle 8.x.
@@ -20,6 +21,7 @@ public final class okio/fakefilesystem/FakeFileSystem : okio/FileSystem { | |||
public final fun getAllowReadsWhileWriting ()Z | |||
public final fun getAllowSymlinks ()Z | |||
public final fun getAllowWritesWhileWriting ()Z | |||
public final fun getClock ()Lkotlin/time/Clock; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...But this property should be fine.
@@ -18,7 +18,7 @@ jmh-gradle-plugin = { module = "me.champeau.jmh:jmh-gradle-plugin", version = "0 | |||
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } | |||
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test" } | |||
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit" } | |||
kotlin-time = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version = "0.7.0" } | |||
kotlin-time = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version = "0.7.0-0.6.x-compat" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This compat version is a nice bridge
This crash impacts people using FakeFileSystem in code that runs in a Gradle plugin.