Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiplatform #14

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ build/
.idea
local.properties

.DS_Store

23 changes: 0 additions & 23 deletions build.gradle

This file was deleted.

24 changes: 24 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

buildscript {
repositories {
mavenLocal()
google()
mavenCentral()
}

}

plugins {
kotlin("multiplatform").version(cash.z.ecc.android.Deps.kotlinVersion) apply false
id("io.kotest.multiplatform") version cash.z.ecc.android.Deps.Kotest.version apply false
kotlin("plugin.serialization") version cash.z.ecc.android.Deps.kotlinVersion apply false
id("com.jfrog.bintray").version("1.+")
}

allprojects {
repositories {
google()
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots")
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need some KotlinJS configuration, to control whether to download (useful on CI) and which version to download.

  1. To gradle.properties, add new properties IS_DOWNLOAD_NODE=true, IS_DOWNLOAD_YARN=true, and NODE_VERSION=16.14.2

rootProject.plugins.withType<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin> {
    rootProject.the<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>().apply {
        download = project.property("IS_DOWNLOAD_NODE").toString().toBoolean()
        // Manually set the node version as a workaround for a Kotlin bug
        // where it tries to download Node 14, for which there's no Apple Silicon version
        // https://youtrack.jetbrains.com/issue/KT-49109
        nodeVersion = project.property("NODE_VERSION").toString().toBoolean()
    }
}

rootProject.plugins.withType<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin> {
    rootProject.the<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension>().apply {
        download = project.property("IS_DOWNLOAD_YARN").toString().toBoolean()
    }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The node 14 issue is resolved as of 1.6.20

2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ plugins {
}

repositories {
jcenter()
mavenCentral()
}
20 changes: 8 additions & 12 deletions buildSrc/src/main/java/cash/z/ecc/android/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,17 @@ package cash.z.ecc.android
object Deps {
// For use in the top-level build.gradle which gives an error when provided
// `Deps.Kotlin.version` directly
const val kotlinVersion = "1.4.30"
const val kotlinVersion = "1.6.21"

object Kotlin : Version(kotlinVersion) {
val STDLIB = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$version"
object Kotest : Version("5.2.1") {
val RUNNER = "io.kotest:kotest-runner-junit5:$version"
val ASSERTIONS = "io.kotest:kotest-assertions-core:$version"
val FRAMEWORK_ENG = "io.kotest:kotest-framework-engine:$version"
val PROPERTY = "io.kotest:kotest-property:$version"
}

object Kotest : Version("4.0.5") {
val RUNNER = "io.kotest:kotest-runner-junit5-jvm:$version"
val ASSERTIONS = "io.kotest:kotest-assertions-core-jvm:$version"
val PROPERTY = "io.kotest:kotest-property-jvm:$version"
}

object Square : Version("1.9.2") {
val MOSHI = "com.squareup.moshi:moshi:$version"
val MOSHI_KOTLIN = "com.squareup.moshi:moshi-kotlin:$version"
object SquareOkio : Version("3.0.0"){
val OKIO = "com.squareup.okio:okio:$version"
}
}

Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
org.gradle.jvmargs=-Xmx4096M
luca992 marked this conversation as resolved.
Show resolved Hide resolved
kotlin.native.binary.memoryModel=experimental
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
Loading