Skip to content

Commit

Permalink
Update Kotlin to 1.9.22 and other dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
findjigar committed Jan 5, 2024
1 parent 2ab6c4c commit 2c17429
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 58 deletions.
25 changes: 10 additions & 15 deletions bugsnag/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Touchlab
* 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. You may obtain a copy of the License at
*
Expand All @@ -10,6 +10,7 @@
* or implied. 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.tasks.KotlinCompile

plugins {
Expand All @@ -25,7 +26,10 @@ group = GROUP
version = VERSION_NAME

kotlin {
targetHierarchy.default()
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}
androidTarget {
publishAllLibraryVariants()
}
Expand All @@ -47,39 +51,30 @@ kotlin {
tvosX64()

sourceSets {
val commonMain by getting {
commonMain {
dependencies {
implementation(project(":core"))
}
}
val commonTest by getting {
commonTest {
dependencies {
implementation(kotlin("test"))
}
}
val darwinMain by creating {
dependsOn(commonMain)
appleMain {
dependencies {
implementation(libs.nsexceptionKt.core)
}
}
val darwinTest by creating {
dependsOn(commonTest)
}

val androidMain by getting {
androidMain {
dependencies {
compileOnly(libs.bugsnag.android)
}
}

targets.withType<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget>().all {
val mainCompilation = compilations.getByName("main")
val mainSourceSet = mainCompilation.defaultSourceSet
val testSourceSet = compilations.getByName("test").defaultSourceSet

mainSourceSet.dependsOn(darwinMain)
testSourceSet.dependsOn(darwinTest)

mainCompilation.cinterops.create("bugsnag") {
includeDirs("$projectDir/src/include")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package co.touchlab.crashkios.bugsnag

import com.rickclephas.kmp.nsexceptionkt.core.asNSException
import com.rickclephas.kmp.nsexceptionkt.core.causes
import kotlinx.cinterop.ExperimentalForeignApi

@OptIn(ExperimentalForeignApi::class)
actual class BugsnagCallsActual : BugsnagCalls {

override fun logMessage(message: String) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
@file:OptIn(ExperimentalForeignApi::class)

package co.touchlab.crashkios.bugsnag

import com.rickclephas.kmp.nsexceptionkt.core.asNSException
import com.rickclephas.kmp.nsexceptionkt.core.causes
import com.rickclephas.kmp.nsexceptionkt.core.wrapUnhandledExceptionHook
import kotlinx.cinterop.ExperimentalForeignApi
import platform.Foundation.NSException

public fun startBugsnag(config: BugsnagConfiguration){
Expand Down
24 changes: 7 additions & 17 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Touchlab
* 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. You may obtain a copy of the License at
*
Expand All @@ -10,6 +10,7 @@
* or implied. 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.tasks.KotlinCompile

plugins {
Expand All @@ -24,6 +25,10 @@ group = GROUP
version = VERSION_NAME

kotlin {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}
androidTarget {
publishAllLibraryVariants()
}
Expand All @@ -45,26 +50,11 @@ kotlin {
tvosX64()

sourceSets {
val commonMain by getting
val commonTest by getting {
commonTest {
dependencies {
implementation(kotlin("test"))
}
}
val darwinMain by creating {
dependsOn(commonMain)
}
val darwinTest by creating {
dependsOn(commonTest)
}

targets.withType<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget>().all {
val mainSourceSet = compilations.getByName("main").defaultSourceSet
val testSourceSet = compilations.getByName("test").defaultSourceSet

mainSourceSet.dependsOn(darwinMain)
testSourceSet.dependsOn(darwinTest)
}
}
}

Expand Down
26 changes: 10 additions & 16 deletions crashlytics/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Touchlab
* 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. You may obtain a copy of the License at
*
Expand All @@ -10,6 +10,7 @@
* or implied. 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.tasks.KotlinCompile

plugins {
Expand All @@ -25,7 +26,10 @@ group = GROUP
version = VERSION_NAME

kotlin {
targetHierarchy.default()
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}
androidTarget {
publishAllLibraryVariants()
}
Expand All @@ -47,40 +51,30 @@ kotlin {
tvosX64()

sourceSets {
val commonMain by getting {
commonMain {
dependencies {
implementation(project(":core"))
}
}
val commonTest by getting {
commonTest {
dependencies {
implementation(kotlin("test"))
}
}
val darwinMain by creating {
dependsOn(commonMain)
appleMain {
dependencies {
implementation(libs.nsexceptionKt.core)
}
}
val darwinTest by creating {
dependsOn(commonTest)
}

val androidMain by getting {
androidMain {
dependencies {
compileOnly(libs.firebase.crashlytics)
}
}

targets.withType<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget>().all {
val mainCompilation = compilations.getByName("main")
val mainSourceSet = mainCompilation.defaultSourceSet
val testSourceSet = compilations.getByName("test").defaultSourceSet

mainSourceSet.dependsOn(darwinMain)
testSourceSet.dependsOn(darwinTest)

mainCompilation.cinterops.create("crashlytics") {
includeDirs("$projectDir/src/include")
compilerOpts("-DNS_FORMAT_ARGUMENT(A)=", "-D_Nullable_result=_Nullable")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package co.touchlab.crashkios.crashlytics

import com.rickclephas.kmp.nsexceptionkt.core.asNSException
import com.rickclephas.kmp.nsexceptionkt.core.getFilteredStackTraceAddresses
import kotlinx.cinterop.UnsafeNumber
import kotlinx.cinterop.convert

@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
Expand All @@ -10,6 +11,7 @@ actual class CrashlyticsCallsActual : CrashlyticsCalls {
FIRCrashlytics.crashlytics().log(message)
}

@OptIn(UnsafeNumber::class)
override fun sendHandledException(throwable: Throwable) {
val exceptionClassName = throwable::class.qualifiedName
val exModel = FIRExceptionModel.exceptionModelWithName(exceptionClassName, throwable.message)!!
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ kotlin.code.style=official
SONATYPE_HOST=DEFAULT
RELEASE_SIGNING_ENABLED=true
GROUP=co.touchlab.crashkios
VERSION_NAME=0.8.5
VERSION_NAME=0.9.0

POM_URL=https://github.com/touchlab/CrashKios
POM_DESCRIPTION=Kotlin Native iOS Crash Report Library
Expand Down
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ targetSdk = "34"
compileSdk = "34"

# Dependencies
kotlin = "1.9.10"
android-gradle-plugin = "8.1.0"
mavenPublish = "0.25.3"
kotlin = "1.9.22"
android-gradle-plugin = "8.2.1"
mavenPublish = "0.26.0"
touchlab-docusaurus-template = "0.1.10"
gradlePublish = "1.2.1"
nsexceptionKt = "0.1.10"
firebase-crashlytics = "18.4.1"
bugsnag = "5.31.1"
crashkios = "0.8.3"
crashkios = "0.8.5"

# Sample Apps
androidx-core = "1.12.0"
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
12 changes: 8 additions & 4 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# 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"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -133,10 +130,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
Expand Down Expand Up @@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then
done
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
Expand Down

0 comments on commit 2c17429

Please sign in to comment.