commit
This commit is contained in:
parent
522ea7e394
commit
08bee5dbba
@ -1,6 +1,6 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Default" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<style name="Theme.Default" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_500</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
|
2
buildSrc/.gitignore
vendored
Normal file
2
buildSrc/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/.gradle
|
||||
/build
|
8
buildSrc/build.gradle.kts
Normal file
8
buildSrc/build.gradle.kts
Normal file
@ -0,0 +1,8 @@
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
220
buildSrc/src/main/java/Dependencies.kt
Normal file
220
buildSrc/src/main/java/Dependencies.kt
Normal file
@ -0,0 +1,220 @@
|
||||
data class Dependency(
|
||||
val name: String,
|
||||
val version: String,
|
||||
) {
|
||||
val fullPath get() = "$name:$version"
|
||||
}
|
||||
|
||||
object Dependencies {
|
||||
|
||||
/**
|
||||
* Type-safe HTTP client for Android and Java by Square, Inc.
|
||||
*
|
||||
* [Documentation](http://square.github.io/retrofit/)
|
||||
*
|
||||
* [Github](https://github.com/square/retrofit)
|
||||
*
|
||||
* [Apache License 2.0](https://github.com/square/retrofit/blob/master/LICENSE.txt)
|
||||
*
|
||||
* [Changelog](https://github.com/square/retrofit/blob/master/CHANGELOG.md)
|
||||
*/
|
||||
object Retrofit {
|
||||
private const val version = "2.9.0"
|
||||
|
||||
val library = Dependency("com.squareup.retrofit2:retrofit", version)
|
||||
val gsonConverter = Dependency("com.squareup.retrofit2:converter-gson", version)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [Documentation](https://developer.android.com/jetpack/androidx)
|
||||
*
|
||||
* [Releases](https://developer.android.com/jetpack/androidx/versions).
|
||||
*/
|
||||
object AndroidX {
|
||||
/**
|
||||
* [Changelog](https://developer.android.com/jetpack/androidx/releases/core)
|
||||
*/
|
||||
val core = Dependency("androidx.core:core-ktx", "1.13.1")
|
||||
|
||||
/**
|
||||
* [Changelog](https://developer.android.com/jetpack/androidx/releases/appcompat)
|
||||
*/
|
||||
val appcompat = Dependency("androidx.appcompat:appcompat", "1.7.0")
|
||||
|
||||
/**
|
||||
* [Changelog](https://developer.android.com/jetpack/androidx/releases/activity)
|
||||
*/
|
||||
val activity = Dependency("androidx.activity:activity", "1.9.3")
|
||||
|
||||
/**
|
||||
* [Changelog](https://developer.android.com/jetpack/androidx/releases/fragment)
|
||||
*/
|
||||
val fragment = Dependency("androidx.fragment:fragment-ktx", "1.8.4")
|
||||
|
||||
/**
|
||||
* [Changelog](https://developer.android.com/jetpack/androidx/releases/recyclerview)
|
||||
*/
|
||||
val recyclerView = Dependency("androidx.recyclerview:recyclerview", "1.3.2")
|
||||
|
||||
/**
|
||||
* [Changelog](https://developer.android.com/jetpack/androidx/releases/cardview)
|
||||
*/
|
||||
val cardView = Dependency("androidx.cardview:cardview", "1.0.0")
|
||||
|
||||
/**
|
||||
* [Changelog](https://developer.android.com/jetpack/androidx/releases/gridlayout)
|
||||
*/
|
||||
val gridLayout = Dependency("androidx.gridlayout:gridlayout", "1.0.0")
|
||||
|
||||
/**
|
||||
* A ConstraintLayout is a ViewGroup which allows you to position and size widgets in a flexible way.
|
||||
*
|
||||
* [Documentation](https://developer.android.com/reference/android/support/constraint/ConstraintLayout)
|
||||
*
|
||||
* [Changelog](https://developer.android.com/jetpack/androidx/releases/constraintlayout)
|
||||
*/
|
||||
val constraintLayout = Dependency("androidx.constraintlayout:constraintlayout", "2.1.4")
|
||||
|
||||
/**
|
||||
* CoordinatorLayout is a super-powered FrameLayout.
|
||||
* CoordinatorLayout is intended for two primary use cases:
|
||||
* 1. As a top-level application decor or chrome layout
|
||||
* 2. As a container for a specific interaction with one or more child views
|
||||
*
|
||||
* [Documentation](https://developer.android.com/jetpack/androidx/releases/coordinatorlayout)
|
||||
*
|
||||
* [Changelog](https://developer.android.com/jetpack/androidx/releases/coordinatorlayout)
|
||||
*/
|
||||
val coordinatorLayout = Dependency("androidx.coordinatorlayout:coordinatorlayout", "1.2.0")
|
||||
|
||||
/**
|
||||
* The SwipeRefreshLayout should be used whenever the user
|
||||
* can refresh the contents of a view via a vertical swipe gesture.
|
||||
*
|
||||
* [Documentation](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout)
|
||||
*
|
||||
* [Changelog](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout)
|
||||
*/
|
||||
val swipeRefreshLayout = Dependency("androidx.swiperefreshlayout:swiperefreshlayout", "1.1.0")
|
||||
|
||||
/**
|
||||
* [Changelog](https://developer.android.com/jetpack/androidx/releases/test/)
|
||||
*/
|
||||
object Testing {
|
||||
|
||||
/**
|
||||
* [Documentation](https://developer.android.com/training/testing)
|
||||
*/
|
||||
val core = Dependency("androidx.test:core", "1.5.0")
|
||||
|
||||
/**
|
||||
* [Documentation](https://developer.android.com/training/testing)
|
||||
*/
|
||||
val junit = Dependency("androidx.test.ext:junit-ktx", "1.1.5")
|
||||
|
||||
/**
|
||||
* [Documentation](https://developer.android.com/training/testing/espresso)
|
||||
*/
|
||||
object Espresso {
|
||||
private const val version = "3.5.1"
|
||||
val core = Dependency("androidx.test.espresso:espresso-core", version)
|
||||
val intents = Dependency("androidx.test.espresso:espresso-intents", version)
|
||||
val contrib = Dependency("androidx.test.espresso:espresso-contrib", version)
|
||||
}
|
||||
|
||||
/**
|
||||
* [Documentation](https://developer.android.com/training/testing/junit-runner)
|
||||
*/
|
||||
val runner = Dependency("androidx.test:runner", "1.5.2")
|
||||
|
||||
/**
|
||||
* [Documentation](https://developer.android.com/training/testing/junit-rules)
|
||||
*/
|
||||
val rules = Dependency("androidx.test:rules", "1.5.0")
|
||||
|
||||
/**
|
||||
* [Documentation](https://developer.android.com/training/testing/junit-rules)
|
||||
*/
|
||||
val compose = Dependency("androidx.compose.ui:ui-test-junit4", "1.6.0")
|
||||
|
||||
/**
|
||||
* [Documentation](https://developer.android.com/training/testing/junit-runner#using-android-test-orchestrator)
|
||||
*/
|
||||
val orchestrator = Dependency("androidx.test:orchestrator", "1.4.2")
|
||||
|
||||
/**
|
||||
* [Documentation](https://developer.android.com/training/testing/ui-automator)
|
||||
*/
|
||||
val uiAutomator = Dependency("androidx.test.uiautomator:uiautomator", "2.2.0")
|
||||
}
|
||||
|
||||
/**
|
||||
* [Documentation](https://material.io/develop/android/)
|
||||
*
|
||||
* [Github](https://github.com/material-components/material-components-android)
|
||||
*
|
||||
* [Changelog](https://github.com/material-components/material-components-android/releases)
|
||||
*/
|
||||
val materialDesign = Dependency("com.google.android.material:material", "1.11.0")
|
||||
|
||||
object Lifecycle {
|
||||
private const val version = "2.6.1"
|
||||
|
||||
val viewModel = Dependency("androidx.lifecycle:lifecycle-viewmodel-ktx", version)
|
||||
val common = Dependency("androidx.lifecycle:lifecycle-common", version)
|
||||
}
|
||||
|
||||
object Navigation {
|
||||
private const val version = "2.8.3"
|
||||
|
||||
val fragment = Dependency("androidx.navigation:navigation-fragment-ktx", version)
|
||||
val navigationUi = Dependency("androidx.navigation:navigation-ui-ktx", version)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* JUnit is a simple framework to write repeatable tests.
|
||||
*
|
||||
* [Documentation](https://junit.org/junit4/)
|
||||
*
|
||||
* [Github](https://github.com/junit-team/junit4)
|
||||
*
|
||||
* [Eclipse Public License 1.0](https://github.com/junit-team/junit4/blob/master/LICENSE-junit.txt)
|
||||
*
|
||||
* [Changelog](https://github.com/junit-team/junit4/wiki)
|
||||
*/
|
||||
val junit = Dependency("junit:junit", "4.13")
|
||||
|
||||
/**
|
||||
* Truth makes your test assertions and failure messages more readable.
|
||||
* Similar to AssertJ, it natively supports many JDK and Guava types,
|
||||
* and it is extensible to others.
|
||||
*
|
||||
* [Documentation](https://truth.dev/)
|
||||
*
|
||||
* [Github](https://github.com/google/truth)
|
||||
*
|
||||
* [Apache License 2.0](https://github.com/google/truth/blob/master/LICENSE)
|
||||
*
|
||||
* [Changelog](https://github.com/google/truth/releases)
|
||||
*/
|
||||
val truth = Dependency("com.google.truth:truth", "1.3.0")
|
||||
|
||||
/**
|
||||
* Kaspresso is a framework for Android UI testing. Based on Espresso and UI Automator.
|
||||
*
|
||||
* [Documentation](https://kasperskylab.github.io/Kaspresso/)
|
||||
*
|
||||
* [Github](https://github.com/KasperskyLab/Kaspresso)
|
||||
*
|
||||
* [Apache License 2.0](https://github.com/KasperskyLab/Kaspresso/blob/master/LICENSE.txt)
|
||||
*
|
||||
* [Changelog](https://github.com/KasperskyLab/Kaspresso/releases)
|
||||
*/
|
||||
object Kaspresso {
|
||||
private const val version = "1.5.3"
|
||||
val core = Dependency("com.kaspersky.android-components:kaspresso", version)
|
||||
val composeSupport = Dependency("com.kaspersky.android-components:kaspresso-compose-support", version)
|
||||
}
|
||||
}
|
40
buildSrc/src/main/java/DependencyHandlerExtensions.kt
Normal file
40
buildSrc/src/main/java/DependencyHandlerExtensions.kt
Normal file
@ -0,0 +1,40 @@
|
||||
import org.gradle.api.artifacts.dsl.DependencyHandler
|
||||
|
||||
fun DependencyHandler.implementation(dependency: Dependency) {
|
||||
add(Type.IMPLEMENTATION, dependency.fullPath)
|
||||
}
|
||||
|
||||
fun DependencyHandler.testImplementation(dependency: Dependency) {
|
||||
add(Type.TEST_IMPLEMENTATION, dependency.fullPath)
|
||||
}
|
||||
|
||||
fun DependencyHandler.androidTestImplementation(dependency: Dependency) {
|
||||
add(Type.ANDROID_TEST_IMPLEMENTATION, dependency.fullPath)
|
||||
}
|
||||
|
||||
fun DependencyHandler.api(dependency: Dependency) {
|
||||
add(Type.API, dependency.fullPath)
|
||||
}
|
||||
|
||||
fun DependencyHandler.kapt(dependency: Dependency) {
|
||||
add(Type.KAPT, dependency.fullPath)
|
||||
}
|
||||
|
||||
fun DependencyHandler.ksp(dependency: Dependency) {
|
||||
add(Type.KSP, dependency.fullPath)
|
||||
}
|
||||
|
||||
fun DependencyHandler.defaultLibrary() {
|
||||
api(Dependencies.AndroidX.core)
|
||||
api(Dependencies.AndroidX.appcompat)
|
||||
api(Dependencies.AndroidX.materialDesign)
|
||||
}
|
||||
|
||||
private object Type {
|
||||
const val IMPLEMENTATION = "implementation"
|
||||
const val TEST_IMPLEMENTATION = "testImplementation"
|
||||
const val ANDROID_TEST_IMPLEMENTATION = "androidTestImplementation"
|
||||
const val API = "api"
|
||||
const val KAPT = "kapt"
|
||||
const val KSP = "ksp"
|
||||
}
|
67
buildSrc/src/main/java/Plugin.kt
Normal file
67
buildSrc/src/main/java/Plugin.kt
Normal file
@ -0,0 +1,67 @@
|
||||
import org.gradle.kotlin.dsl.version
|
||||
import org.gradle.plugin.use.PluginDependenciesSpec
|
||||
import org.gradle.plugin.use.PluginDependencySpec
|
||||
|
||||
val PluginDependenciesSpec.androidApplication: PluginDependencySpec
|
||||
get() = id(Plugin.Id.Android.application)
|
||||
val PluginDependenciesSpec.androidLibrary: PluginDependencySpec
|
||||
get() = id(Plugin.Id.Android.library)
|
||||
val PluginDependenciesSpec.kotlinJvm: PluginDependencySpec
|
||||
get() = id(Plugin.Id.Kotlin.jvm)
|
||||
val PluginDependenciesSpec.kotlinAndroid: PluginDependencySpec
|
||||
get() = id(Plugin.Id.Kotlin.android)
|
||||
val PluginDependenciesSpec.kotlinParcelize: PluginDependencySpec
|
||||
get() = id(Plugin.Id.Kotlin.parcelize)
|
||||
val PluginDependenciesSpec.kotlinAnnotationProcessor: PluginDependencySpec
|
||||
get() = id(Plugin.Id.Kotlin.annotationProcessor)
|
||||
val PluginDependenciesSpec.kotlinSerialization: PluginDependencySpec
|
||||
get() = id(Plugin.Id.Kotlin.serialization)
|
||||
val PluginDependenciesSpec.jetbrainsKotlinSerialization: PluginDependencySpec
|
||||
get() = id(Plugin.Id.JetBrains.serialization)
|
||||
|
||||
object Plugin {
|
||||
object Id {
|
||||
object Android {
|
||||
/**
|
||||
* [Documentation](https://google.github.io/android-gradle-dsl/current/)
|
||||
* [Changelog](https://developer.android.com/studio/releases/gradle-plugin)
|
||||
*/
|
||||
const val application = "com.android.application"
|
||||
/**
|
||||
* [Documentation](https://google.github.io/android-gradle-dsl/current/)
|
||||
* [Changelog](https://developer.android.com/studio/releases/gradle-plugin)
|
||||
*/
|
||||
const val library = "com.android.library"
|
||||
}
|
||||
|
||||
object Kotlin {
|
||||
/**
|
||||
* Plugin published in https://plugins.gradle.org/
|
||||
*/
|
||||
const val jvm = "org.jetbrains.kotlin.jvm"
|
||||
/**
|
||||
* Plugin published in https://plugins.gradle.org/
|
||||
*/
|
||||
const val android = "org.jetbrains.kotlin.android"
|
||||
|
||||
/**
|
||||
* Plugin published in https://plugins.gradle.org/
|
||||
*/
|
||||
const val parcelize = "kotlin-parcelize"
|
||||
|
||||
/**
|
||||
* Plugin published in https://plugins.gradle.org/
|
||||
*/
|
||||
const val annotationProcessor = "org.jetbrains.kotlin.kapt"
|
||||
|
||||
/**
|
||||
* Plugin published in https://plugins.gradle.org/
|
||||
*/
|
||||
const val serialization = "plugin.serialization"
|
||||
}
|
||||
|
||||
object JetBrains {
|
||||
const val serialization = "org.jetbrains.kotlin.plugin.serialization"
|
||||
}
|
||||
}
|
||||
}
|
42
buildSrc/src/main/java/Version.kt
Normal file
42
buildSrc/src/main/java/Version.kt
Normal file
@ -0,0 +1,42 @@
|
||||
import org.gradle.api.JavaVersion
|
||||
|
||||
object Version {
|
||||
|
||||
/**
|
||||
* Gradle is an open-source build automation tool focused on flexibility and performance.
|
||||
*
|
||||
* [Documentation](https://docs.gradle.org/current/userguide/userguide.html)
|
||||
*
|
||||
* [Github](https://github.com/gradle/gradle)
|
||||
*
|
||||
* [Apache 2.0 License](https://github.com/gradle/gradle/blob/master/LICENSE)
|
||||
*
|
||||
* [Changelog](https://gradle.org/releases/)
|
||||
*/
|
||||
const val agp = "8.7.1"
|
||||
|
||||
object Kotlin {
|
||||
|
||||
/**
|
||||
* [Documentation](https://kotlinlang.org/)
|
||||
*
|
||||
* [Source Code](https://github.com/JetBrains/kotlin/)
|
||||
*
|
||||
* [Apache 2.0 License](https://github.com/JetBrains/kotlin/blob/master/license/LICENSE.txt)
|
||||
*
|
||||
* [Changelog](https://kotlinlang.org/releases.html)
|
||||
*/
|
||||
const val language = "2.0.21"
|
||||
|
||||
val javaSource = JavaVersion.VERSION_11
|
||||
const val jvmTarget = "11"
|
||||
}
|
||||
|
||||
object Android {
|
||||
object Sdk {
|
||||
const val min = 24
|
||||
const val compile = 34
|
||||
const val target = 34
|
||||
}
|
||||
}
|
||||
}
|
11
gradle/README.md
Normal file
11
gradle/README.md
Normal file
@ -0,0 +1,11 @@
|
||||
# Файл для управления дистрибутивом Gradle
|
||||
|
||||
Данный репозиторий необходим для поддержки актуальности дистрибутива Gradle в проектах. Данный проект необходимо подключать подмодулём и использовать во всех проектах.
|
||||
|
||||
## Как обвновлять дистрибутив
|
||||
|
||||
Перед обновлением необходимо удостоверится, что версия самого Gradle установлена не ниже, чем в дистрибутиве. Сделать это можно [здесь](https://sicampus.ru/gitea/core/dependecies/src/branch/main/src/main/java/Version.kt#L16).
|
||||
|
||||
Процесс обновления выглядит следуюющим образом:
|
||||
1. В начале обновляем саму версию Gradle ([в этом репозитории](https://sicampus.ru/gitea/core/dependecies)).
|
||||
2. Обновлем ссылку на дестрибутив и проверяем совместимость.
|
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,7 +1,6 @@
|
||||
#Thu Jan 04 22:32:26 NOVT 2024
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
Loading…
x
Reference in New Issue
Block a user