Skip to content

Commit

Permalink
Update versions of the dependency libraries with kotlin = 1.8.22
Browse files Browse the repository at this point in the history
  • Loading branch information
wf9a5m75 committed Jun 30, 2023
1 parent 659a719 commit d767f17
Show file tree
Hide file tree
Showing 10 changed files with 206 additions and 28 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
logErrors.txt
2 changes: 1 addition & 1 deletion android/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions android/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 18 additions & 11 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ android {
vectorDrawables {
useSupportLibrary true
}
javaCompileOptions {
annotationProcessorOptions {
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}

buildTypes {
Expand All @@ -45,7 +50,7 @@ android {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.1.1'
kotlinCompilerExtensionVersion "$kotlin_compiler_extension_version"
}
packagingOptions {
resources {
Expand All @@ -66,8 +71,8 @@ android {

dependencies {
// coroutine (thread manager)
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinx_coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinx_coroutines_version"


// retrofit (http library)
Expand All @@ -91,14 +96,14 @@ dependencies {
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.room:room-ktx:$room_version"
kapt "androidx.room:room-compiler:$room_version"
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation "androidx.appcompat:appcompat:$androidX_appcompat_version"

// ViewModel
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
implementation "androidx.activity:activity-ktx:1.6.1"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$androidX_lifecycle_version"
implementation "androidx.activity:activity-ktx:$androidX_activity_version"

// Fragment
implementation "androidx.fragment:fragment-ktx:1.5.5"
implementation "androidx.fragment:fragment-ktx:$androidX_fragment_version"

// Navigation
implementation "androidx.navigation:navigation-fragment-ktx:$compose_navigation_version"
Expand All @@ -108,9 +113,9 @@ dependencies {
// Preferences DataStore
implementation "androidx.datastore:datastore-preferences:1.0.0"

implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
implementation 'androidx.activity:activity-compose:1.6.1'
implementation "androidx.core:core-ktx:$androidX_core_version"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$androidX_lifecycle_version"
implementation "androidx.activity:activity-compose:$androidX_activity_version"
implementation "androidx.compose.ui:ui:$compose_ui_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_ui_version"
implementation 'androidx.compose.material:material:1.3.1'
Expand All @@ -120,12 +125,14 @@ dependencies {
testImplementation "junit:junit:$junit_version"
// testImplementation "org.mockito:mockito-core:$mockito_version"
testImplementation "org.mockito.kotlin:mockito-kotlin:$mockito_kotlin_version"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinx_coroutines_version"

// Android test
androidTestImplementation "org.mockito:mockito-android:$mockito_version"
androidTestImplementation "androidx.test.ext:junit:$androidX_test_junit_version"
androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_version"
androidTestImplementation "androidx.test:runner:$androidX_test_version"
androidTestImplementation "androidx.test:rules:$androidX_test_version"
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_ui_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_ui_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_ui_version"
Expand Down
110 changes: 110 additions & 0 deletions android/app/schemas/com.example.weatherapp.database.AppDatabase/2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"formatVersion": 1,
"database": {
"version": 2,
"identityHash": "d4d35101ea6591489ce537205e84f79e",
"entities": [
{
"tableName": "Prefecture",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `cities` TEXT NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "cities",
"columnName": "cities",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "KeyValuePair",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `value` TEXT NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "value",
"columnName": "value",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "WeeklyForecast",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`cityId` TEXT NOT NULL, `last_update` TEXT NOT NULL, `overall` TEXT NOT NULL, `forecasts` TEXT NOT NULL, PRIMARY KEY(`cityId`))",
"fields": [
{
"fieldPath": "cityId",
"columnName": "cityId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "last_update",
"columnName": "last_update",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "overall",
"columnName": "overall",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "forecasts",
"columnName": "forecasts",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"cityId"
]
},
"indices": [],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'd4d35101ea6591489ce537205e84f79e')"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"formatVersion": 1,
"database": {
"version": 1,
"identityHash": "74fb9a079790805d36b6793d448d4236",
"entities": [
{
"tableName": "CacheValue",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`url` TEXT NOT NULL, `eTag` TEXT NOT NULL, `lastModified` TEXT NOT NULL, PRIMARY KEY(`url`))",
"fields": [
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "eTag",
"columnName": "eTag",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "lastModified",
"columnName": "lastModified",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"url"
]
},
"indices": [],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '74fb9a079790805d36b6793d448d4236')"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ class SettingsFragment : Fragment() {
// If no preference, move to the selectCity screen
viewModel.saveSelectedCity {
// move back to the main fragment
if (navController.backQueue.isNotEmpty()) {
navController.popBackStack()
} else {
navController.navigate(R.id.mainFragment)
}
navController.popBackStack(R.id.mainFragment, false)
// if (navController.backQueue.isNotEmpty()) {
// navController.popBackStack()
// } else {
// navController.navigate(R.id.mainFragment)
// }
}
}
}
Expand Down
30 changes: 22 additions & 8 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
buildscript {
ext {
compose_ui_version = '1.3.3'
hilt_version = '2.44.2'
kotlinx_coroutines_version = '1.7.0'
compose_ui_version = '1.4.3'
hilt_version = '2.46.1'
hilt_navigaton_version = '1.0.0'
junit_version = '4.13.2'
androidX_core_version = '1.10.1'
androidX_test_version = '1.5.0'
androidX_test_junit_version = '1.1.4'
espresso_version = '3.5.0'
androidX_appcompat_version = '1.6.1'
androidX_lifecycle_version = '2.6.1'
androidX_activity_version = '1.7.2'
androidX_fragment_version = '1.6.0'

espresso_version = '3.5.1'
androidX_test_version = '1.5.0'
mock_server_version = '4.10.0'
compose_navigation_version = '2.5.3'
compose_navigation_version = '2.6.0'

room_version = '2.5.0'
room_version = '2.5.2'
mockito_version = '4.9.0'
mockito_kotlin_version = '4.1.0'

// Must specify a compatible version for kotlin_compiler_extension_version with
// kotlin_version.
// https://developer.android.com/jetpack/androidx/releases/compose-kotlin
kotlin_version = '1.8.22'
kotlin_compiler_extension_version = '1.4.8'
}
dependencies {
classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version"
}
}
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
id 'com.android.application' version '7.4.2' apply false
id 'com.android.library' version '7.4.2' apply false
id 'org.jetbrains.kotlin.android' version "$kotlin_version" apply false
id 'org.jlleitschuh.gradle.ktlint' version '11.0.0' apply true
}

Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Nov 09 14:58:03 PST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

0 comments on commit d767f17

Please sign in to comment.