Skip to content

Commit

Permalink
Merge pull request #85 from akuleshov7/hotfix/release-hotfix
Browse files Browse the repository at this point in the history
Hotfixing the module file of ktoml-file in build.gradle to fix KotlinJS
  • Loading branch information
orchestr7 committed Dec 10, 2021
2 parents 9033a73 + d5e1d18 commit 104970c
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fun Project.configurePublishing() {
// https://kotlinlang.org/docs/mpp-publish-lib.html#avoid-duplicate-publications
// `configureNexusPublishing` adds sonatype publication tasks inside `afterEvaluate`.
afterEvaluate {
val publicationsFromMainHost = listOf("jvm", "js", "linuxX64", "kotlinMultiplatform", "metadata")
val publicationsFromMainHost = listOf("jvm", "js", "linuxX64", "mingwX64", "kotlinMultiplatform", "metadata")
configure<PublishingExtension> {
publications.matching { it.name in publicationsFromMainHost }.all {
val targetPublication = this@all
Expand Down
16 changes: 16 additions & 0 deletions detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,19 @@
potential-bugs:
Deprecation:
active: true

formatting:
MaximumLineLength:
active: false
maxLineLength: 180

style:
MaxLineLength:
active: true
maxLineLength: 180
# wildcards are used all over the project
WildcardImport:
active: false
# code is not stable yet, TODOs are still needed
ForbiddenComment:
active: false
11 changes: 3 additions & 8 deletions ktoml-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,9 @@ kotlin {
}
}

val os = getCurrentOperatingSystem()

when {
os.isWindows -> mingwX64()
os.isLinux -> linuxX64()
os.isMacOsX -> macosX64()
else -> throw GradleException("Unknown operating system $os")
}
mingwX64()
linuxX64()
macosX64()

sourceSets {
all {
Expand Down
31 changes: 18 additions & 13 deletions ktoml-file/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,30 @@ kotlin {
}
}

val os = getCurrentOperatingSystem()

val target = listOf(when {
os.isWindows -> mingwX64()
os.isLinux -> linuxX64()
os.isMacOsX -> macosX64()
else -> throw GradleException("Unknown operating system $os")
})
mingwX64()
linuxX64()
macosX64()

sourceSets {
all {
languageSettings.optIn("kotlin.RequiresOptIn")
}

val nativeMain by creating {
val linuxX64Main by getting {
dependencies {
implementation("com.squareup.okio:okio:${Versions.OKIO}")
implementation("org.jetbrains.kotlin:kotlin-stdlib:${Versions.KOTLIN}")
}
}

val mingwX64Main by getting {
dependencies {
implementation("com.squareup.okio:okio:${Versions.OKIO}")
implementation("org.jetbrains.kotlin:kotlin-stdlib:${Versions.KOTLIN}")
}
}

val macosX64Main by getting {
dependencies {
implementation("com.squareup.okio:okio:${Versions.OKIO}")
implementation("org.jetbrains.kotlin:kotlin-stdlib:${Versions.KOTLIN}")
Expand All @@ -54,10 +63,6 @@ kotlin {
}
}

target.forEach {
getByName("${it.name}Main").dependsOn(nativeMain)
}

val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* File utils to read files using okio
*/

package com.akuleshov7.ktoml.file

import okio.FileSystem

/**
* Implementation for getting proper file system to read files with okio
*
* @return proper FileSystem
*/
internal actual fun getOsSpecificFileSystem(): FileSystem = FileSystem.SYSTEM
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* File utils to read files using okio
*/

package com.akuleshov7.ktoml.file

import okio.FileSystem

/**
* Implementation for getting proper file system to read files with okio
*
* @return proper FileSystem
*/
internal actual fun getOsSpecificFileSystem(): FileSystem = FileSystem.SYSTEM

0 comments on commit 104970c

Please sign in to comment.