init
This commit is contained in:
1
app/.gitignore
vendored
Normal file
1
app/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
83
app/build.gradle.kts
Normal file
83
app/build.gradle.kts
Normal file
@@ -0,0 +1,83 @@
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("kotlin-android")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
id("com.google.dagger.hilt.android")
|
||||
id("com.google.devtools.ksp")
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = Config.SdkVersion.COMPILE
|
||||
namespace = "com.testapp.test"
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.testapp.test"
|
||||
minSdk = Config.SdkVersion.MIN
|
||||
targetSdk = Config.SdkVersion.COMPILE
|
||||
versionCode = System.getenv("BUILD_NUMBER")?.toInt() ?: Config.Version.CODE
|
||||
versionName = Config.Version.NAME
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
vectorDrawables {
|
||||
useSupportLibrary = true
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
getByName(BuildType.DEBUG) {
|
||||
isDebuggable = true
|
||||
isMinifyEnabled = false
|
||||
}
|
||||
create(BuildType.STAGING) {
|
||||
isDebuggable = true
|
||||
isMinifyEnabled = true
|
||||
isShrinkResources = true
|
||||
}
|
||||
getByName(BuildType.RELEASE) {
|
||||
isDebuggable = false
|
||||
isMinifyEnabled = true
|
||||
isShrinkResources = true
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
isCoreLibraryDesugaringEnabled = true
|
||||
sourceCompatibility = JavaVersion.VERSION_21
|
||||
targetCompatibility = JavaVersion.VERSION_21
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
viewBinding = true
|
||||
}
|
||||
|
||||
lint {
|
||||
abortOnError = false
|
||||
}
|
||||
|
||||
// kapt block удаляем при переходе на KSP
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(fileTree("dir" to "libs", "include" to listOf("*.jar", "*.aar")))
|
||||
// Modules
|
||||
implementation(project(":style"))
|
||||
implementation(project(":presentation"))
|
||||
implementation(project(":data"))
|
||||
implementation(project(":domain:domain"))
|
||||
implementation(project(":domain:domain_impl"))
|
||||
|
||||
|
||||
implementation(libs.appcompat)
|
||||
implementation(libs.material)
|
||||
implementation(libs.activity.ktx)
|
||||
implementation(libs.core.ktx)
|
||||
implementation(libs.fragment.ktx)
|
||||
implementation(libs.splashscreen)
|
||||
|
||||
implementation(libs.hilt.android)
|
||||
ksp(libs.hilt.compiler)
|
||||
|
||||
debugImplementation(libs.leakcanary)
|
||||
|
||||
coreLibraryDesugaring(libs.desugar.jdk.libs)
|
||||
}
|
||||
21
app/proguard-rules.pro
vendored
Normal file
21
app/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.kts.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
20
app/src/main/AndroidManifest.xml
Normal file
20
app/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<application
|
||||
android:name="com.example.testproject.application.WeatherApp"
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.TestProject"
|
||||
tools:targetApi="31">
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.example.testproject.application
|
||||
|
||||
import android.app.Application
|
||||
import dagger.hilt.android.HiltAndroidApp
|
||||
|
||||
@HiltAndroidApp
|
||||
class WeatherApp : Application() {
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.example.testproject.di.modules
|
||||
|
||||
import com.testapp.data.api.RemoteWeatherDataSourceImpl
|
||||
import com.testapp.data.api.RestClient
|
||||
import com.testapp.data.api.RestClientImpl
|
||||
import com.testapp.data.datasource.LocalWeatherStorage
|
||||
import com.testapp.data.datasource.RemoteWeatherDataSource
|
||||
import com.testapp.data.db.LocalWeatherStorageImpl
|
||||
import dagger.Binds
|
||||
import dagger.Module
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Module
|
||||
@InstallIn(SingletonComponent::class)
|
||||
interface DataSourceModule {
|
||||
|
||||
@Singleton
|
||||
@Binds
|
||||
fun restClient(impl: RestClientImpl): RestClient
|
||||
|
||||
@Singleton
|
||||
@Binds
|
||||
fun localWeatherStorage(impl: LocalWeatherStorageImpl): LocalWeatherStorage
|
||||
|
||||
@Singleton
|
||||
@Binds
|
||||
fun weatherApi(impl: RemoteWeatherDataSourceImpl): RemoteWeatherDataSource
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.example.testproject.di.modules
|
||||
|
||||
import com.testapp.data.gatway.WeatherGateWayImpl
|
||||
import com.testapp.domain.domain.gatway.WeatherGateWay
|
||||
import dagger.Binds
|
||||
import dagger.Module
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Module
|
||||
@InstallIn(SingletonComponent::class)
|
||||
interface GateWayModule {
|
||||
|
||||
@Singleton
|
||||
@Binds
|
||||
fun bindGateWay(impl: WeatherGateWayImpl): WeatherGateWay
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.example.testproject.di.modules
|
||||
|
||||
import com.testapp.domain.domain.usecase.GetWeather
|
||||
import com.testapp.domain.domain.usecase.GetWeatherList
|
||||
import com.testapp.domain.domain.usecase.RequestNewWeather
|
||||
import com.testapp.domain.usecase.RequestNewWeatherImpl
|
||||
import com.testapp.domain.domain.usecase.SaveWeather
|
||||
import com.testapp.domain.usecase.GetWeatherImpl
|
||||
import com.testapp.domain.usecase.GetWeatherListImpl
|
||||
import com.testapp.domain.usecase.SaveWeatherImpl
|
||||
import dagger.Binds
|
||||
import dagger.Module
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Module
|
||||
@InstallIn(SingletonComponent::class)
|
||||
interface UseCaseWeather {
|
||||
|
||||
@Binds
|
||||
@Singleton
|
||||
fun getWeather(impl: GetWeatherImpl): GetWeather
|
||||
|
||||
@Binds
|
||||
@Singleton
|
||||
fun requestNewWeather(impl: RequestNewWeatherImpl): RequestNewWeather
|
||||
|
||||
@Binds
|
||||
@Singleton
|
||||
fun getWeatherList(impl: GetWeatherListImpl): GetWeatherList
|
||||
|
||||
@Binds
|
||||
@Singleton
|
||||
fun saveWeatherImpl(impl: SaveWeatherImpl): SaveWeather
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user