Skip to content
This repository was archived by the owner on Aug 18, 2025. It is now read-only.

Move BinaryByteUnitTest into commonMain with preliminary iOS support.#30

Open
vanniktech wants to merge 15 commits intoJakeWharton:masterfrom
vanniktech:BinaryByteUnitTest-kmp
Open

Move BinaryByteUnitTest into commonMain with preliminary iOS support.#30
vanniktech wants to merge 15 commits intoJakeWharton:masterfrom
vanniktech:BinaryByteUnitTest-kmp

Conversation

@vanniktech
Copy link
Contributor

References #10

Is this how you'd want to do the enum dance? #10 (comment)

If so, I can continue with the others.

@@ -9,7 +9,7 @@ package com.jakewharton.byteunits
* @see BinaryByteUnit
* @see BitUnit
*/
sealed interface ByteUnit {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make it sealed again once everything is in commonMain. Currently, we can't mix between source sets.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't. Actual implementations use that interface to implement it, which the Kotlin compiler does not allow if it's sealed.

import platform.Foundation.NSNumberFormatter

/**
* A [BinaryByteUnit] represents power-of-two byte sizes at a given unit of granularity and
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to duplicate the documentation or only have it at the commonMain level?

@vanniktech
Copy link
Contributor Author

Do we need something so that the CI works?

Could not read standard output of command '/usr/bin/xcrun'.
java.lang.NoSuchMethodError: 'void org.gradle.api.internal.tasks.testing.TestResultProcessor.failure(java.lang.Object, java.lang.Throwable)'

	at org.jetbrains.kotlin.gradle.internal.testing.TCServiceMessagesClient.failure(TCServiceMessagesClient.kt:176)
> Task :iosX64Test FAILED
	at org.jetbrains.kotlin.gradle.internal.testing.TCServiceMessagesClient.serviceMessage(TCServiceMessagesClient.kt:78)

	at jetbrains.buildServer.messages.serviceMessages.ServiceMessagesParser.parse(ServiceMessagesParser.java:54)
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
	at jetbrains.buildServer.messages.serviceMessages.ServiceMessage.parse(ServiceMessage.java:121)

	at org.jetbrains.kotlin.gradle.internal.testing.TCServiceMessageOutputStreamHandler.parse(TCServiceMessageOutputStreamHandler.kt:121)
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
	at org.jetbrains.kotlin.gradle.internal.testing.TCServiceMessageOutputStreamHandler.flushLine(TCServiceMessageOutputStreamHandler.kt:81)

	at org.jetbrains.kotlin.gradle.internal.testing.TCServiceMessageOutputStreamHandler.write(TCServiceMessageOutputStreamHandler.kt:61)
See https://docs.gradle.org/7.6/userguide/command_line_interface.html#sec:command_line_warnings
	at org.gradle.process.internal.streams.ExecOutputHandleRunner.forwardContent(ExecOutputHandleRunner.java:[67](https://github.com/JakeWharton/byteunits/actions/runs/3995904568/jobs/6855316461#step:5:68))
	at org.gradle.process.internal.streams.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:53)
	at org.gradle.internal.operations.CurrentBuildOperationPreservingRunnable.run(CurrentBuildOperationPreservingRunnable.java:42)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:49)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:[82](https://github.com/JakeWharton/byteunits/actions/runs/3995904568/jobs/6855316461#step:5:83)9)
22 actionable tasks: 22 executed

@JakeWharton
Copy link
Owner

Downgrade to Gradle 7.5 or upgrade to Kotlin 1.8.

@JakeWharton
Copy link
Owner

Crazy week. I'll look soon.

@JakeWharton
Copy link
Owner

Okay renovate is on so a bunch of things got updated. Repo is on Kotlin 1.8 and Gradle 7.6 now so rebase and all should be good.

@vanniktech
Copy link
Contributor Author

@JakeWharton this is finally green now.

@vanniktech
Copy link
Contributor Author

@JakeWharton had some spare time and finished everything. The repo is now multiplatform with ios & jvm targets. Also adjusted all the tests.

@JakeWharton
Copy link
Owner

I'm on paternity leave in a week and will have more time to look. Kinda. Less work distraction, more like.

@vanniktech
Copy link
Contributor Author

No rush. I've published this myself: com.vanniktech:byteunits:0.11.0 so I can start using it in production.

@vanniktech
Copy link
Contributor Author

Resolved the conflicts.

@vanniktech
Copy link
Contributor Author

@JakeWharton friendly ping

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants