Skip to content

Commit

Permalink
Merge pull request #59 from MohamedRejeb/0.3.1
Browse files Browse the repository at this point in the history
Update Compose to 1.6.0
  • Loading branch information
MohamedRejeb authored Mar 3, 2024
2 parents 3653e87 + 6ad9eae commit 30c15aa
Show file tree
Hide file tree
Showing 96 changed files with 1,797 additions and 1,105 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[*.{kt,kts}]
ktlint_code_style = ktlint_official

ktlint_standard_multiline-if-else = disabled
ktlint_standard_property-naming = disabled
ktlint_standard_function_naming_ignore_when_annotated_with = Composable
ktlint_function_naming_ignore_when_annotated_with = Composable
55 changes: 55 additions & 0 deletions calf-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi

plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.composeMultiplatform)
alias(libs.plugins.androidLibrary)
id("module.publication")
}

kotlin {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
applyDefaultHierarchyTemplate {
common {
group("nonAndroid") {
withJvm()
withIos()
withJs()
}
}
}
androidTarget {
publishLibraryVariants("release")
compilations.all {
kotlinOptions {
jvmTarget = "11"
}
}
}
jvm("desktop") {
jvmToolchain(11)
}
js(IR) {
browser()
}
iosX64()
iosArm64()
iosSimulatorArm64()

sourceSets.commonMain.dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
}
}

android {
namespace = "com.mohamedrejeb.calf.core"
compileSdk = libs.versions.android.compileSdk.get().toInt()
defaultConfig {
minSdk = libs.versions.android.minSdk.get().toInt()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.mohamedrejeb.calf.core

import androidx.compose.ui.platform.LocalContext

actual val LocalPlatformContext get() = LocalContext
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.mohamedrejeb.calf.core

import android.content.Context

actual typealias PlatformContext = Context
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.mohamedrejeb.calf.core

import androidx.compose.runtime.ProvidableCompositionLocal

expect val LocalPlatformContext: ProvidableCompositionLocal<PlatformContext>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.mohamedrejeb.calf.core

expect abstract class PlatformContext
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.mohamedrejeb.calf.core

import androidx.compose.runtime.staticCompositionLocalOf

actual val LocalPlatformContext =
staticCompositionLocalOf {
PlatformContext.INSTANCE
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.mohamedrejeb.calf.core

import kotlin.jvm.JvmField

actual abstract class PlatformContext private constructor() {
companion object {
@JvmField
val INSTANCE = object : PlatformContext() {}
}
}
14 changes: 4 additions & 10 deletions calf-file-picker/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi

plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.composeMultiplatform)
Expand Down Expand Up @@ -28,21 +26,17 @@ kotlin {
iosSimulatorArm64()

sourceSets.commonMain.get().dependencies {
api(projects.calfIo)

implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material)
api(project(":calf-io"))
}
sourceSets.commonTest.get().dependencies {
implementation(libs.kotlin.test)
}

sourceSets {
val androidMain by getting {
dependencies {
implementation(libs.activity.compose)
}
}
sourceSets.androidMain.dependencies {
implementation(libs.activity.compose)
}
}

Expand Down
Loading

0 comments on commit 30c15aa

Please sign in to comment.