Skip to content

Commit

Permalink
Gradle: Update Android plugin to 8.2.2
Browse files Browse the repository at this point in the history
This is the latest version supported by IntelliJ 2023.3. Keep only
global plugins in root build.gradle.kts. Plugins that are used in
multiple projects, but not globally are configured in
settings.gradle.kts and applied in subprojects.
  • Loading branch information
saschpe committed Mar 23, 2024
1 parent 8d03e22 commit 53dcd11
Show file tree
Hide file tree
Showing 22 changed files with 53 additions and 53 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{kt,kts}]
ktlint_standard_no-wildcard-imports = disabled
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Dependency update:
- [Kotlin 1.9.10](https://kotlinlang.org/docs/whatsnew19.html)
- [Gradle-8.7](https://docs.gradle.org/8.7/release-notes.html)
- [Android Gradle Plugin 8.2.2](https://developer.android.com/build/releases/past-releases/agp-8-2-0-release-notes)

## [1.2.3] - 2022-10-12
### Changed
Expand Down
14 changes: 10 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
plugins {
kotlin("jvm") version "1.9.10"
id("com.android.library") version "7.3.0" apply false
id("com.diffplug.spotless") version "6.21.0"
id("com.github.ben-manes.versions") version "0.48.0"
}
Expand All @@ -11,9 +9,17 @@ spotless {
propertiesFile("gradle.properties")
}
kotlin {
ktlint()
target("**/*.kt")
ktlint().setEditorConfigPath(".editorconfig")
}
kotlinGradle {
ktlint()
ktlint().setEditorConfigPath(".editorconfig")
}
}

tasks.withType<com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask> {
rejectVersionIf {
fun isStable(version: String) = Regex("^[0-9,.v-]+(-r)?$").matches(version)
!isStable(candidate.version) && isStable(currentVersion)
}
}
21 changes: 5 additions & 16 deletions log4k-slf4j/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,37 +32,26 @@ kotlin {
sourceSets["jvmMain"].dependencies {
implementation("org.slf4j:slf4j-api:1.7.36")
}

targets.withType(org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithSimulatorTests::class.java) {
testRuns["test"].deviceId = "iPhone 14"
}
}

java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))

android {
buildToolsVersion = "33.0.0"
compileSdk = 33
namespace = "saschpe.log4k.slf4j"

defaultConfig {
compileSdk = 33
minSdk = 17
targetSdk = 33
}

sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")

testCoverage.jacocoVersion = "0.8.8"
testCoverage.jacocoVersion = "0.8.10"
}

group = "de.peilicke.sascha"
version = "1.2.3"

val javadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
}

publishing {
publications.withType<MavenPublication> {
artifact(javadocJar.get())

pom {
name.set("Log4K-SLF4J")
description.set("Lightweight logging library for Kotlin/Multiplatform - SLF4J integration. Supports Android, iOS, JavaScript and plain JVM environments.")
Expand Down
1 change: 0 additions & 1 deletion log4k-slf4j/src/androidMain/AndroidManifest.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ actual object MDC {
actual fun remove(key: String) = org.slf4j.MDC.remove(key)

actual fun clear() = org.slf4j.MDC.clear()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ actual class SLF4JLogger : Logger() {
Log.Level.Assert -> error(message, throwable)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ expect object MDC {
fun get(key: String): String?
fun remove(key: String)
fun clear()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ import saschpe.log4k.Logger
*
* On JVM or Android, SLF4J is used for logging. On JS or Apple platforms, console logging is used internally.
*/
expect class SLF4JLogger : Logger
expect class SLF4JLogger : Logger
2 changes: 1 addition & 1 deletion log4k-slf4j/src/iosMain/kotlin/saschpe/log4k/slf4j/MDC.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ actual object MDC {
}

actual fun clear() = context.clear()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ actual class SLF4JLogger : Logger() {

override fun print(level: Log.Level, tag: String, message: String?, throwable: Throwable?) =
logger.log(level, tag, message, throwable)
}
}
2 changes: 1 addition & 1 deletion log4k-slf4j/src/jsMain/kotlin/saschpe/log4k/slf4j/MDC.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ actual object MDC {
}

actual fun clear() = context.clear()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ actual class SLF4JLogger : Logger() {

override fun print(level: Log.Level, tag: String, message: String?, throwable: Throwable?) =
logger.log(level, tag, message, throwable)
}
}
2 changes: 1 addition & 1 deletion log4k-slf4j/src/jvmMain/kotlin/saschpe/log4k/slf4j/MDC.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ actual object MDC {
actual fun remove(key: String) = org.slf4j.MDC.remove(key)

actual fun clear() = org.slf4j.MDC.clear()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ actual class SLF4JLogger : Logger() {
Log.Level.Assert -> error(message, throwable)
}
}
}
}
21 changes: 5 additions & 16 deletions log4k/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,26 @@ kotlin {
}
sourceSets["iosSimulatorArm64Main"].dependsOn(sourceSets["iosMain"])
sourceSets["iosSimulatorArm64Test"].dependsOn(sourceSets["iosTest"])

targets.withType(org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithSimulatorTests::class.java) {
testRuns["test"].deviceId = "iPhone 14"
}
}

java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))

android {
buildToolsVersion = "33.0.0"
compileSdk = 33
namespace = "saschpe.log4k"

defaultConfig {
compileSdk = 33
minSdk = 17
targetSdk = 33
}

sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")

testCoverage.jacocoVersion = "0.8.8"
testCoverage.jacocoVersion = "0.8.10"
}

group = "de.peilicke.sascha"
version = "1.2.3"

val javadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
}

publishing {
publications.withType<MavenPublication> {
artifact(javadocJar.get())

pom {
name.set("Log4K")
description.set("Lightweight logging library for Kotlin/Multiplatform. Supports Android, iOS, JavaScript and plain JVM environments.")
Expand Down
1 change: 0 additions & 1 deletion log4k/src/androidMain/AndroidManifest.xml

This file was deleted.

2 changes: 1 addition & 1 deletion log4k/src/commonMain/kotlin/saschpe/log4k/Logger.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ abstract class Logger {
Magenta("\u001B[35m"),
Red("\u001B[31m"),
White("\u001B[37m"),
Yellow("\u001B[33m")
Yellow("\u001B[33m"),
}

var minimumLogLevel = Log.Level.Verbose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import saschpe.log4k.Log
import saschpe.log4k.Logger

class StubLoggerWithMinimum(
minimumLogLevel: Log.Level
minimumLogLevel: Log.Level,
) : Logger() {
init {
this.minimumLogLevel = minimumLogLevel
Expand Down
2 changes: 1 addition & 1 deletion log4k/src/iosMain/kotlin/saschpe/log4k/ConsoleLogger.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ actual class ConsoleLogger : Logger() {
Log.Level.Info to "💚 Info",
Log.Level.Warning to "💛 Warn",
Log.Level.Error to "❤️ Error",
Log.Level.Assert to "💜 Assert"
Log.Level.Assert to "💜 Assert",
)
}
4 changes: 2 additions & 2 deletions log4k/src/jvmMain/kotlin/saschpe/log4k/ConsoleLogger.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ actual class ConsoleLogger : Logger() {
ConsoleHandler().apply {
level = Level.ALL
formatter = SimpleFormatter()
}
},
)
useParentHandlers = false
}
Expand Down Expand Up @@ -56,7 +56,7 @@ actual class ConsoleLogger : Logger() {
Log.Level.Info to "${AnsiColor.Green.value}Info${AnsiColor.Reset.value}",
Log.Level.Warning to "${AnsiColor.Yellow.value}Warn${AnsiColor.Reset.value}",
Log.Level.Error to "${AnsiColor.Red.value}Error${AnsiColor.Reset.value}",
Log.Level.Assert to "${AnsiColor.Magenta.value}Assert${AnsiColor.Reset.value}"
Log.Level.Assert to "${AnsiColor.Magenta.value}Assert${AnsiColor.Reset.value}",
)

private fun getTraceTag(trace: StackTraceElement): String {
Expand Down
5 changes: 5 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ pluginManagement {
gradlePluginPortal()
google()
}

plugins {
kotlin("multiplatform") version "1.9.10"
id("com.android.library") version "8.2.2"
}
}

dependencyResolutionManagement {
Expand Down

0 comments on commit 53dcd11

Please sign in to comment.