Skip to content

Commit

Permalink
Cleanup and fix iOS deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
geoff-powell committed Dec 14, 2023
1 parent 3f6e090 commit 9d98854
Show file tree
Hide file tree
Showing 85 changed files with 905 additions and 1,609 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build-debug:
runs-on: ubuntu-latest
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/desktop-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ name: Desktop and Web CI
on:
push:
branches:
- main
- main
pull_request:
branches:
- main


concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
Build-Desktop:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: macos-latest
Expand Down
2 changes: 1 addition & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 0 additions & 23 deletions .run/web.run.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.greenmiststudios.tidy

import android.app.Application
import com.greenmiststudios.common.di.appModule
import com.greenmiststudios.common.di.startTidyKoin
import org.koin.android.ext.koin.androidContext
import org.koin.android.ext.koin.androidLogger
import org.koin.core.context.startKoin
Expand All @@ -10,13 +11,11 @@ class TidyApplication : Application() {
override fun onCreate() {
super.onCreate()

startKoin {
startTidyKoin {
// Log Koin into Android logger
androidLogger()
// Reference Android context
androidContext(this@TidyApplication)

modules(appModule())
}
}
}
48 changes: 16 additions & 32 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@

plugins {
kotlin("multiplatform")
alias(libs.plugins.compose)
alias(libs.plugins.sqldelight)
id("com.android.library")
kotlin("native.cocoapods")
}

group = "com.greenmiststudios"
version = "1.0-SNAPSHOT"
group = "com.greenmiststudios.tidy"
version = "${libs.versions.version}-SNAPSHOT"

@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) kotlin {

@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
kotlin {
androidTarget {
compilations.all {
kotlinOptions.jvmTarget = "11"
Expand All @@ -25,22 +23,11 @@ kotlin {
js(IR) {
browser()
}

iosX64()
iosArm64()
iosSimulatorArm64()

cocoapods {
summary = "Common module for Tidy"
homepage = "https://github.com/geoff-powell/tidy"
version = "1.0"
ios.deploymentTarget = "17.0"
podfile = project.file("../iosApp/Podfile")
framework {
baseName = "common"
isStatic = true
}
}

sourceSets {
val commonMain by getting {
dependencies {
Expand Down Expand Up @@ -101,30 +88,26 @@ kotlin {
}
}

val iosX64Main by getting {
dependencies {
}
}
val iosArm64Main by getting {
dependencies {
}
}
val iosSimulatorArm64Main by getting {
dependencies {
}
iosMain.dependencies {
}

// val wasmJsMain by getting {
// dependencies {
// implementation(libs.ktor.core.wasm)
// }
// }
}

explicitApi()
}

android {
namespace = "com.greenmiststudios.tidy.common"
compileSdk = 34
compileSdk = libs.versions.android.compileSdk.get().toInt()
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdk = 24
targetSdk = 34
minSdk = libs.versions.android.minSdk.get().toInt()
targetSdk = libs.versions.android.targetSdk.get().toInt()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
Expand All @@ -137,5 +120,6 @@ sqldelight {
create("Database") {
packageName.set("com.greenmiststudios.tidy")
}
linkSqlite = true
}
}
50 changes: 0 additions & 50 deletions common/common.podspec

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ import org.koin.compose.KoinContext
@OptIn(ExperimentalMaterialApi::class)
@Composable
internal fun App() {
Box(
modifier =
Modifier.fillMaxSize()
.statusBarsPadding()
.navigationBarsPadding()
) {
KoinContext {
KoinContext {
Box(
modifier =
Modifier.fillMaxSize()
.statusBarsPadding()
.navigationBarsPadding()
) {
MaterialTheme(
shapes = Shapes(
small = RoundedCornerShape(4.dp),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.greenmiststudios.common.di

import org.koin.dsl.KoinAppDeclaration
import org.koin.core.context.startKoin as startInternalKoin

public fun startTidyKoin(platformSpecificConfig: KoinAppDeclaration = {}) {
startInternalKoin {
modules(appModule())
platformSpecificConfig()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,6 @@ public actual fun getPlatformName(): String {
}

@Composable
private fun UIShow() {
public fun UIShow() {
App()
}

public fun MainViewController(): UIViewController = ComposeUIViewController {
MaterialTheme(
colorScheme = if (isSystemInDarkTheme()) darkColorScheme() else lightColorScheme()
) {
Surface(
modifier = Modifier.fillMaxSize(),
) {
Column(
modifier = Modifier.fillMaxSize(),
) {
UIShow()
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.lightColorScheme
import com.greenmiststudios.common.UIShow
import com.greenmiststudios.common.di.appModule
import com.greenmiststudios.common.di.startTidyKoin
import org.jetbrains.skiko.wasm.onWasmReady
import org.koin.core.context.startKoin

public fun main() {
onWasmReady {
startKoin {
modules(appModule())
}
startTidyKoin()

Window("tidy") {
MaterialTheme(colorScheme = if (isSystemInDarkTheme()) darkColorScheme() else lightColorScheme()) {
Expand Down
Loading

0 comments on commit 9d98854

Please sign in to comment.