-
Notifications
You must be signed in to change notification settings - Fork 81
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
Support Kotlin/Native #855
base: main
Are you sure you want to change the base?
Conversation
can't wait to run my bot on an apple watch |
what's this commit? seems to be related to #836 but that is already on |
When I compiled these files were generated |
Need to buy one again for this, or ask @melike2d |
can't believe you think i have enough money for that |
the one in the build dir, sure, but the other ones? |
The use of value classes for the Reset class has already caused issues implementing #855. However, it was isolated to native platforms. Unfortunately, this behavior will become a compiler error soon, so we need to change it. This can be achieved by simply using the backing Instant instead of Reset with AtomicRef. Related Issues: #855 #69 Kotlin/kotlinx-atomicfu#291 https://youtrack.jetbrains.com/issue/KT-61584 Co-authored-by: lukellmann <lukellmann@gmail.com>
1f7f641
to
0724654
Compare
A workaround for the blocking teamcity bug has been implemented, snapshots are now published to |
- Migrate test-kit to use kotlinx-resources
# Conflicts: # buildSrc/src/main/kotlin/kord-internal-multiplatform-module.gradle.kts # common/build.gradle.kts # gradle/libs.versions.toml
I accidentally reintroduced them in the most recent merge of main into feature/native.
I spent way too much time reading documentation...
# Conflicts: # .github/workflows/gradle-wrapper-validation.yml # buildSrc/src/main/kotlin/kord-internal-multiplatform-module.gradle.kts # buildSrc/src/main/kotlin/kord-module.gradle.kts # buildSrc/src/main/kotlin/kord-multiplatform-module.gradle.kts # core/api/core.api # core/api/core.klib.api # core/live-tests/build.gradle.kts # core/src/commonMain/kotlin/Kord.kt # gateway/api/gateway.api # gateway/api/gateway.klib.api # gateway/src/commonMain/kotlin/Gateway.kt # gateway/src/commonMain/kotlin/Inflater.kt # gateway/src/commonMain/kotlin/Utils.kt # gradle/libs.versions.toml # voice/api/voice.api # voice/src/commonMain/kotlin/gateway/VoiceGateway.kt
@@ -63,6 +64,8 @@ class KordEventDropTest { | |||
) | |||
|
|||
@Test | |||
// This test seems to timeout sometimes on native | |||
@IgnoreOnNative |
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.
can we increase/remove the timeout as with js? #926
# Conflicts: # gradle/libs.versions.toml
# Conflicts: # .github/workflows/deployment-ci.yml # .github/workflows/docs-ci.yml # buildSrc/src/main/kotlin/kord-internal-multiplatform-module.gradle.kts # buildSrc/src/main/kotlin/kord-module.gradle.kts # buildSrc/src/main/kotlin/kord-multiplatform-module.gradle.kts # buildSrc/src/main/kotlin/kord-publishing.gradle.kts # core/src/commonMain/kotlin/Kord.kt # gateway/src/commonMain/kotlin/Gateway.kt # gateway/src/commonMain/kotlin/Utils.kt # gradle/libs.versions.toml # ksp-annotations/build.gradle.kts # voice/src/commonMain/kotlin/gateway/VoiceGateway.kt
internal actual fun formatIntegerFromLittleEndianLongArray(data: LongArray): String { | ||
val buffer = Buffer() | ||
data.reversedArray().forEach(buffer::writeLong) | ||
return BigInteger.fromByteArray(buffer.readByteArray(), Sign.POSITIVE).toString() | ||
} |
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.
just in case, an alternative implementation:
internal actual fun formatIntegerFromLittleEndianLongArray(data: LongArray): String {
// need to convert from little-endian data to big-endian expected by BigInteger
val bytes = ByteArray(size = data.size * Long.SIZE_BYTES)
val lastIndex = data.lastIndex
for (i in 0..lastIndex) {
val long = data[i]
val offset = (lastIndex - i) * Long.SIZE_BYTES
bytes[offset + 0] = long.ushr(56).toByte()
bytes[offset + 1] = long.ushr(48).toByte()
bytes[offset + 2] = long.ushr(40).toByte()
bytes[offset + 3] = long.ushr(32).toByte()
bytes[offset + 4] = long.ushr(24).toByte()
bytes[offset + 5] = long.ushr(16).toByte()
bytes[offset + 6] = long.ushr(8).toByte()
bytes[offset + 7] = long.ushr(0).toByte()
}
return BigInteger.fromByteArray(bytes, Sign.POSITIVE).toString()
}
This PR aims at implementing Kotlin/Native for the following platforms:
Experimental Snapshot
There currently is an experimental snapshot on OSSRH under the
feature-native-SNAPSHOT
for you to tryAn example implementation can be found here
Please note that you need to configure our custom repository:
Gradle Configuration
Current limitations
Checklist
Blocked by
TW-86481(Workaround implemented)