Skip to content

Commit

Permalink
Bump up Kotlin, Gradle etc. and clean up targets and source sets conf…
Browse files Browse the repository at this point in the history
…ig (#389)
  • Loading branch information
findjigar authored Feb 3, 2024
1 parent 96281ab commit d919d13
Show file tree
Hide file tree
Showing 49 changed files with 274 additions and 405 deletions.
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--ignore-engines true
40 changes: 28 additions & 12 deletions convention-plugins/src/main/kotlin/wasm-setup.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 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 @@ -9,6 +9,8 @@
*/

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")
Expand All @@ -18,24 +20,38 @@ kotlin {
val wasmEnabled = project.findProperty("enableWasm") == "true"
if (wasmEnabled) {
@OptIn(ExperimentalWasmDsl::class)
wasm {
browser()
wasmJs {
browser {
commonWebpackConfig {
devServer = (devServer ?: KotlinWebpackConfig.DevServer()).apply {
static = (static ?: mutableListOf()).apply {
add(project.rootDir.path)
}
}
}
}
nodejs()
d8()
binaries.executable()
}
}
sourceSets {
val jsAndWasmMain by creating
val jsAndWasmTest by creating
if (wasmEnabled) {
val wasmMain by getting {
dependsOn(jsAndWasmMain)
}

val wasmTest by getting {
dependsOn(jsAndWasmTest)
@Suppress("OPT_IN_USAGE")
applyDefaultHierarchyTemplate {
common {
group("jsAndWasmJs") {
withJs()
if (wasmEnabled) {
withWasm()
}
}
}
}
}

if (project.findProperty("enableWasm") == "true") {
rootProject.the<NodeJsRootExtension>().apply {
nodeVersion = "21.0.0-v8-canary202309143a48826a08"
nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary"
}
}
26 changes: 17 additions & 9 deletions extensions/kermit-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 @@ -11,7 +11,6 @@
* the License.
*/

import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand All @@ -20,19 +19,28 @@ plugins {
id("com.vanniktech.maven.publish")
}

apply(from = "../../gradle/configure-crash-logger.gradle")
kotlin {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
targetHierarchy.default()
androidTarget {
publishAllLibraryVariants()
}
macosX64()
macosArm64()
iosX64()
iosArm64()
iosSimulatorArm64()
tvosArm64()
tvosSimulatorArm64()
tvosX64()
watchosArm32()
watchosArm64()
watchosSimulatorArm64()
watchosDeviceArm64()
watchosX64()

sourceSets {
commonMain {
dependencies {
api(libs.crashkios.bugsnag)
}
commonMain.dependencies {
api(libs.crashkios.bugsnag)
implementation(project(":kermit-core"))
}
}
}
Expand Down
27 changes: 17 additions & 10 deletions extensions/kermit-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 @@ -11,7 +11,6 @@
* the License.
*/

import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand All @@ -20,20 +19,28 @@ plugins {
id("com.vanniktech.maven.publish")
}

apply(from = "../../gradle/configure-crash-logger.gradle")

kotlin {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
targetHierarchy.default()
androidTarget {
publishAllLibraryVariants()
}
macosX64()
macosArm64()
iosX64()
iosArm64()
iosSimulatorArm64()
tvosArm64()
tvosSimulatorArm64()
tvosX64()
watchosArm32()
watchosArm64()
watchosSimulatorArm64()
watchosDeviceArm64()
watchosX64()

sourceSets {
commonMain {
dependencies {
api(libs.crashkios.crashlytics)
}
commonMain.dependencies {
api(libs.crashkios.crashlytics)
implementation(project(":kermit-core"))
}
}
}
Expand Down
13 changes: 4 additions & 9 deletions extensions/kermit-koin/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 @@ -11,7 +11,6 @@
* the License.
*/

import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand All @@ -21,8 +20,6 @@ plugins {
}

kotlin {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
targetHierarchy.default()
androidTarget {
publishAllLibraryVariants()
}
Expand Down Expand Up @@ -55,11 +52,9 @@ kotlin {
// androidNativeX64()

sourceSets {
commonMain {
dependencies {
implementation(project(":kermit"))
implementation(libs.koin)
}
commonMain.dependencies {
implementation(project(":kermit"))
implementation(libs.koin)
}
}
}
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 @@ org.gradle.jvmargs=-Xmx4g
SONATYPE_HOST=DEFAULT
RELEASE_SIGNING_ENABLED=true
GROUP=co.touchlab
VERSION_NAME=2.0.2
VERSION_NAME=2.0.3

POM_NAME=Kermit
POM_DESCRIPTION=Kermit The Log
Expand Down
55 changes: 0 additions & 55 deletions gradle/configure-crash-logger.gradle

This file was deleted.

18 changes: 9 additions & 9 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ minSdk = "21"
compileSdk = "34"

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

androidx-core = "1.12.0"
androidx-appcompat = "1.6.1"
androidx-constraintLayout = "2.1.4"
androidx-navigationFragment = "2.7.2"
androidx-navigationUI = "2.7.2"
androidx-navigationFragment = "2.7.6"
androidx-navigationUI = "2.7.6"
androidx-coordinatorLayout = "1.2.0"

android-gradle-plugin = "8.1.1"
android-gradle-plugin = "8.2.2"
android-test-runner = "1.5.2"

google-services = "4.3.15"
google-services = "4.4.0"

stately = "2.0.4"
testhelp = "0.6.11"
Expand All @@ -26,13 +26,13 @@ crashkios = "0.8.5"
bugsnag = "5.31.1"
bugsnag-gradle-plugin = "8.0.1"

koin-core = "3.5.0"
koin-android = "3.5.0"
koin-test = "3.5.0"
koin-core = "3.5.3"
koin-android = "3.5.3"
koin-test = "3.5.3"
coroutines = "1.7.3"
roboelectric = "4.10.3"
buildConfig = "4.1.2"
mavenPublish = "0.25.3"
mavenPublish = "0.27.0"

android-junitTest = "1.1.5"
junit = "4.13.2"
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
Loading

0 comments on commit d919d13

Please sign in to comment.