Skip to content

Commit

Permalink
- Add to Ci more projects
Browse files Browse the repository at this point in the history
- Made order on the DSL part
  • Loading branch information
galex committed May 23, 2024
1 parent b933a3f commit 2567df1
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
java-version: '17'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
- name: Generate kover coverage report
run: ./gradlew koverXmlReportDebug
run: ./gradlew :compiler-gradle-dsl:koverXmlReport :compiler-plugin:koverXmlReport :runtime:koverXmlReportDebug
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./runtime/build/reports/kover/reportDebug.xml,./runtime-channel/build/reports/kover/reportDebug.xml
files: ./compiler-gradle-dsl/build/reports/kover/report.xml,./compiler-plugin/build/reports/kover/report.xml,./runtime/build/reports/kover/reportDebug.xml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ In your libs.version.toml, add the following:

```toml
[versions]
yamvil = "<latest version>"
yamvil = "0.0.2"

[libraries]
yamvil = { group = "dev.galex.yamvil", name = "runtime", version.ref = "yamvil" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ open class YamvilConfiguration {
class ComposeConfiguration {
var screenSuffix = "Screen"
var uiStateParameterName = "uiState"
var handleEventFunctionParameterMame = "handleEvent"
var handleEventParameterMame = "handleEvent"
}


Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class YamvilLevelTest {
val config = YamvilConfiguration()
// Then
Truth.assertThat(config.level).isEqualTo(YamvilLevel.Error)
Truth.assertThat(config.screenSuffix).isEqualTo("Screen")
Truth.assertThat(config.uiStateParameterName).isEqualTo("uiState")
Truth.assertThat(config.uiEventFunctionParameterMame).isEqualTo("handleEvent")
Truth.assertThat(config.compose.screenSuffix).isEqualTo("Screen")
Truth.assertThat(config.compose.uiStateParameterName).isEqualTo("uiState")
Truth.assertThat(config.compose.handleEventParameterMame).isEqualTo("handleEvent")
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ class ComposeScreensChecker(
}

// handleEvent parameter name
if (uiStateInfo?.uiEventParameter?.name != config.compose.handleEventFunctionParameterMame) {
if (uiStateInfo?.uiEventParameter?.name != config.compose.handleEventParameterMame) {
reporter.reportOn(
source = declaration.source,
factory = YamvilFactories.renameHandleEventParameter(config.level),
a = "Please rename \"${uiStateInfo?.uiEventParameter?.name}\" to \"${config.compose.handleEventFunctionParameterMame}\"",
a = "Please rename \"${uiStateInfo?.uiEventParameter?.name}\" to \"${config.compose.handleEventParameterMame}\"",
context = context
)
}
Expand Down
8 changes: 5 additions & 3 deletions samples/sample-android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ dependencies {

yamvil {
level = YamvilLevel.Error
screenSuffix = "Screen" // Default value is "Screen"
uiStateParameterName = "uiState" // Default value is "uiState"
uiEventFunctionParameterMame = "onEvent" // Default value is "handleEvent"
compose {
screenSuffix = "Screen" // Default value is "Screen"
uiStateParameterName = "uiState" // Default value is "uiState"
handleEventFunctionParameterMame = "onEvent" // Default value is "handleEvent"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,22 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import dev.galex.yamvil.compose.LaunchedActionEffect

@Composable
fun SomeScreen() {

}

@Composable
fun DashboardScreen(
uiState: DashboardUiState,
onEvent: (DashboardUiEvent) -> Unit,
state: DashboardUiState,
handleEvent: (DashboardUiEvent) -> Unit,
modifier: Modifier = Modifier
) {
LaunchedActionEffect(uiState) { action: DashboardUiAction ->
LaunchedActionEffect(state) { action: DashboardUiAction ->
when (action) {
DashboardUiAction.NavigateToNext -> {}
}
}

when (uiState.state) {
when (state.state) {
is DashboardUiState.ContentState.Loading -> DashboardLoadingContent()
is DashboardUiState.ContentState.Error -> DashboardErrorContent()
is DashboardUiState.ContentState.Content -> DashboardContent(uiState.state)
is DashboardUiState.ContentState.Content -> DashboardContent(state.state)
}

Text(text = "DashboardScreen")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dev.galex.yamvil.sample.features.dashboard
import dev.galex.yamvil.models.base.Consumable
import dev.galex.yamvil.viewmodels.MVIViewModel

class DashboardViewModel: MVIViewModel<DashboardUiState, DashboardUiEvent>() {
class DashboardViewModel2: MVIViewModel<DashboardUiState, DashboardUiEvent>() {

override fun initializeUiState(): DashboardUiState {
return DashboardUiState(state = DashboardUiState.ContentState.Loading)
Expand Down

0 comments on commit 2567df1

Please sign in to comment.