Skip to content

Commit 467dfec

Browse files
committed
Mini 4.0.0
Fix mini-processor-test Add rules for StateContainer
1 parent 82b8f76 commit 467dfec

File tree

29 files changed

+224
-91
lines changed

29 files changed

+224
-91
lines changed

.idea/kotlinc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
### Security
1919
- No security issues fixed!
2020

21+
## [4.0.0] - 2023-10-31
22+
## 🎃🎃 Happy Halloween! 🎃🎃
23+
### Changed
24+
- BREAKING CHANGE: Mini has been updated to use Java 17 instead of Java 8.
25+
- BREAKING CHANGE: Mini states must now implement `mini.State`.
26+
- Update all project dependencies.
27+
- Update documentation.
28+
2129
## [3.1.0] - 2022-09-18
2230
### Added
2331
- Add **EXPERIMENTAL** support for Kotlin Symbol Processing (KSP). Be mindful of [the gotchas](README.md#ksp-gotchas).
@@ -174,7 +182,8 @@ state (`success` or `failure`)
174182
### Added
175183
- Initial architecture release.
176184

177-
[Unreleased]: https://github.com/hyperdevs-team/mini-kotlin/compare/3.1.0...HEAD
185+
[Unreleased]: https://github.com/hyperdevs-team/mini-kotlin/compare/4.0.0...HEAD
186+
[4.0.0]: https://github.com/hyperdevs-team/mini-kotlin/compare/3.1.0...4.0.0
178187
[3.1.0]: https://github.com/hyperdevs-team/mini-kotlin/compare/3.0.0...3.1.0
179188
[3.0.0]: https://github.com/hyperdevs-team/mini-kotlin/compare/2.0.0...3.0.0
180189
[2.0.0]: https://github.com/hyperdevs-team/mini-kotlin/compare/1.4.0...2.0.0

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,14 @@ ksp("com.github.hyperdevs-team.mini-kotlin:mini-processor:${miniVersion}")
147147

148148
</details>
149149

150-
### JDK8 requirements
151-
Ensure that your project has compatibility with Java 8:
150+
### JDK
151+
Ensure that your project has compatibility with Java 17:
152152

153153
For Kotlin projects:
154154
```groovy
155155
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
156156
kotlinOptions {
157-
jvmTarget = "1.8"
157+
jvmTarget = "17"
158158
}
159159
}
160160
```
@@ -163,12 +163,12 @@ For Android:
163163
```groovy
164164
android {
165165
compileOptions {
166-
sourceCompatibility = JavaVersion.VERSION_1_8
167-
targetCompatibility = JavaVersion.VERSION_1_8
166+
sourceCompatibility = JavaVersion.VERSION_17
167+
targetCompatibility = JavaVersion.VERSION_17
168168
}
169169
170170
kotlinOptions {
171-
jvmTarget = "1.8"
171+
jvmTarget = "17"
172172
}
173173
}
174174
```

app/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ apply plugin: "kotlin-kapt"
2828
apply plugin: "com.google.devtools.ksp"
2929

3030
android {
31-
compileSdkVersion android_target_sdk
32-
buildToolsVersion android_build_tools_version
31+
compileSdk = android_target_sdk
32+
buildToolsVersion = android_build_tools_version
3333

3434
namespace "com.example.androidsample"
3535

@@ -55,19 +55,19 @@ android {
5555
}
5656

5757
compileOptions {
58-
sourceCompatibility JavaVersion.VERSION_1_8
59-
targetCompatibility JavaVersion.VERSION_1_8
58+
sourceCompatibility JavaVersion.VERSION_17
59+
targetCompatibility JavaVersion.VERSION_17
6060
}
6161

6262
kotlinOptions {
63-
jvmTarget = "1.8"
63+
jvmTarget = "17"
6464
}
6565
lint {
6666
abortOnError false
6767
}
6868

69-
configurations.all {
70-
//This is library is included with two different versions
69+
configurations.configureEach {
70+
//This library is included with two different versions
7171
resolutionStrategy.force "com.google.code.findbugs:jsr305:3.0.1"
7272
}
7373
}

app/src/main/java/com/example/androidsample/SampleActions.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ import mini.Reducer
2121
import mini.SuspendingAction
2222
import java.io.Serializable
2323

24-
data class State(
24+
data class MainState(
2525
val text: String = "0",
2626
val loading: Boolean = false
27-
) : Serializable
27+
) : Serializable, mini.State
2828

2929
@Action
3030
data class SetLoadingAction(val loading: Boolean)

app/src/main/java/com/example/androidsample/StoreSampleActivity.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ import mini.android.FluxActivity
3030

3131
private val dispatcher = Dispatcher()
3232

33-
class MainStore : Store<State>() {
33+
class MainStore : Store<MainState>() {
3434

3535
init {
3636
Mini.link(dispatcher, this).track()
3737
}
3838

3939
@Reducer
40-
fun handleLoading(state: State, action: SetLoadingAction): State {
40+
fun handleLoading(state: MainState, action: SetLoadingAction): MainState {
4141
return state.copy(loading = action.loading)
4242
}
4343

4444
@Reducer
45-
fun handleSetTextAction(state: State, action: SetTextAction): State {
45+
fun handleSetTextAction(state: MainState, action: SetTextAction): MainState {
4646
return state.copy(text = action.text)
4747
}
4848

app/src/main/java/com/example/androidsample/ViewModelSampleActivity.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,33 +32,33 @@ import mini.android.FluxStoreViewModel
3232

3333
private val dispatcher = Dispatcher()
3434

35-
class MainViewModelReducer : NestedStateContainer<State>() {
35+
class MainViewModelReducer : NestedStateContainer<MainState>() {
3636

3737
@Reducer
38-
fun handleLoading(state: State, action: SetLoadingAction): State {
38+
fun handleLoading(state: MainState, action: SetLoadingAction): MainState {
3939
return state.copy(loading = action.loading)
4040
}
4141

4242
@Reducer
43-
fun handleSetTextAction(state: State, action: SetTextAction): State {
43+
fun handleSetTextAction(state: MainState, action: SetTextAction): MainState {
4444
return state.copy(text = action.text)
4545
}
4646
}
4747

48-
class MainStoreViewModel(savedStateHandle: SavedStateHandle) : FluxStoreViewModel<State>(savedStateHandle) {
48+
class MainStoreViewModel(savedStateHandle: SavedStateHandle) : FluxStoreViewModel<MainState>(savedStateHandle) {
4949
private val reducerSlice = MainViewModelReducer().apply { parent = this@MainStoreViewModel }
5050

5151
init {
5252
Mini.link(dispatcher, listOf(this, reducerSlice)).track()
5353
}
5454

55-
override fun saveState(state: State, handle: SavedStateHandle) {
55+
override fun saveState(state: MainState, handle: SavedStateHandle) {
5656
println("State saved")
5757
handle.set("state", state)
5858
}
5959

60-
override fun restoreState(handle: SavedStateHandle): State? {
61-
val restored = handle.get<State>("state")
60+
override fun restoreState(handle: SavedStateHandle): MainState? {
61+
val restored = handle.get<MainState>("state")
6262
println("State restored $restored")
6363
return restored
6464
}

build.gradle

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,25 @@ apply plugin: "com.gladed.androidgitversion"
2121

2222
buildscript {
2323
ext {
24-
kotlin_version = "1.7.0"
24+
kotlin_version = "1.9.10"
2525

26-
android_compile_sdk = 33
27-
android_target_sdk = 33
28-
android_build_tools_version = "30.0.3"
26+
android_compile_sdk = 34
27+
android_target_sdk = 34
28+
android_build_tools_version = "34.0.0"
2929

30-
activity_version = "1.5.0"
31-
fragment_version = "1.5.0"
32-
lifecycle_version = "2.5.1"
33-
coroutines_version = "1.6.4"
30+
activity_version = "1.8.0"
31+
fragment_version = "1.6.1"
32+
lifecycle_version = "2.6.2"
33+
coroutines_version = "1.7.3"
3434

35-
kodein_version = "7.14.0"
35+
kodein_version = "7.20.2"
3636

3737
junit_version = "4.13.2"
38-
test_runner_version = "1.4.0"
39-
espresso_version = "3.4.0"
38+
test_runner_version = "1.5.2"
39+
espresso_version = "3.5.1"
4040
kluent_version = "1.68"
4141

42-
ksp_version = "${kotlin_version}-1.0.6"
42+
ksp_version = "${kotlin_version}-1.0.13"
4343
}
4444

4545
repositories {
@@ -49,11 +49,11 @@ buildscript {
4949
}
5050

5151
dependencies {
52-
classpath "com.android.tools.build:gradle:7.2.2"
52+
classpath "com.android.tools.build:gradle:8.1.2"
5353
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
5454
classpath "org.junit.platform:junit-platform-gradle-plugin:1.2.0"
5555
classpath "com.gladed.androidgitversion:gradle-android-git-version:0.4.14"
56-
classpath "com.github.ben-manes:gradle-versions-plugin:0.42.0"
56+
classpath "com.github.ben-manes:gradle-versions-plugin:0.48.0"
5757
classpath "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:$ksp_version"
5858
}
5959
}
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Fri Jul 08 11:00:27 CEST 2022
21
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
42
distributionPath=wrapper/dists
5-
zipStorePath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
64
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

jitpack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
jdk:
2-
- openjdk11
2+
- openjdk17

0 commit comments

Comments
 (0)