Skip to content

Commit

Permalink
Merge pull request #80 from VictorKabata/clean-up
Browse files Browse the repository at this point in the history
Setup gradle version catalog
  • Loading branch information
VictorKabata committed Mar 20, 2023
2 parents 5899507 + 9fd1f9a commit aea89a5
Show file tree
Hide file tree
Showing 29 changed files with 340 additions and 516 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[*.{kt,kts}]
disabled_rules = import-ordering, experimental:argument-list-wrapping
disabled_rules = import-ordering, experimental:argument-list-wrapping,indent
insert_final_newline = true
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
*.iml
.gradle
/local.properties
.idea
.DS_Store
/build
*/build
/captures
.externalNativeBuild
.cxx
local.properties
local.properties
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<p align="center"><img src="assets/app_logo.png" alt="NotFlix" width="150px"></p>
<p align="center"><img src="assets/logo_notflix.png" alt="NotFlix" height="31px"></p>

<p align="center">
Expand Down
93 changes: 46 additions & 47 deletions app-android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
plugins {
id(Plugins.androidApplication)
kotlin(Plugins.android)

id(Plugins.googleService)
id(Plugins.appDistribution)
id(Plugins.crashlytics)
id(Plugins.performance)
alias(libs.plugins.android.application)
alias(libs.plugins.android.kotlin)
alias(libs.plugins.googleServices.plugin)
alias(libs.plugins.firebase.appDistribution.plugin)
alias(libs.plugins.firebase.crashlytics.plugin)
alias(libs.plugins.firebase.performance.plugin)
}

android {
compileSdk = AndroidSdk.compileSdkVersion
compileSdk = 33

defaultConfig {
applicationId = AndroidSdk.applicationId
applicationId = "com.vickikbt.notflix"

minSdk = AndroidSdk.minSdkVersion
targetSdk = AndroidSdk.targetSdkVersion
versionCode = AndroidSdk.versionCode
versionName = AndroidSdk.versionName
minSdk = 21
targetSdk = compileSdk
versionCode = 1
versionName = "1.0.0"

testInstrumentationRunner = AndroidSdk.testInstrumentationRunner
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
Expand Down Expand Up @@ -55,60 +54,60 @@ android {
}

dependencies {
api(project(BuildModules.shared))
api(project(":shared"))

implementation(AndroidDependencies.androidCore)
implementation(libs.androidX.core)

implementation(AndroidDependencies.material)
implementation(libs.material)

implementation(AndroidDependencies.composeUI)
implementation(AndroidDependencies.composeMaterial)
implementation(AndroidDependencies.composeTooling)
implementation(AndroidDependencies.composeRuntime)
implementation(AndroidDependencies.composeUtil)
implementation(AndroidDependencies.composeActivity)
implementation(libs.compose.ui)
implementation(libs.compose.material)
implementation(libs.compose.tooling)
implementation(libs.compose.runtime)
implementation(libs.compose.util)
implementation(libs.compose.activity)

implementation(AndroidDependencies.accompanistPager)
implementation(AndroidDependencies.accompanistInsets)
implementation(AndroidDependencies.accompanistAnimation)
implementation(AndroidDependencies.accompanistSystemUIController)
implementation(AndroidDependencies.accompanistMaterialPlaceHolder)
implementation(AndroidDependencies.accompanistPagerIndicator)
implementation(libs.accompanist.pager)
implementation(libs.accompanist.insets)
implementation(libs.accompanist.animation)
implementation(libs.accompanist.systemUIController)
implementation(libs.accompanist.materialPlaceHolder)
implementation(libs.accompanist.pagerIndicator)

implementation(AndroidDependencies.lifecycleRuntime)
implementation(libs.lifecycle.runtime)

// Koin-Dependency injection
implementation(AndroidDependencies.koinAndroid)
implementation(AndroidDependencies.koinCompose)
implementation(libs.koin.android)
implementation(libs.koin.compose)

// Compose Navigation-Navigation between various screens
implementation(AndroidDependencies.composeNavigation)
implementation(libs.navigation.compose)

// Coil-Image Loader
implementation(AndroidDependencies.coil)
implementation(libs.coil)

// Palette-Used to extract color palette from images
implementation(AndroidDependencies.palette)
implementation(libs.palette)

// Gowtham Compose Rating Bar
implementation(AndroidDependencies.ratingBar)
implementation(libs.compose.ratingBar)

// Collapsing toolbar
implementation(AndroidDependencies.oneBoneToolbar)
implementation(libs.oneBoneToolbar)

// Leak Canary - Memory leaks
debugImplementation(AndroidDependencies.leakCanary)
debugImplementation(libs.leakCanary)

// Firebase
implementation(platform(AndroidDependencies.firebaseBOM))
implementation(AndroidDependencies.firebaseAnalytics)
implementation(AndroidDependencies.firebaseCrashlytics)
implementation(AndroidDependencies.firebasePerformance)
implementation(platform(libs.firebase.bom))
implementation(libs.firebase.analytics)
implementation(libs.firebase.crashlytics)
implementation(libs.firebase.performance)

testImplementation(AndroidDependencies.jUnit)
testImplementation(AndroidDependencies.googleTruth)
testImplementation(AndroidDependencies.coroutinesTest)
testImplementation(libs.jUnit)
testImplementation(libs.googleTruth)
testImplementation(libs.kotlinX.coroutines.test)

androidTestImplementation(AndroidDependencies.testRules)
androidTestImplementation(AndroidDependencies.testRunner)
androidTestImplementation(libs.test.rules)
androidTestImplementation(libs.test.runner)
}
1 change: 1 addition & 0 deletions app-android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package="com.vickikbt.notflix">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<application
android:name=".NotflixApplication"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import com.vickikbt.notflix.ui.components.appbars.AppBar
import com.vickikbt.notflix.ui.components.preferences.DialogPreferenceSelection
import com.vickikbt.notflix.ui.components.preferences.PreferencesGroup
import com.vickikbt.notflix.ui.components.preferences.TextPreference
import com.vickikbt.shared.data.cache.multiplatformsettings.PreferenceManager.Companion.IMAGE_QUALITY_KEY
import com.vickikbt.shared.data.cache.multiplatformsettings.PreferenceManager.Companion.LANGUAGE_KEY
import com.vickikbt.shared.data.cache.multiplatformsettings.PreferenceManager.Companion.THEME_KEY
import com.vickikbt.shared.domain.utils.Constants
import com.vickikbt.shared.domain.utils.Constants.KEY_IMAGE_QUALITY
import com.vickikbt.shared.domain.utils.Constants.KEY_LANGUAGE
import com.vickikbt.shared.domain.utils.Constants.KEY_THEME
import com.vickikbt.shared.presentation.presenters.SharedSettingsPresenter
import org.koin.androidx.compose.get

Expand Down Expand Up @@ -139,7 +139,7 @@ private fun ChangeTheme(
labels = stringArrayResource(id = R.array.theme_labels),
onNegativeClick = { showDialog.value = false }
) { theme ->
viewModel.savePreferenceSelection(key = THEME_KEY, selection = theme)
viewModel.savePreferenceSelection(key = KEY_THEME, selection = theme)
}
}

Expand All @@ -156,7 +156,7 @@ private fun ChangeLanguage(
labels = stringArrayResource(id = R.array.language_labels),
onNegativeClick = { showDialog.value = false }
) { language ->
viewModel.savePreferenceSelection(key = LANGUAGE_KEY, selection = language)
viewModel.savePreferenceSelection(key = KEY_LANGUAGE, selection = language)
}
}

Expand All @@ -174,7 +174,7 @@ private fun ChangeImageQuality(
onNegativeClick = { showDialog.value = false }
) { imageQuality ->
viewModel.savePreferenceSelection(
key = IMAGE_QUALITY_KEY,
key = KEY_IMAGE_QUALITY,
selection = imageQuality
)
}
Expand Down
14 changes: 3 additions & 11 deletions app-desktop/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
import org.jetbrains.compose.compose

plugins {
kotlin("jvm")
id("org.jetbrains.compose") version Versions.composeDesktop
}

repositories {
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
alias(libs.plugins.jvm)
alias(libs.plugins.compose.desktop.plugin)
}

dependencies {
implementation(project(BuildModules.shared))
implementation(project(":shared"))

implementation(compose.desktop.currentOs)
// implementation(DesktopDependencies.kamel)
}

compose.desktop {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import ui.components.preferences.PreferencesGroup
import com.vickikbt.shared.data.cache.multiplatformsettings.PreferenceManager
import com.vickikbt.shared.domain.utils.Constants.KEY_IMAGE_QUALITY
import com.vickikbt.shared.domain.utils.Constants.KEY_LANGUAGE
import com.vickikbt.shared.domain.utils.Constants.KEY_THEME
import com.vickikbt.shared.presentation.presenters.SharedSettingsPresenter
import koin
import ui.components.appBars.AppBar
import ui.components.preferences.DialogPreferenceSelection
import ui.components.preferences.PreferencesGroup
import ui.components.preferences.TextPreference
import ui.navigation.NavController

Expand Down Expand Up @@ -148,7 +150,7 @@ private fun ChangeTheme(
labels = listOf("Light Theme", "Dark Theme", "System Default"),
onNegativeClick = { showDialog.value = false }
) { theme ->
viewModel.savePreferenceSelection(key = PreferenceManager.THEME_KEY, selection = theme)
viewModel.savePreferenceSelection(key = KEY_THEME, selection = theme)
}
}

Expand All @@ -166,7 +168,7 @@ private fun ChangeLanguage(
onNegativeClick = { showDialog.value = false }
) { language ->
viewModel.savePreferenceSelection(
key = PreferenceManager.LANGUAGE_KEY,
key = KEY_LANGUAGE,
selection = language
)
}
Expand All @@ -186,7 +188,7 @@ private fun ChangeImageQuality(
onNegativeClick = { showDialog.value = false }
) { imageQuality ->
viewModel.savePreferenceSelection(
key = PreferenceManager.IMAGE_QUALITY_KEY,
key = KEY_IMAGE_QUALITY,
selection = imageQuality
)
}
Expand Down
53 changes: 23 additions & 30 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,40 +1,31 @@
buildscript {
repositories {
google()
mavenCentral()
maven("https://plugins.gradle.org/m2/")
}

dependencies {
classpath(Plugins.kotlin)
classpath(Plugins.gradle)
classpath(Plugins.kmpNativeCoroutines)
classpath(Plugins.googleServices)
classpath(Plugins.firebaseAppDistribution)
classpath(Plugins.firebaseCrashlytics)
classpath(Plugins.firebasePerformance)
}
}

plugins {
id(Plugins.ktLint) version Versions.ktLint
id(Plugins.detekt) version (Versions.detekt)
id(Plugins.kotlinxTestResource) version (Versions.kotlinxTestResources)
id(Plugins.gradleVersionUpdates) version (Versions.gradleVersionUpdate)
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.android.kotlin) apply false
alias(libs.plugins.multiplatform) apply false
alias(libs.plugins.jvm) apply false
alias(libs.plugins.nativeCocoapod) apply false

alias(libs.plugins.googleServices.plugin) apply false

alias(libs.plugins.firebase.appDistribution.plugin) apply false
alias(libs.plugins.firebase.crashlytics.plugin) apply false
alias(libs.plugins.firebase.performance.plugin) apply false

alias(libs.plugins.ktLint)
alias(libs.plugins.detekt)
alias(libs.plugins.gradleVersionUpdates)
alias(libs.plugins.kotlinX.testResources)
}

allprojects {

repositories {
google()
mavenCentral()
maven("https://jitpack.io")
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
maven(url = "https://jitpack.io")
}
}

subprojects {
apply(plugin = Plugins.ktLint)
apply(plugin = "org.jlleitschuh.gradle.ktlint")
ktlint {
debug.set(true)
verbose.set(true)
Expand All @@ -47,14 +38,16 @@ subprojects {
include("**/kotlin/**")
}
}
}

apply(plugin = Plugins.detekt)
subprojects {
apply(plugin = "io.gitlab.arturbosch.detekt")
detekt {
parallel = true
config = files("${project.rootDir}/config/detekt/detekt.yml")
}

apply(plugin = Plugins.kotlinxTestResource)
apply(plugin = "com.goncalossilva.resources")

tasks.withType<com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask> {
checkForGradleUpdate = true
Expand Down
7 changes: 0 additions & 7 deletions buildSrc/build.gradle.kts

This file was deleted.

Loading

0 comments on commit aea89a5

Please sign in to comment.