diff --git a/android/CHANGELOG.md b/android/CHANGELOG.md new file mode 100644 index 0000000..8c74605 --- /dev/null +++ b/android/CHANGELOG.md @@ -0,0 +1,9 @@ +# Android Changelog + +## 2026-03-08 +### Step 1 - Build and app wiring +- Added Android project plugin configuration for Hilt and Kotlin serialization. +- Added dependency repositories and explicit app module include in settings. +- Added app dependencies for Retrofit/OkHttp, DataStore, coroutines, Hilt, and unit testing. +- Enabled INTERNET permission and registered MessengerApplication in manifest. +- Added MessengerApplication with HiltAndroidApp. diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 1494463..d1edd19 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -1,20 +1,23 @@ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") + id(com.android.application) + id(org.jetbrains.kotlin.android) + id(org.jetbrains.kotlin.kapt) + id(org.jetbrains.kotlin.plugin.serialization) + id(com.google.dagger.hilt.android) } android { - namespace = "ru.daemonlord.messenger" + namespace = ru.daemonlord.messenger compileSdk = 35 defaultConfig { - applicationId = "ru.daemonlord.messenger" + applicationId = ru.daemonlord.messenger minSdk = 26 targetSdk = 35 versionCode = 1 - versionName = "0.1.0" + versionName = 0.1.0 - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + testInstrumentationRunner = androidx.test.runner.AndroidJUnitRunner vectorDrawables { useSupportLibrary = true } @@ -24,8 +27,8 @@ android { release { isMinifyEnabled = false proguardFiles( - getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" + getDefaultProguardFile(proguard-android-optimize.txt), + proguard-rules.pro ) } } @@ -36,33 +39,59 @@ android { } kotlinOptions { - jvmTarget = "17" + jvmTarget = 17 } buildFeatures { compose = true + buildConfig = true } composeOptions { - kotlinCompilerExtensionVersion = "1.5.15" + kotlinCompilerExtensionVersion = 1.5.15 } packaging { resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" + excludes += /META-INF/AL2.0 } } } dependencies { - implementation("androidx.core:core-ktx:1.15.0") - implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7") - implementation("androidx.activity:activity-compose:1.10.1") - implementation("androidx.compose.ui:ui:1.7.6") - implementation("androidx.compose.ui:ui-tooling-preview:1.7.6") - implementation("androidx.compose.material3:material3:1.3.1") - implementation("androidx.navigation:navigation-compose:2.8.5") + implementation(androidx.core:core-ktx:1.15.0) + implementation(androidx.lifecycle:lifecycle-runtime-ktx:2.8.7) + implementation(androidx.lifecycle:lifecycle-viewmodel-compose:2.8.7) + implementation(androidx.activity:activity-compose:1.10.1) + implementation(androidx.navigation:navigation-compose:2.8.5) - debugImplementation("androidx.compose.ui:ui-tooling:1.7.6") - debugImplementation("androidx.compose.ui:ui-test-manifest:1.7.6") + implementation(androidx.compose.ui:ui:1.7.6) + implementation(androidx.compose.ui:ui-tooling-preview:1.7.6) + implementation(androidx.compose.material3:material3:1.3.1) + + implementation(org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0) + implementation(org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3) + + implementation(com.squareup.retrofit2:retrofit:2.11.0) + implementation(com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0) + implementation(com.squareup.okhttp3:okhttp:4.12.0) + implementation(com.squareup.okhttp3:logging-interceptor:4.12.0) + + implementation(androidx.datastore:datastore-preferences:1.1.1) + + implementation(com.google.dagger:hilt-android:2.52) + kapt(com.google.dagger:hilt-compiler:2.52) + implementation(androidx.hilt:hilt-navigation-compose:1.2.0) + + testImplementation(junit:junit:4.13.2) + testImplementation(org.jetbrains.kotlinx:kotlinx-coroutines-test:1.9.0) + testImplementation(io.mockk:mockk:1.13.13) + testImplementation(com.squareup.okhttp3:mockwebserver:4.12.0) + + debugImplementation(androidx.compose.ui:ui-tooling:1.7.6) + debugImplementation(androidx.compose.ui:ui-test-manifest:1.7.6) +} + +kapt { + correctErrorTypes = true } diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 2fbf62a..4d6c41d 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,19 +1,22 @@ - - + + + + + android:name=.MessengerApplication + android:allowBackup=true + android:icon=@android:drawable/sym_def_app_icon + android:label=@string/app_name + android:roundIcon=@android:drawable/sym_def_app_icon + android:supportsRtl=true + android:theme=@android:style/Theme.Material.Light.NoActionBar> + android:name=.MainActivity + android:exported=true> - - + + diff --git a/android/app/src/main/java/ru/daemonlord/messenger/MessengerApplication.kt b/android/app/src/main/java/ru/daemonlord/messenger/MessengerApplication.kt new file mode 100644 index 0000000..4039667 --- /dev/null +++ b/android/app/src/main/java/ru/daemonlord/messenger/MessengerApplication.kt @@ -0,0 +1,7 @@ +package ru.daemonlord.messenger + +import android.app.Application +import dagger.hilt.android.HiltAndroidApp + +@HiltAndroidApp +class MessengerApplication : Application() diff --git a/android/build.gradle.kts b/android/build.gradle.kts index d176100..4f39563 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -1,4 +1,7 @@ plugins { - id("com.android.application") version "8.7.2" apply false - id("org.jetbrains.kotlin.android") version "2.0.21" apply false + id(com.android.application) version 8.7.2 apply false + id(org.jetbrains.kotlin.android) version 2.0.21 apply false + id(com.google.dagger.hilt.android) version 2.52 apply false + id(org.jetbrains.kotlin.plugin.serialization) version 2.0.21 apply false + id(org.jetbrains.kotlin.kapt) version 2.0.21 apply false } diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts index c296dcc..223b0df 100644 --- a/android/settings.gradle.kts +++ b/android/settings.gradle.kts @@ -14,5 +14,5 @@ dependencyResolutionManagement { } } -rootProject.name = "BenyaMessengerAndroid" -include(":app") +rootProject.name = MessengerAndroid +include(:app)