Skip to content

Commit

Permalink
Hotfixing the module file of ktoml-file in build.gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
orchestr7 committed Nov 29, 2021
1 parent 9033a73 commit d5e1d18
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 21 deletions.
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 d5e1d18

Please sign in to comment.