-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#31] Configure multiplatform build scripts
- Loading branch information
1 parent
3f24445
commit 4cf04f7
Showing
8 changed files
with
103 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3f24445329869fd19b9ea3fe72d97aefa768ea0a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
buildscript { | ||
dependencyLocking { | ||
lockAllConfigurations() | ||
} | ||
} | ||
|
||
dependencyLocking { | ||
lockAllConfigurations() | ||
} | ||
|
||
// Per conversation in the KotlinLang Slack, Gradle uses Java 8 compatibility internally | ||
// for all build scripts. | ||
// https://kotlinlang.slack.com/archives/C19FD9681/p1636632870122900?thread_ts=1636572288.117000&cid=C19FD9681 | ||
java { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
dependencies { | ||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${libs.versions.kotlin.get()}") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@Suppress("UnstableApiUsage") | ||
dependencyResolutionManagement { | ||
repositories { | ||
mavenCentral() | ||
} | ||
dependencyResolutionManagement { | ||
versionCatalogs { | ||
create("libs") { | ||
from(files("../gradle/libs.versions.toml")) | ||
} | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
build-conventions/src/main/kotlin/bip39.kotlin-multiplatform-conventions.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import org.gradle.jvm.toolchain.JavaToolchainSpec | ||
|
||
pluginManager.withPlugin("org.jetbrains.kotlin.multiplatform") { | ||
extensions.findByType<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension>()?.apply { | ||
jvmToolchain { | ||
val javaVersion = JavaVersion.toVersion(project.property("JVM_TOOLCHAIN").toString()) | ||
val javaLanguageVersion = JavaLanguageVersion.of(javaVersion.majorVersion) | ||
(this as JavaToolchainSpec).languageVersion.set(javaLanguageVersion) | ||
} | ||
|
||
targets.matching { it.platformType.name == "jvm" }.all { | ||
(this as org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget).apply { | ||
val javaTargetVersion = project.property("JVM_TARGET").toString() | ||
|
||
compilations.all { | ||
kotlinOptions { | ||
jvmTarget = javaTargetVersion | ||
} | ||
} | ||
} | ||
} | ||
|
||
targets.all { | ||
compilations.all { | ||
kotlinOptions { | ||
allWarningsAsErrors = project.property("BIP39_IS_TREAT_WARNINGS_AS_ERRORS").toString().toBoolean() | ||
freeCompilerArgs = freeCompilerArgs + "-opt-in=kotlin.RequiresOptIn" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters