Skip to content

Commit

Permalink
add wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
avan1235 committed Jan 29, 2024
1 parent af38c82 commit a758014
Show file tree
Hide file tree
Showing 52 changed files with 3,328 additions and 103 deletions.
5 changes: 5 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,16 @@ REQUIRE_EMAIL_VERIFY=false
SCHEME_EMAIL_VERIFY=http
HOST_EMAIL_VERIFY=0.0.0.0

CORS_PORT=8181
CORS_HOST=localhost
CORS_SCHEME=http

BUMP_FILE_VERSION_CODE=false

# Connect from Android emulator to localhost of computer via 10.0.2.2
ANDROID_CLIENT_API_HOST=10.0.2.2:8080
IOS_CLIENT_API_HOST=localhost:8080
DESKTOP_CLIENT_API_HOST=localhost:8080
WEB_CLIENT_API_HOST=localhost:8080
REST_CLIENT_API_SCHEME=http
WEBSOCKET_CLIENT_API_SCHEME=ws
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ ARG EMAIL_PASSWORD
ARG REQUIRE_EMAIL_VERIFY
ARG SCHEME_EMAIL_VERIFY
ARG HOST_EMAIL_VERIFY
ARG CORS_PORT
ARG CORS_HOST
ARG CORS_SCHEME

ENV POSTGRES_PORT=${POSTGRES_PORT}
ENV POSTGRES_DB=${POSTGRES_DB}
Expand All @@ -46,6 +49,9 @@ ENV EMAIL_PASSWORD=${EMAIL_PASSWORD}
ENV REQUIRE_EMAIL_VERIFY=${REQUIRE_EMAIL_VERIFY}
ENV SCHEME_EMAIL_VERIFY=${SCHEME_EMAIL_VERIFY}
ENV HOST_EMAIL_VERIFY=${HOST_EMAIL_VERIFY}
ENV CORS_PORT=${CORS_PORT}
ENV CORS_HOST=${CORS_HOST}
ENV CORS_SCHEME=${CORS_SCHEME}
ENV PORT=${PORT}

EXPOSE ${PORT}
Expand Down
6 changes: 4 additions & 2 deletions build-src/src/main/kotlin/BuildSrcPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import java.io.File
import java.lang.System.getenv

private const val ENV_FILE: String = ".env"

private const val FROM_APP_ENV_FILE: String = "../.env"
private const val FROM_XCODE_ENV_FILE: String = "../../.env"

class BuildSrcPlugin : Plugin<Project> {
Expand All @@ -17,7 +17,7 @@ class BuildSrcPlugin : Plugin<Project> {
}

private fun currentScopeEnvFile(): File =
File(ENV_FILE).takeIf { it.exists() } ?: File(FROM_XCODE_ENV_FILE)
File(ENV_FILE).takeIf { it.exists() } ?: File(FROM_APP_ENV_FILE).takeIf { it.exists() } ?: File(FROM_XCODE_ENV_FILE)

val ENV: Map<String, String>
get() = currentScopeEnvFile().readLines().mapNotNull { line ->
Expand All @@ -27,6 +27,8 @@ val ENV: Map<String, String>

val VERSION: String get() = ENV["VERSION"] ?: "1.0.0"

val CORS_PORT: Int get() = ENV["CORS_PORT"]?.toIntOrNull()!!

private val VERSION_CODE_PREFIX = "version.code="

val VERSION_CODE: Int
Expand Down
21 changes: 11 additions & 10 deletions build-src/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,24 @@ object Dependencies {
val kotlinVersion by System.getProperties()
val composeVersion by System.getProperties()
val parcelizeDarwinVersion by System.getProperties()
const val ktor = "2.3.7"
const val ktor = "3.0.0-wasm2"
const val kotlinxSerialization = "1.6.2"
const val exposed = "0.45.0"
const val simpleMail = "1.3.3"
const val decompose = "3.0.0-alpha04"
const val essenty = "2.0.0-alpha02"
const val decompose = "3.0.0-alpha05"
const val essenty = "2.0.0-alpha03"
const val multiplatformSettings = "1.1.1"
const val coroutines = "1.7.3"
const val coroutines = " 1.8.0-RC2"
}

val kotlinxSerializationCbor = "org.jetbrains.kotlinx:kotlinx-serialization-cbor:${Version.kotlinxSerialization}"
val kotlinxSerializationJson = "org.jetbrains.kotlinx:kotlinx-serialization-json:${Version.kotlinxSerialization}"
val kotlinxAtomicFu = "org.jetbrains.kotlinx:atomicfu:0.20.2"
val kotlinxDateTime = "org.jetbrains.kotlinx:kotlinx-datetime:0.4.0"
val uuid = "com.benasher44:uuid:0.7.0"
val kotlinxAtomicFu = "org.jetbrains.kotlinx:atomicfu:0.23.2"
val kotlinxDateTime = "org.jetbrains.kotlinx:kotlinx-datetime:0.5.0"
val uuid = "com.benasher44:uuid:0.8.2"

val ktorServerCore = "io.ktor:ktor-server-core:${Version.ktor}"
val ktorServerCors = "io.ktor:ktor-server-cors:${Version.ktor}"
val ktorServerNetty = "io.ktor:ktor-server-netty:${Version.ktor}"
val ktorServerSerialization = "io.ktor:ktor-serialization-kotlinx-cbor:${Version.ktor}"
val ktorServerWebsockets = "io.ktor:ktor-server-websockets:${Version.ktor}"
Expand All @@ -35,6 +36,7 @@ object Dependencies {
val ktorClientAndroid = "io.ktor:ktor-client-okhttp:${Version.ktor}"
val ktorClientDarwin = "io.ktor:ktor-client-darwin:${Version.ktor}"
val ktorClientDesktop = "io.ktor:ktor-client-okhttp:${Version.ktor}"
val ktorClientWeb = "io.ktor:ktor-client-js:${Version.ktor}"
val ktorClientWebsockets = "io.ktor:ktor-client-websockets:${Version.ktor}"

val logbackClassic = "ch.qos.logback:logback-classic:1.4.6"
Expand All @@ -44,10 +46,9 @@ object Dependencies {

val bCrypt = "at.favre.lib:bcrypt:0.9.0"

val napierLogger = "io.github.aakira:napier:2.6.1"
val napierLogger = "io.github.aakira:napier:2.7.1"

val multiplatformSettings = "com.russhwolf:multiplatform-settings:${Version.multiplatformSettings}"
val multiplatformSettingsCoroutines = "com.russhwolf:multiplatform-settings-coroutines:${Version.multiplatformSettings}"
val multiplatformSettingsDatastore = "com.russhwolf:multiplatform-settings-datastore:${Version.multiplatformSettings}"

val kotlinxCoroutinesSwing = "org.jetbrains.kotlinx:kotlinx-coroutines-swing:${Version.coroutines}"
Expand All @@ -62,7 +63,7 @@ object Dependencies {
val stateKeeper = "com.arkivanov.essenty:state-keeper:${Version.essenty}"
val decomposeExtensions = "com.arkivanov.decompose:extensions-compose:${Version.decompose}"

val composeUtil = "in.procyk.compose:util:1.5.11.0"
val composeUtil = "in.procyk.compose:util:1.6.0-alpha01.0"

val parcelizeDarwinRuntime = "com.arkivanov.parcelize.darwin:runtime:${Version.parcelizeDarwinVersion}"

Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ subprojects {
mavenCentral()
maven("https://jitpack.io")
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
maven("https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental")
}

plugins.withId("org.jetbrains.kotlin.multiplatform") {
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ services:
REQUIRE_EMAIL_VERIFY: ${REQUIRE_EMAIL_VERIFY}
SCHEME_EMAIL_VERIFY: ${SCHEME_EMAIL_VERIFY}
HOST_EMAIL_VERIFY: ${HOST_EMAIL_VERIFY}
CORS_PORT: ${CORS_PORT}
CORS_HOST: ${CORS_HOST}
CORS_SCHEME: ${CORS_SCHEME}
ports:
- "${PORT}:${PORT}"

Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ xcodeproj=./ios-app
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.macos.enabled=true
org.jetbrains.compose.experimental.uikit.enabled=true
org.jetbrains.compose.experimental.wasm.enabled=true

kotlin.native.cocoapods.generate.wrapper=true
#kotlin.native.cacheKind=none
Expand Down
Loading

0 comments on commit a758014

Please sign in to comment.