Skip to content

Commit

Permalink
updated ksp to 1.8.10
Browse files Browse the repository at this point in the history
  • Loading branch information
kasem-sm committed Feb 3, 2023
1 parent 73011d8 commit 08e0e5b
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 17 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'com.android.application' version '7.2.2' apply false
id 'com.android.library' version '7.2.2' apply false
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
id 'org.jetbrains.kotlin.jvm' version '1.7.10' apply false
id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
id 'org.jetbrains.kotlin.jvm' version '1.8.10' apply false
id 'io.github.gradle-nexus.publish-plugin' version "1.1.0" apply true
id 'com.diffplug.spotless' version "6.9.0" apply false
id 'org.jetbrains.dokka' version "1.7.10" apply false
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/LibraryConfigs.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
object LibraryConfigs {
const val groupId = "com.kasem-sm.easystore"
const val version = "0.0.3-alpha"
const val snapshotVersion = "0.0.3-SNAPSHOT"
const val version = "0.0.4-alpha"
const val snapshotVersion = "0.0.4-SNAPSHOT"
}
4 changes: 2 additions & 2 deletions easystore-processor/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
kotlin("jvm")
id("com.google.devtools.ksp") version "1.7.10-1.0.6"
id("com.google.devtools.ksp") version "1.8.10-1.0.9"
}

sourceSets.main {
Expand All @@ -15,7 +15,7 @@ dependencies {
implementation(project(":easystore-core"))

implementation("androidx.datastore:datastore-preferences-core:1.0.0")
implementation("com.google.devtools.ksp:symbol-processing-api:1.7.10-1.0.6")
implementation("com.google.devtools.ksp:symbol-processing-api:1.8.10-1.0.9")

implementation("com.squareup:kotlinpoet:1.12.0")
implementation("com.squareup:kotlinpoet-ksp:1.12.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class StoreVisitor(
// Retrieve
if (functionReturnType == null || functionReturnType.toClassName().simpleName != "Flow") {
logger.error(
"Functions annotated with @Retrieve should return Flow<PARAM_TYPE>. " +
"Functions annotated with @Retrieve should return Flow<T>. " +
"($functionName)"
)
return
Expand All @@ -168,7 +168,7 @@ class StoreVisitor(

if (innerType.toClassName().simpleName != parameter.toClassName().simpleName
) {
logger.error("The return type for the function $functionName should be Flow<${parameter.toClassName().simpleName}> as the parameter type is ${parameter.toClassName().simpleName}.")
logger.error("The return type for the function $functionName should be Flow<${parameter.toClassName().simpleName}> as the parameter type is ${parameter.toClassName().simpleName} or update the function's parameter type to ${innerType.toClassName().simpleName}")
return
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Aug 16 09:26:39 IST 2022
#Mon Nov 21 21:40:17 IST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
14 changes: 7 additions & 7 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'com.google.devtools.ksp' version "1.7.10-1.0.6"
id 'com.google.devtools.ksp' version "1.8.10-1.0.9"
}

android {
compileSdk 32
compileSdk 33

defaultConfig {
applicationId "kasem.sm.easystore.sample"
minSdk 21
targetSdk 32
targetSdk 33
versionCode 1
versionName "1.0"

Expand All @@ -36,14 +36,14 @@ android {
}

dependencies {
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.5.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.6.0'
implementation 'com.google.android.material:material:1.8.0'

implementation "androidx.datastore:datastore-preferences:1.0.0"
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

implementation "androidx.activity:activity-ktx:1.5.1"
implementation "androidx.activity:activity-ktx:1.6.1"

implementation(project(":easystore-core"))
ksp(project(":easystore-processor"))
Expand Down
12 changes: 12 additions & 0 deletions sample/src/main/java/kasem/sm/easystore/sample/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,24 @@ interface AppPreferences {
// Automatic Enum mapping (Also supports Data Class)
@Retrieve(preferenceKeyName = "app_theme")
fun getAppTheme(default: Theme): Flow<Theme>

@Store(preferenceKeyName = "user")
suspend fun updateUser(user: User)

@Retrieve(preferenceKeyName = "user")
fun getCurrentUser(default: User): Flow<User>
}

enum class Theme {
DARK, LIGHT, SYSTEM
}

data class User(
val id: Int,
val username: String,
val loginTime: Long
)

// Single Instance of DataStore
private val Context.dataStore: DataStore<Preferences>
by preferencesDataStore(name = "my_prefs")
Expand Down

0 comments on commit 08e0e5b

Please sign in to comment.