Skip to content

Commit

Permalink
Bump dependencies to latest stable versions (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
05nelsonm authored Nov 20, 2023
1 parent 591ba1d commit 9a9b972
Show file tree
Hide file tree
Showing 27 changed files with 99 additions and 87 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
fail-fast: false
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
job: [ test ]

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -50,17 +49,17 @@ jobs:
java-version: 11

- name: Run macOS Tests
if: matrix.os == 'macos-latest' && matrix.job == 'test'
if: matrix.os == 'macos-latest'
run: >
./gradlew check --stacktrace
-PKMP_TARGETS="JVM,JS,IOS_ARM32,IOS_ARM64,IOS_X64,IOS_SIMULATOR_ARM64,MACOS_ARM64,MACOS_X64,TVOS_ARM64,TVOS_X64,TVOS_SIMULATOR_ARM64,WATCHOS_ARM32,WATCHOS_ARM64,WATCHOS_DEVICE_ARM64,WATCHOS_X64,WATCHOS_X86,WATCHOS_SIMULATOR_ARM64,WASM,WASM_32"
-PKMP_TARGETS="JVM,JS,IOS_ARM64,IOS_X64,IOS_SIMULATOR_ARM64,MACOS_ARM64,MACOS_X64,TVOS_ARM64,TVOS_X64,TVOS_SIMULATOR_ARM64,WATCHOS_ARM32,WATCHOS_ARM64,WATCHOS_DEVICE_ARM64,WATCHOS_X64,WATCHOS_SIMULATOR_ARM64,WASM_JS,WASM_WASI"
- name: Run Linux Tests
if: matrix.os == 'ubuntu-latest' && matrix.job == 'test'
if: matrix.os == 'ubuntu-latest'
run: >
./gradlew check --stacktrace
-PKMP_TARGETS="JVM,JS,ANDROID,ANDROID_ARM32,ANDROID_ARM64,ANDROID_X64,ANDROID_X86,LINUX_ARM32HFP,LINUX_ARM64,LINUX_MIPS32,LINUX_MIPSEL32,LINUX_X64,WASM,WASM_32"
-PKMP_TARGETS="JVM,JS,ANDROID,ANDROID_ARM32,ANDROID_ARM64,ANDROID_X64,ANDROID_X86,LINUX_ARM64,LINUX_X64,WASM_JS,WASM_WASI"
- name: Run Windows Tests
if: matrix.os == 'windows-latest' && matrix.job == 'test'
if: matrix.os == 'windows-latest'
run: >
./gradlew check --stacktrace
-PKMP_TARGETS="JVM,JS,MINGW_X64,MINGW_X86,WASM,WASM_32"
-PKMP_TARGETS="JVM,JS,MINGW_X64,WASM_JS,WASM_WASI"
21 changes: 10 additions & 11 deletions .kotlin-js-store/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
# yarn lockfile v1


"@ungap/[email protected]":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44"
integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==

[email protected]:
version "4.1.1"
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348"
Expand Down Expand Up @@ -185,7 +180,7 @@ flat@^5.0.2:
resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241"
integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==

[email protected]:
format-util@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/format-util/-/format-util-1.0.5.tgz#1ffb450c8a03e7bccffe40643180918cc297d271"
integrity sha512-varLbTj0e0yVyRpqQhuWV+8hlePAgaoFRhNFj50BNjEIrw1/DphHSObtqwskVCPWNgzwPoQrZAbfa/SBiicNeg==
Expand Down Expand Up @@ -322,12 +317,11 @@ minimatch@^3.0.4:
dependencies:
brace-expansion "^1.1.7"

mocha@10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.0.0.tgz#205447d8993ec755335c4b13deba3d3a13c4def9"
integrity sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA==
mocha@10.2.0:
version "10.2.0"
resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.2.0.tgz#1fd4a7c32ba5ac372e03a17eef435bd00e5c68b8"
integrity sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==
dependencies:
"@ungap/promise-all-settled" "1.1.2"
ansi-colors "4.1.1"
browser-stdout "1.3.1"
chokidar "3.5.3"
Expand Down Expand Up @@ -492,6 +486,11 @@ to-regex-range@^5.0.1:
dependencies:
is-number "^7.0.0"

[email protected]:
version "5.0.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b"
integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==

[email protected]:
version "6.2.1"
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343"
Expand Down
4 changes: 2 additions & 2 deletions build-logic/src/main/kotlin/-KmpConfigurationExtension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ fun KmpConfigurationExtension.configureShared(
}

js()
// wasm()
// wasmNativeAll()
// wasmJs {}
// wasmWasi {}

androidNativeAll()

Expand Down
7 changes: 5 additions & 2 deletions build-logic/src/main/kotlin/configuration.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED
import org.gradle.api.tasks.testing.logging.TestLogEvent.PASSED
import org.gradle.api.tasks.testing.logging.TestLogEvent.SKIPPED
import org.gradle.api.tasks.testing.logging.TestLogEvent.STANDARD_ERROR
import org.gradle.api.tasks.testing.logging.TestLogEvent.STANDARD_OUT
import org.gradle.api.tasks.testing.logging.TestLogEvent.STARTED

plugins {
id("io.matthewnelson.kmp.configuration")
}

tasks.withType<Test> {
tasks.withType<AbstractTestTask> {
testLogging {
exceptionFormat = TestExceptionFormat.FULL
events(STARTED, PASSED, SKIPPED, FAILED)
events(STARTED, PASSED, SKIPPED, FAILED, STANDARD_ERROR, STANDARD_OUT)
showStandardStreams = true
showStackTraces = true
}
}
5 changes: 5 additions & 0 deletions build-logic/src/main/kotlin/publication.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ if (!version.toString().endsWith("-SNAPSHOT")) {
useGpgCmd()
}
}

tasks.withType<AbstractArchiveTask>().configureEach {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
}
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension

@Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.multiplatform) apply(false)
alias(libs.plugins.binaryCompat)
Expand Down Expand Up @@ -52,7 +51,7 @@ apiValidation {
}

fun isNonStable(version: String): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.toUpperCase().contains(it) }
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) }
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
val isStable = stableKeyword || regex.matches(version)
return isStable.not()
Expand All @@ -72,11 +71,12 @@ tasks.withType<DependencyUpdatesTask> {
// Example 3: using the full syntax
resolutionStrategy {
componentSelection {
all {
@Suppress("RedundantSamConstructor")
all(Action {
if (isNonStable(candidate.version) && !isNonStable(currentVersion)) {
reject("Release candidate")
}
}
})
}
}
}
4 changes: 1 addition & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ org.gradle.parallel=true
org.gradle.caching=true

kotlin.code.style=official
kotlin.js.compiler=both
kotlin.mpp.enableCompatibilityMetadataVariant=true
kotlin.mpp.applyDefaultHierarchyTemplate=false
kotlin.mpp.stability.nowarn=true
kotlin.native.binary.memoryModel=experimental
kotlin.native.ignoreDisabledTargets=true

SONATYPE_HOST=S01
Expand Down
12 changes: 6 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[versions]
binaryCompat = "0.13.0"
configuration = "0.1.1"
coroutines = "1.6.4"
gradleVersions = "0.46.0"
kotlin = "1.8.10"
publish = "0.24.0"
binaryCompat = "0.13.2"
configuration = "0.1.5"
coroutines = "1.7.3"
gradleVersions = "0.50.0"
kotlin = "1.9.20"
publish = "0.25.3"

[libraries]
gradle-kmp-configuration = { module = "io.matthewnelson:gradle-kmp-configuration-plugin", version.ref = "configuration" }
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

# https://gradle.org/release-checksums/
distributionSha256Sum=948d1e4ccc2f6ae36cbfa087d827aaca51403acae5411e664a6000bb47946f22
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip
distributionSha256Sum=f2b9ed0faf8472cbe469255ae6c86eddb77076c75191741b4a462f33128dd419
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
4 changes: 2 additions & 2 deletions sample/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ then print random bytes.

Java:
```shell
./gradlew :sample:run -PKMP_TARGETS="JVM"
./gradlew :sample:jvmRun -PKMP_TARGETS="JVM"
```

Native:
```shell
./gradlew :sample:runDebugExecutableNativeSample -PKMP_TARGETS="LINUX_ARM64,LINUX_X64,MACOS_ARM64,MACOS_X64,MINGW_X64,MINGW_X86"
./gradlew :sample:runDebugExecutableNativeSample -PKMP_TARGETS="LINUX_ARM64,LINUX_X64,MACOS_ARM64,MACOS_X64,MINGW_X64"
```
22 changes: 8 additions & 14 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**/
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget

plugins {
Expand All @@ -22,9 +23,14 @@ plugins {
kmpConfiguration {
configure {
jvm {
pluginIds("application")
target {
withJava()

target { withJava() }
@OptIn(ExperimentalKotlinGradlePluginApi::class)
mainRun {
mainClass.set("MainKt")
}
}

kotlinJvmTarget = JavaVersion.VERSION_1_8
compileSourceCompatibility = JavaVersion.VERSION_1_8
Expand Down Expand Up @@ -79,10 +85,8 @@ kmpConfiguration {
}
}
os.isWindows -> {
@Suppress("DEPRECATION")
when (arch) {
X64 -> mingwX64(targetName) { target { setup() } }
X86 -> mingwX86(targetName) { target { setup() } }
}
}
}
Expand All @@ -94,15 +98,5 @@ kmpConfiguration {
}
}
}

kotlin {
sourceSets {
findByName("jvmMain")?.let {
extensions.configure<JavaApplication>("application") {
mainClass.set("MainKt")
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**/
@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")

package org.kotlincrypto

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,26 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**/
@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")

package org.kotlincrypto.internal

import kotlinx.cinterop.Pinned
import kotlinx.cinterop.addressOf
import kotlinx.cinterop.UnsafeNumber
import kotlinx.cinterop.convert
import kotlinx.cinterop.*
import platform.Security.SecRandomCopyBytes
import platform.Security.kSecRandomDefault
import org.kotlincrypto.SecRandomCopyException

/**
* https://developer.apple.com/documentation/security/1399291-secrandomcopybytes
* */
@OptIn(ExperimentalForeignApi::class, UnsafeNumber::class)
internal actual abstract class SecRandomDelegate private actual constructor() {

@Throws(SecRandomCopyException::class)
internal actual abstract fun nextBytesCopyTo(bytes: Pinned<ByteArray>, size: Int)

internal actual companion object: SecRandomDelegate() {

@OptIn(UnsafeNumber::class)
@Throws(SecRandomCopyException::class)
actual override fun nextBytesCopyTo(bytes: Pinned<ByteArray>, size: Int) {
// kSecRandomDefault is synonymous to NULL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**/
@file:Suppress("ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT", "EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")

package org.kotlincrypto

import org.kotlincrypto.internal.commonNextBytesOf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**/
@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING", "ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT")

package org.kotlincrypto

import org.kotlincrypto.internal.commonNextBytesOf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
**/
package org.kotlincrypto.internal

import kotlinx.cinterop.ByteVar
import kotlinx.cinterop.CPointer
import kotlinx.cinterop.Pinned
import kotlinx.cinterop.addressOf
import kotlinx.cinterop.*
import platform.posix.EINTR
import platform.posix.errno

Expand All @@ -29,6 +26,7 @@ import platform.posix.errno
* this ensures that the call is repeated until it has been
* completely filled.
* */
@OptIn(ExperimentalForeignApi::class)
internal inline fun Pinned<ByteArray>.fillCompletely(
size: Int,
block: (ptr: CPointer<ByteVar>, length: Int) -> Int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import platform.posix.*
* @see [isAvailable]
* @see [getrandom]
* */
@OptIn(ExperimentalForeignApi::class, UnsafeNumber::class)
internal class GetRandom private constructor(): SecRandomSynchronized() {

internal companion object {
Expand All @@ -54,7 +55,6 @@ internal class GetRandom private constructor(): SecRandomSynchronized() {
* */
internal fun isAvailable(): Boolean {
return synchronizedRemember { buf, size ->
@OptIn(UnsafeNumber::class)
val result = getrandom(buf, size.toULong().convert(), GRND_NONBLOCK)
if (result < 0) {
when (errno) {
Expand All @@ -74,15 +74,13 @@ internal class GetRandom private constructor(): SecRandomSynchronized() {
* Must always call [isAvailable] beforehand to ensure
* availability on the system.
* */
@OptIn(UnsafeNumber::class)
@Throws(SecRandomCopyException::class)
internal fun getrandom(buf: Pinned<ByteArray>, buflen: Int) {
buf.fillCompletely(buflen) { ptr, len ->
getrandom(ptr, len.toULong().convert(), NO_FLAGS)
}
}

@OptIn(UnsafeNumber::class)
private fun getrandom(
buf: CPointer<ByteVar>,
buflen: size_t,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**/
@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")

package org.kotlincrypto.internal

import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.cinterop.Pinned
import org.kotlincrypto.SecRandomCopyException

@OptIn(ExperimentalForeignApi::class)
internal actual abstract class SecRandomDelegate private actual constructor() {

@Throws(SecRandomCopyException::class)
Expand Down
Loading

0 comments on commit 9a9b972

Please sign in to comment.