Реструктуризация проекта

This commit is contained in:
Roman Pytkov
2024-10-31 17:19:02 +03:00
parent c74d398c53
commit b95666789c
25 changed files with 49 additions and 146 deletions

View File

@@ -7,11 +7,11 @@ plugins {
}
android {
namespace = "com.github.nullptroma.wallenc"
namespace = "com.github.nullptroma.wallenc.app"
compileSdk = 35
defaultConfig {
applicationId = "com.github.nullptroma.wallenc"
applicationId = "com.github.nullptroma.wallenc.app"
minSdk = 24
targetSdk = 34
versionCode = 1
@@ -63,18 +63,6 @@ dependencies {
implementation(libs.dagger.hilt)
ksp(libs.dagger.hilt.compiler)
// Room
implementation(libs.room.ktx)
implementation(libs.room.runtime)
annotationProcessor(libs.room.compiler)
ksp(libs.room.compiler)
// Retrofit
implementation(libs.retrofit)
implementation(libs.retrofit.converter.gson)
implementation(libs.retrofit.converter.scalars)
implementation(libs.google.gson)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.compose)
@@ -93,6 +81,6 @@ dependencies {
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.ui.test.junit4)
implementation(project(":domain"))
implementation(project(":data"))
implementation(project(":domain"))
}

View File

@@ -1,4 +1,4 @@
package com.github.nullptroma.wallenc
package com.github.nullptroma.wallenc.app
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

View File

@@ -1,4 +1,4 @@
package com.github.nullptroma.wallenc
package com.github.nullptroma.wallenc.app
import android.os.Bundle
import android.widget.Toast
@@ -18,10 +18,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.hilt.navigation.compose.hiltViewModel
import com.github.nullptroma.wallenc.ui.screens.main.MainScreen
import com.github.nullptroma.wallenc.ui.screens.main.MainViewModel
import com.github.nullptroma.wallenc.ui.theme.WallencTheme
import com.github.nullptroma.wallenc.app.ui.theme.WallencTheme
import com.yandex.authsdk.YandexAuthLoginOptions
import com.yandex.authsdk.YandexAuthOptions
import com.yandex.authsdk.YandexAuthResult

View File

@@ -1,4 +1,4 @@
package com.github.nullptroma.wallenc
package com.github.nullptroma.wallenc.app
import android.app.Application
import dagger.hilt.android.HiltAndroidApp

View File

@@ -1,4 +1,4 @@
package com.github.nullptroma.wallenc.ui.screens.main
package com.github.nullptroma.wallenc.app.ui.screens.main
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column

View File

@@ -0,0 +1,3 @@
package com.github.nullptroma.wallenc.app.ui.screens.main
data class MainScreenState(val value: String)

View File

@@ -1,4 +1,4 @@
package com.github.nullptroma.wallenc.ui.screens.main
package com.github.nullptroma.wallenc.app.ui.screens.main
import androidx.lifecycle.ViewModel
import dagger.hilt.android.lifecycle.HiltViewModel

View File

@@ -1,4 +1,4 @@
package com.github.nullptroma.wallenc.ui.theme
package com.github.nullptroma.wallenc.app.ui.theme
import androidx.compose.ui.graphics.Color

View File

@@ -1,4 +1,4 @@
package com.github.nullptroma.wallenc.ui.theme
package com.github.nullptroma.wallenc.app.ui.theme
import android.os.Build
import androidx.compose.foundation.isSystemInDarkTheme

View File

@@ -1,4 +1,4 @@
package com.github.nullptroma.wallenc.ui.theme
package com.github.nullptroma.wallenc.app.ui.theme
import androidx.compose.material3.Typography
import androidx.compose.ui.text.TextStyle

View File

@@ -1,3 +0,0 @@
package com.github.nullptroma.wallenc.ui.screens.main
data class MainScreenState(val value: String)

View File

@@ -1,17 +0,0 @@
package com.github.nullptroma.wallenc
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}

View File

@@ -1,4 +1,4 @@
package com.github.nullptroma.domain
package com.github.nullptroma.wallenc.app
import org.junit.Test

View File

@@ -7,4 +7,5 @@ plugins {
alias(libs.plugins.android.library) apply false
alias(libs.plugins.dagger.hilt) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.jetbrains.kotlin.jvm) apply false
}

View File

@@ -6,8 +6,8 @@ plugins {
}
android {
namespace = "com.github.nullptroma.data"
compileSdk = 35
namespace = "com.github.nullptroma.wallenc.data"
compileSdk = 34
defaultConfig {
minSdk = 24
@@ -35,13 +35,28 @@ android {
}
dependencies {
// Hilt
implementation(libs.dagger.hilt)
ksp(libs.dagger.hilt.compiler)
// Room
implementation(libs.room.ktx)
implementation(libs.room.runtime)
annotationProcessor(libs.room.compiler)
ksp(libs.room.compiler)
// Retrofit
implementation(libs.retrofit)
implementation(libs.retrofit.converter.gson)
implementation(libs.retrofit.converter.scalars)
implementation(libs.google.gson)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
implementation(project(":domain"))
}

View File

@@ -1,24 +0,0 @@
package com.github.nullptroma.data
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.github.nullptroma.data.test", appContext.packageName)
}
}

View File

@@ -1,4 +1,4 @@
package com.github.nullptroma.domain
package com.github.nullptroma.wallenc.data
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
@@ -19,6 +19,6 @@ class ExampleInstrumentedTest {
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.github.nullptroma.domain.test", appContext.packageName)
assertEquals("com.github.nullptroma.wallenc.data.test", appContext.packageName)
}
}

View File

@@ -1,4 +1,4 @@
package com.github.nullptroma.data
package com.github.nullptroma.wallenc.data
import org.junit.Test

View File

@@ -1,47 +1,9 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.dagger.hilt)
alias(libs.plugins.ksp)
id("java-library")
alias(libs.plugins.jetbrains.kotlin.jvm)
}
android {
namespace = "com.github.nullptroma.domain"
compileSdk = 35
defaultConfig {
minSdk = 24
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
}
dependencies {
implementation(libs.dagger.hilt)
ksp(libs.dagger.hilt.compiler)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

View File

@@ -1,21 +0,0 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# 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

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>

View File

@@ -0,0 +1,4 @@
package com.github.nullptroma.wallenc.domain
class MyClass {
}

View File

@@ -18,6 +18,7 @@ retrofit = "2.9.0"
gson = "2.10.1"
appcompat = "1.7.0"
material = "1.12.0"
jetbrainsKotlinJvm = "2.0.20"
[libraries]
navigation = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigation" }
@@ -67,4 +68,5 @@ compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "
dagger-hilt = { id = "com.google.dagger.hilt.android", version.ref = "daggerHilt" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
android-library = { id = "com.android.library", version.ref = "agp" }
jetbrains-kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "jetbrainsKotlinJvm" }

View File

@@ -21,5 +21,5 @@ dependencyResolutionManagement {
rootProject.name = "Wallenc"
include(":app")
include(":domain")
include(":data")
include(":domain")