Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6551cbe
Create kmp structure project
nasrabadiAM May 2, 2025
4fbe7c0
Update agp to 8.8.2
nasrabadiAM May 2, 2025
8871880
Fix shared module namespace
nasrabadiAM May 2, 2025
73c2e90
Fix detekt issues
nasrabadiAM May 2, 2025
f927fe2
Migrate whole project to KMP (android, iOS, wasmJs, desktop)
nasrabadiAM May 15, 2025
df60733
Refactor adaptive implementation by multiplatform api (window size cl…
nasrabadiAM May 15, 2025
fe9c5fd
Refactor wasm-js
nasrabadiAM May 15, 2025
bfdc26f
Update gitignore
nasrabadiAM May 17, 2025
2d22098
Add yarn.lock file
nasrabadiAM May 17, 2025
34473e0
Update libraries and fix run problems
nasrabadiAM May 17, 2025
e247250
Remove depends on in shared gradle module
nasrabadiAM May 17, 2025
38abf21
Fix android platform tests
nasrabadiAM May 17, 2025
a1bed7a
Remove un-used suppress
nasrabadiAM May 17, 2025
47a4480
Update github actions
nasrabadiAM May 18, 2025
6d66b4d
Remove swift install
nasrabadiAM May 18, 2025
7962278
Merge all github action configs
nasrabadiAM May 21, 2025
d10c264
Fix iOS tests run
nasrabadiAM May 21, 2025
aefa349
Fix relative path issue
nasrabadiAM May 21, 2025
fd82b96
Change schema of xcode build
nasrabadiAM May 21, 2025
9ce2790
Add xcode version
nasrabadiAM May 21, 2025
2b9c129
Specify xcode version
nasrabadiAM May 21, 2025
aebf436
Revert iOS build scheme to Requestify
nasrabadiAM May 21, 2025
3acb4f5
Add log for schemas
nasrabadiAM May 21, 2025
5b0ea40
Change schema to iosApp
nasrabadiAM May 21, 2025
37b7f5b
Change device for iosRun
nasrabadiAM May 21, 2025
20a8e70
Add kotlin kmp pre-build
nasrabadiAM May 21, 2025
74e4012
Add a dummy to check ci
nasrabadiAM May 24, 2025
0d94ada
Change iOS gradle dependency
nasrabadiAM May 24, 2025
b993a96
Revert "Remove depends on in shared gradle"
nasrabadiAM May 24, 2025
1973762
Remove ios-test job
nasrabadiAM May 25, 2025
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
12 changes: 6 additions & 6 deletions .github/workflows/android.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build & Test
name: Lint & Tests

on:
push:
Expand Down Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Static Analysis with lint
run: ./gradlew clean lint

test:
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -45,11 +45,11 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run Tests with Gradle
run: ./gradlew test
run: ./gradlew allTests

androidTest:
android-test:
runs-on: ubuntu-latest
timeout-minutes: 55
timeout-minutes: 30
strategy:
matrix:
api-level: [ 26, 30 ]
Expand Down Expand Up @@ -103,4 +103,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: test-reports-${{ matrix.api-level }}
path: '**/build/reports/androidTests'
path: '**/build/reports/androidTests'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ bin/
gen/
out/
build/
.kotlin

# Local configuration file (sdk path, etc)
local.properties
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
20 changes: 5 additions & 15 deletions app/build.gradle.kts → androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins {
alias(libs.plugins.androidApplication)
alias(libs.plugins.kotlinAndroid)
Expand Down Expand Up @@ -42,11 +41,11 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "11"
}
buildFeatures {
compose = true
Expand All @@ -62,19 +61,11 @@ android {
}

dependencies {
implementation(project(":shared"))

implementation(libs.core.ktx)
implementation(libs.lifecycle.runtime.ktx)
implementation(libs.lifecycle.viewmodel.compose)
implementation(libs.activity.compose)
implementation(platform(libs.compose.bom))
implementation(libs.ui)
implementation(libs.ui.graphics)
implementation(libs.ui.tooling.preview)
implementation(libs.material3)
implementation(libs.androidx.activity.compose)
implementation(libs.coroutines)
implementation(libs.androidx.window)
implementation(libs.materialWindow)
implementation(libs.navigation)

ksp(libs.kotlin.inject.ksp)
Expand All @@ -89,6 +80,5 @@ dependencies {
androidTestImplementation(libs.espresso.core)
androidTestImplementation(platform(libs.compose.bom))
androidTestImplementation(libs.ui.test.junit4)
debugImplementation(libs.ui.tooling)
debugImplementation(libs.ui.test.manifest)
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import androidx.compose.ui.test.hasContentDescription
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import androidx.lifecycle.SavedStateHandle
import me.nasrabadiam.tictactoe.game.GameUseCase
import me.nasrabadiam.tictactoe.game.ui.GameViewModel
import me.nasrabadiam.tictactoe.home.HomeScreenTests.Companion.PLAY_WITH_A_FRIEND_BUTTON_TEXT
import org.junit.Rule
import org.junit.Test
Expand All @@ -18,11 +16,10 @@ class NavigationTests {
val composeRule = createComposeRule()

private val gameUseCase = GameUseCase()
private val gameViewModel = GameViewModel(gameUseCase, SavedStateHandle())

@Test
fun whenClickedOnPlayWithAFriendShouldOpenGameScreenInSoloMode(): Unit = with(composeRule) {
setContent { App(gameViewModel = { gameViewModel }) }
setContent { App(gameUseCase = { gameUseCase }) }
val playWithAFriendButton =
onNode(hasContentDescription(PLAY_WITH_A_FRIEND_BUTTON_TEXT))
playWithAFriendButton.performClick()
Expand All @@ -34,7 +31,7 @@ class NavigationTests {

@Test
fun whenAppOpensShouldShowHomeRoute(): Unit = with(composeRule) {
setContent { App(gameViewModel = { gameViewModel }) }
setContent { App(gameUseCase = { gameUseCase }) }
onNodeWithText(PLAY_WITH_A_FRIEND_BUTTON_TEXT).assertIsDisplayed()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package me.nasrabadiam.tictactoe.game

import androidx.compose.ui.test.junit4.createComposeRule
import androidx.lifecycle.SavedStateHandle
import me.nasrabadiam.tictactoe.GameWindowSizeClass.COMPACT
import me.nasrabadiam.tictactoe.assertPlayersCountEquals
import me.nasrabadiam.tictactoe.clickOnCell
import me.nasrabadiam.tictactoe.game.model.Player
import me.nasrabadiam.tictactoe.game.ui.GameScreen
import me.nasrabadiam.tictactoe.game.ui.GameViewModel
import me.nasrabadiam.tictactoe.ui.GameWindowSizeClass.COMPACT
import org.junit.Rule
import org.junit.Test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import androidx.compose.ui.test.isDisplayed
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.lifecycle.SavedStateHandle
import me.nasrabadiam.tictactoe.DRAW_RESULT_STRING
import me.nasrabadiam.tictactoe.GameWindowSizeClass.COMPACT
import me.nasrabadiam.tictactoe.WINNER_CLICKABLE_CONTENT_DESCRIPTION
import me.nasrabadiam.tictactoe.WINNER_RESULT_STRING
import me.nasrabadiam.tictactoe.assertPlayersCountEquals
import me.nasrabadiam.tictactoe.clickOnCell
import me.nasrabadiam.tictactoe.game.model.Player
import me.nasrabadiam.tictactoe.game.ui.GameScreen
import me.nasrabadiam.tictactoe.game.ui.GameViewModel
import me.nasrabadiam.tictactoe.ui.GameWindowSizeClass.COMPACT
import org.junit.Rule
import org.junit.Test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import androidx.compose.ui.test.onNodeWithContentDescription
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import androidx.lifecycle.SavedStateHandle
import me.nasrabadiam.tictactoe.GameWindowSizeClass.COMPACT
import me.nasrabadiam.tictactoe.REPLAY_GAME_BUTTON_TEXT
import me.nasrabadiam.tictactoe.clickOnCell
import me.nasrabadiam.tictactoe.game.ui.GameScreen
import me.nasrabadiam.tictactoe.game.ui.GameViewModel
import me.nasrabadiam.tictactoe.ui.GameWindowSizeClass.COMPACT
import org.junit.Rule
import org.junit.Test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import androidx.lifecycle.SavedStateHandle
import me.nasrabadiam.tictactoe.DRAW_RESULT_STRING
import me.nasrabadiam.tictactoe.GameWindowSizeClass.COMPACT
import me.nasrabadiam.tictactoe.REPLAY_GAME_BUTTON_TEXT
import me.nasrabadiam.tictactoe.RESTART_GAME_BUTTON_TEXT
import me.nasrabadiam.tictactoe.WINNER_RESULT_STRING
Expand All @@ -21,7 +22,6 @@ import me.nasrabadiam.tictactoe.game.model.Player
import me.nasrabadiam.tictactoe.game.ui.GameScreen
import me.nasrabadiam.tictactoe.game.ui.GameViewModel
import me.nasrabadiam.tictactoe.getCellTestTag
import me.nasrabadiam.tictactoe.ui.GameWindowSizeClass.COMPACT
import org.junit.Rule
import org.junit.Test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import androidx.lifecycle.SavedStateHandle
import me.nasrabadiam.tictactoe.GameWindowSizeClass.COMPACT
import me.nasrabadiam.tictactoe.REPLAY_GAME_BUTTON_TEXT
import me.nasrabadiam.tictactoe.assertPlayersCountEquals
import me.nasrabadiam.tictactoe.clickOnCell
import me.nasrabadiam.tictactoe.game.model.Player
import me.nasrabadiam.tictactoe.game.ui.GameScreen
import me.nasrabadiam.tictactoe.game.ui.GameViewModel
import me.nasrabadiam.tictactoe.ui.GameWindowSizeClass.COMPACT
import org.junit.Rule
import org.junit.Test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import androidx.compose.ui.test.assertIsNotEnabled
import androidx.compose.ui.test.hasContentDescription
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.performClick
import me.nasrabadiam.tictactoe.GameWindowSizeClass.NORMAL
import me.nasrabadiam.tictactoe.home.HomeEvent.PlayWithAFriend
import me.nasrabadiam.tictactoe.ui.GameWindowSizeClass.NORMAL
import org.junit.Rule
import org.junit.Test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import android.app.Activity
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import me.nasrabadiam.tictactoe.di.ApplicationComponent
import androidx.activity.enableEdgeToEdge
import me.nasrabadiam.tictactoe.di.scopes.ActivityScope
import me.nasrabadiam.tictactoe.game.GameUseCase
import me.tatarka.inject.annotations.Component
Expand All @@ -14,8 +14,8 @@ class MainActivity : ComponentActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

val activityComponent = ActivityComponent::class.create(activity = this)
enableEdgeToEdge()
val activityComponent = MainActivityComponent::class.create(activity = this)
setContent { activityComponent.app() }
}
}
Expand All @@ -25,7 +25,7 @@ fun ApplicationComponent.Companion.from(activity: Activity): ApplicationComponen

@Component
@ActivityScope
abstract class ActivityComponent(
abstract class MainActivityComponent(
@get:Provides val activity: ComponentActivity,
@Component val applicationComponent: ApplicationComponent = ApplicationComponent.from(activity)
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package me.nasrabadiam.tictactoe

import android.app.Application
import me.nasrabadiam.tictactoe.di.ApplicationComponent
import me.nasrabadiam.tictactoe.di.create

class TicTacToeApplication : Application() {

Expand Down

This file was deleted.

This file was deleted.

20 changes: 0 additions & 20 deletions app/src/main/java/me/nasrabadiam/tictactoe/game/ui/GameState.kt

This file was deleted.

This file was deleted.

Loading
Loading