Skip to content

Commit

Permalink
Upgrade to Kotlin 2.0.20
Browse files Browse the repository at this point in the history
  • Loading branch information
findjigar committed Nov 8, 2024
1 parent 1650e69 commit dcee646
Show file tree
Hide file tree
Showing 25 changed files with 837 additions and 1,765 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ build/

local.properties

Pods
Pods

# Intermediate klibs
.kotlin
29 changes: 8 additions & 21 deletions convention-plugins/src/main/kotlin/wasm-setup.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask

/*
* Copyright (c) 2024 Touchlab
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
Expand All @@ -8,31 +10,17 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig

plugins {
kotlin("multiplatform")
}

kotlin {
val wasmEnabled = project.findProperty("enableWasm") == "true"
if (wasmEnabled) {
@OptIn(ExperimentalWasmDsl::class)
@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class)
wasmJs {
browser {
commonWebpackConfig {
devServer = (devServer ?: KotlinWebpackConfig.DevServer()).apply {
static = (static ?: mutableListOf()).apply {
add(project.rootDir.path)
}
}
}
}
browser()
nodejs()
d8()
binaries.executable()
}
}

Expand All @@ -42,16 +30,15 @@ kotlin {
group("jsAndWasmJs") {
withJs()
if (wasmEnabled) {
withWasm()
withWasmJs()
}
}
}
}
}

if (project.findProperty("enableWasm") == "true") {
rootProject.the<NodeJsRootExtension>().apply {
nodeVersion = "21.0.0-v8-canary202309143a48826a08"
nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary"
tasks.withType(KotlinCompilationTask::class).configureEach {
compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx4g
SONATYPE_HOST=DEFAULT
RELEASE_SIGNING_ENABLED=true
GROUP=co.touchlab
VERSION_NAME=2.0.4
VERSION_NAME=2.0.5

POM_NAME=Kermit
POM_DESCRIPTION=Kermit The Log
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ minSdk = "21"
compileSdk = "34"

# Dependencies
kotlin = "1.9.22"
kotlin = "2.0.20"
binaryCompatability = "0.13.2"

androidx-core = "1.12.0"
Expand All @@ -29,7 +29,7 @@ bugsnag-gradle-plugin = "8.0.1"
koin-core = "3.5.3"
koin-android = "3.5.3"
koin-test = "3.5.3"
coroutines = "1.7.3"
coroutines = "1.9.0"
roboelectric = "4.10.3"
buildConfig = "4.1.2"
mavenPublish = "0.27.0"
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
17 changes: 9 additions & 8 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -144,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -201,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,9 @@ internal interface ConsoleIntf {
fun log(output: String)
}

internal expect object ConsoleActual : ConsoleIntf
internal expect object ConsoleActual : ConsoleIntf {
override fun error(output: String)
override fun warn(output: String)
override fun info(output: String)
override fun log(output: String)
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
package co.touchlab.kermit

internal actual object ConsoleActual : ConsoleIntf {
override fun error(output: String) {
actual override fun error(output: String) {
console.error(output)
}

override fun warn(output: String) {
actual override fun warn(output: String) {
console.warn(output)
}

override fun info(output: String) {
actual override fun info(output: String) {
console.info(output)
}

override fun log(output: String) {
actual override fun log(output: String) {
console.log(output)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ external fun consoleInfo(output: String)
external fun consoleLog(output: String)

internal actual object ConsoleActual : ConsoleIntf {
override fun error(output: String) {
actual override fun error(output: String) {
consoleError(output)
}

override fun warn(output: String) {
actual override fun warn(output: String) {
consoleWarn(output)
}

override fun info(output: String) {
actual override fun info(output: String) {
consoleInfo(output)
}

override fun log(output: String) {
actual override fun log(output: String) {
consoleLog(output)
}
}
Loading

0 comments on commit dcee646

Please sign in to comment.