diff --git a/.fleet/receipt.json b/.fleet/receipt.json deleted file mode 100644 index 97e9bfdd..00000000 --- a/.fleet/receipt.json +++ /dev/null @@ -1,29 +0,0 @@ -// Project generated by Kotlin Multiplatform Wizard -{ - "spec": { - "template_id": "kmt", - "targets": { - "android": { - "ui": [ - "compose" - ] - }, - "ios": { - "ui": [ - "compose" - ] - }, - "desktop": { - "ui": [ - "compose" - ] - }, - "server": { - "engine": [ - "ktor" - ] - } - } - }, - "timestamp": "2023-11-07T19:37:30.261131495Z" -} \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..1640eb62 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,36 @@ +on: + push: + branches: [ main ] + pull_request: + workflow_dispatch: + +jobs: + build: + + runs-on: ubuntu-latest + timeout-minutes: 60 + + steps: + + - name: Checkout branch + uses: actions/checkout@v2 + + - name: set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: gradle_android + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '15.0.1' + + - name: Build with Gradle + run: ./gradlew build + + - name: Junit tests with Gradle + run: ./gradlew testDebugUnitTest \ No newline at end of file diff --git a/.gitignore b/.gitignore index 33e4c75d..8cba68c5 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ captures !*.xcodeproj/project.xcworkspace/ !*.xcworkspace/contents.xcworkspacedata **/xcshareddata/WorkspaceSettings.xcsettings +.fleet diff --git a/core/core/build.gradle.kts b/core/core/build.gradle.kts index e3955751..aef9daf8 100644 --- a/core/core/build.gradle.kts +++ b/core/core/build.gradle.kts @@ -12,6 +12,8 @@ kotlin { } } } + + jvm("desktop") listOf( iosX64(), @@ -25,6 +27,8 @@ kotlin { } sourceSets { + val desktopMain by getting + commonMain.dependencies { implementation(libs.kermit) implementation(projects.shared) @@ -34,6 +38,9 @@ kotlin { commonTest.dependencies { implementation(libs.kotlin.test) } + desktopMain.dependencies { + implementation(compose.desktop.currentOs) + } } } diff --git a/core/ui/build.gradle.kts b/core/ui/build.gradle.kts index 95919e1b..184ee588 100644 --- a/core/ui/build.gradle.kts +++ b/core/ui/build.gradle.kts @@ -15,6 +15,8 @@ kotlin { } } + jvm("desktop") + listOf( iosX64(), iosArm64(), @@ -27,6 +29,8 @@ kotlin { } sourceSets { + val desktopMain by getting + commonMain.dependencies { implementation(project(":core:core")) @@ -40,6 +44,9 @@ kotlin { commonTest.dependencies { implementation(libs.kotlin.test) } + desktopMain.dependencies { + implementation(compose.desktop.currentOs) + } } } diff --git a/feature/home/build.gradle.kts b/feature/home/build.gradle.kts index 3098c728..f2be90b6 100644 --- a/feature/home/build.gradle.kts +++ b/feature/home/build.gradle.kts @@ -15,6 +15,8 @@ kotlin { } } + jvm("desktop") + listOf( iosX64(), iosArm64(), @@ -27,6 +29,8 @@ kotlin { } sourceSets { + val desktopMain by getting + commonMain.dependencies { implementation(project(":core:core")) implementation(project(":core:ui")) @@ -41,6 +45,9 @@ kotlin { commonTest.dependencies { implementation(libs.kotlin.test) } + desktopMain.dependencies { + implementation(compose.desktop.currentOs) + } } } @@ -50,4 +57,7 @@ android { defaultConfig { minSdk = libs.versions.android.minSdk.get().toInt() } + sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") + sourceSets["main"].res.srcDirs("src/androidMain/res") + sourceSets["main"].resources.srcDirs("src/commonMain/resources") } diff --git a/feature/home/src/commonMain/kotlin/com/stslex/feature/home/HomeScreen.kt b/feature/home/src/commonMain/kotlin/com/stslex/feature/home/HomeScreen.kt index 6ae61bad..c38fc7b6 100644 --- a/feature/home/src/commonMain/kotlin/com/stslex/feature/home/HomeScreen.kt +++ b/feature/home/src/commonMain/kotlin/com/stslex/feature/home/HomeScreen.kt @@ -11,8 +11,6 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.material.Button import androidx.compose.material.MaterialTheme import androidx.compose.material.Text -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.Home import androidx.compose.runtime.Composable import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue @@ -21,7 +19,10 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import org.jetbrains.compose.resources.ExperimentalResourceApi +import org.jetbrains.compose.resources.painterResource +@OptIn(ExperimentalResourceApi::class) @Composable fun HomeScreen( modifier: Modifier = Modifier @@ -56,7 +57,7 @@ fun HomeScreen( } AnimatedVisibility(isClicked) { Image( - Icons.Default.Home, + painterResource("compose-multiplatform.xml"), null ) } diff --git a/feature/home/src/commonMain/resources/compose-multiplatform.xml b/feature/home/src/commonMain/resources/compose-multiplatform.xml new file mode 100644 index 00000000..d7bf7955 --- /dev/null +++ b/feature/home/src/commonMain/resources/compose-multiplatform.xml @@ -0,0 +1,36 @@ + + + + + + + +