Skip to content

Commit

Permalink
Merge pull request mutualmobile#51 from mutualmobile/ab/agp8-migration
Browse files Browse the repository at this point in the history
Migration to AGP 8.0
  • Loading branch information
aditya-bhawsar-mm committed May 12, 2023
2 parents c97ee0a + 27f8611 commit 6b36615
Show file tree
Hide file tree
Showing 23 changed files with 52 additions and 49 deletions.
8 changes: 6 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ plugins {
id(BuildPlugins.ANDROID_APPLICATION_PLUGIN)
id(BuildPlugins.KOTLIN_ANDROID_PLUGIN)
id(BuildPlugins.KOTLIN_PARCELABLE_PLUGIN)
id(BuildPlugins.KOTLIN_KAPT)
id(BuildPlugins.DAGGER_HILT)
id(BuildPlugins.KOTLIN_KAPT)
id(BuildPlugins.ktLint)
}

// def preDexEnabled = "true" == System.getProperty("pre-dex", "true")

android {
namespace = "com.mutualmobile.praxis"
compileSdk = (AppVersions.COMPILE_SDK)

defaultConfig {
Expand Down Expand Up @@ -81,6 +82,10 @@ android {
compose = true
}

hilt {
enableAggregatingTask = true
}

composeOptions {
kotlinCompilerExtensionVersion = Lib.Androidx.composeVersion
}
Expand Down Expand Up @@ -142,7 +147,6 @@ dependencies {
/*DI*/
api(Lib.Di.hilt)
api(Lib.Di.hiltNavigationCompose)
api(Lib.Di.viewmodel)
kapt(Lib.Di.hiltCompiler)
kapt(Lib.Di.hiltAndroidCompiler)

Expand Down
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http:https://schemas.android.com/apk/res/android"
xmlns:tools="http:https://schemas.android.com/tools"
package="com.mutualmobile.praxis">
xmlns:tools="http:https://schemas.android.com/tools">

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

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
classpath(BuildPlugins.KOTLIN_GRADLE_PLUGIN)
classpath(kotlin("serialization", version = Lib.Kotlin.KOTLIN_VERSION))
classpath(BuildPlugins.KTLINT_GRADLE_PLUGIN)
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/AppVersions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ object AppVersions {
const val versionCode = versionMajor * 10000 + versionMinor * 100 + versionPatch
const val versionName = "$versionMajor.$versionMinor.$versionPatch"

const val COMPILE_SDK = 31
const val COMPILE_SDK = 32
const val MIN_SDK = 21
const val TARGET_SDK = 31
const val TARGET_SDK = 32
const val APPLICATION_ID = "com.mutualmobile.praxis"
}
13 changes: 6 additions & 7 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/** This file contains versions of all the dependencies used in the module */

object BuildPlugins {
private const val TOOLS_BUILD = "7.1.1"
private const val TOOLS_BUILD = "8.0.1"
private const val KT_LINT = "9.2.1"
private const val SAFE_ARGS = "2.3.5"
private const val SAFE_ARGS = "2.5.0"

const val TOOLS_BUILD_GRADLE = "com.android.tools.build:gradle:${TOOLS_BUILD}"
const val KTLINT_GRADLE_PLUGIN = "org.jlleitschuh.gradle:ktlint-gradle:${KT_LINT}"
const val SAFE_ARGS_GRADLE_PLUGIN =
"androidx.navigation:navigation-safe-args-gradle-plugin:${SAFE_ARGS}"
const val DAGGER_HILT_PLUGIN = "com.google.dagger:hilt-android-gradle-plugin:2.38.1"
const val DAGGER_HILT_PLUGIN = "com.google.dagger:hilt-android-gradle-plugin:2.42"
const val KOTLIN_GRADLE_PLUGIN = "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
const val ANDROID_APPLICATION_PLUGIN = "com.android.application"
const val ANDROID_LIBRARY_PLUGIN = "com.android.library"
Expand All @@ -23,7 +23,7 @@ object BuildPlugins {

object Lib {
object Kotlin {
const val KOTLIN_VERSION = "1.6.0"
const val KOTLIN_VERSION = "1.7.0"
private const val KTX_CORE_VERSION = "1.2.0"
const val KT_STD = "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${KOTLIN_VERSION}"
private const val KTX_CORE = "androidx.core:core-ktx:${KTX_CORE_VERSION}"
Expand All @@ -47,7 +47,7 @@ object Lib {

object Androidx {
// Compose
const val composeVersion = "1.1.0"
const val composeVersion = "1.2.0"
private const val SPLASH_SCREEN_API = "androidx.core:core-splashscreen:1.0.0-beta01"
private const val APP_COMPAT = "androidx.appcompat:appcompat:1.3.0-beta01"

Expand Down Expand Up @@ -92,11 +92,10 @@ object Lib {
}

object Di {
private const val DAGGER_VERSION = "2.40.5"
private const val DAGGER_VERSION = "2.42"
const val hilt = "com.google.dagger:hilt-android:${DAGGER_VERSION}"
const val hiltAndroidCompiler = "com.google.dagger:hilt-android-compiler:${DAGGER_VERSION}"

const val viewmodel = "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03"
const val hiltCompiler = "androidx.hilt:hilt-compiler:1.0.0"
const val hiltNavigationCompose = "androidx.hilt:hilt-navigation-compose:1.0.0-rc01"
}
Expand Down
4 changes: 2 additions & 2 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ plugins {
id(BuildPlugins.ANDROID_LIBRARY_PLUGIN)
id(BuildPlugins.KOTLIN_ANDROID_PLUGIN)
id(BuildPlugins.KOTLIN_PARCELABLE_PLUGIN)
id(BuildPlugins.KOTLIN_KAPT)
id(BuildPlugins.DAGGER_HILT)
id(BuildPlugins.KOTLIN_KAPT)
id(BuildPlugins.ktLint)
}

android {
compileSdk = AppVersions.COMPILE_SDK
namespace = "com.mutualmobile.praxis.common"

defaultConfig {
minSdk = (AppVersions.MIN_SDK)
Expand Down Expand Up @@ -43,7 +44,6 @@ dependencies {
/*DI*/
implementation(Lib.Di.hilt)
implementation(Lib.Di.hiltNavigationCompose)
implementation(Lib.Di.viewmodel)
kapt(Lib.Di.hiltCompiler)
kapt(Lib.Di.hiltAndroidCompiler)

Expand Down
4 changes: 2 additions & 2 deletions commonui/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
plugins {
id(BuildPlugins.ANDROID_LIBRARY_PLUGIN)
id(BuildPlugins.DAGGER_HILT)
id(BuildPlugins.KOTLIN_ANDROID_PLUGIN)
id(BuildPlugins.KOTLIN_PARCELABLE_PLUGIN)
id(BuildPlugins.KOTLIN_KAPT)
id(BuildPlugins.DAGGER_HILT)
id(BuildPlugins.ktLint)
}

android {
compileSdk = AppVersions.COMPILE_SDK
namespace = "com.mutualmobile.praxis.commonui"

defaultConfig {
minSdk = (AppVersions.MIN_SDK)
Expand Down Expand Up @@ -55,7 +56,6 @@ dependencies {
/*DI*/
implementation(Lib.Di.hilt)
implementation(Lib.Di.hiltNavigationCompose)
implementation(Lib.Di.viewmodel)
kapt(Lib.Di.hiltCompiler)
kapt(Lib.Di.hiltAndroidCompiler)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private fun chatScreenModifier(
// this moves the chat view left/right
val summedMain = Offset(x = offsetX.targetValue + dragAmount, y = 0f)
val newDragValueMain = Offset(x = summedMain.x.coerceIn(0f, requiredOffset), y = 0f)
change.consumePositionChange()
change.consume()
coroutineScope.launch {
offsetX.animateTo(newDragValueMain.x, animationSpec = tween(50))
}
Expand Down Expand Up @@ -232,7 +232,7 @@ private fun mainAnimateOffset(
if (offsetX.targetValue <= 0f) {
val summedChat = Offset(x = chatViewOffX.targetValue + dragAmount, y = 0f)
val chatNewDragValueMain = Offset(x = summedChat.x.coerceIn(0f, chatScreenOffset), y = 0f)
change.consumePositionChange()
change.consume()
coroutineScope.launch {
chatViewOffX.animateTo(chatNewDragValueMain.x, animationSpec = tween(50))
}
Expand All @@ -241,7 +241,7 @@ private fun mainAnimateOffset(
// this moved the main view left/right
val summedMain = Offset(x = offsetX.targetValue + dragAmount, y = 0f)
val newDragValueMain = Offset(x = summedMain.x.coerceIn(0f, mainDragOffset), y = 0f)
change.consumePositionChange()
change.consume()
coroutineScope.launch {
offsetX.animateTo(newDragValueMain.x, animationSpec = tween(50))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import androidx.compose.ui.unit.dp
import com.mutualmobile.praxis.commonui.theme.PraxisColorProvider
import com.mutualmobile.praxis.commonui.theme.PraxisTypography

@OptIn(ExperimentalMaterialApi::class)
@Composable
fun PraxisListItem(
icon: ImageVector,
Expand Down
4 changes: 2 additions & 2 deletions data/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
plugins {
id(BuildPlugins.ANDROID_LIBRARY_PLUGIN)
id(BuildPlugins.KOTLIN_ANDROID_PLUGIN)
id(BuildPlugins.KOTLIN_KAPT)
id(BuildPlugins.DAGGER_HILT)
id(BuildPlugins.KOTLIN_KAPT)
}

android {
compileSdk = AppVersions.COMPILE_SDK
namespace = "com.mutualmobile.praxis.data"

defaultConfig {
minSdk = (AppVersions.MIN_SDK)
Expand Down Expand Up @@ -37,7 +38,6 @@ dependencies {
/*DI*/
implementation(Lib.Di.hilt)
implementation(Lib.Di.hiltNavigationCompose)
implementation(Lib.Di.viewmodel)
kapt(Lib.Di.hiltCompiler)
kapt(Lib.Di.hiltAndroidCompiler)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import androidx.room.Database
import androidx.room.RoomDatabase
import com.mutualmobile.praxis.data.local.model.SampleEntity

@Database(entities = [SampleEntity::class], version = 1)
@Database(entities = [SampleEntity::class], version = 1, exportSchema = false)
abstract class AppDatabase : RoomDatabase()

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import kotlin.coroutines.cancellation.CancellationException
class FetchRandomPhotoUseCase(private val photoFetchRepository: PhotoFetchRepository) :
BaseUseCase< StreamingFile,String> {

override fun performStreaming(input: String?): Flow<StreamingFile> {
override fun performStreaming(params: String?): Flow<StreamingFile> {
return callbackFlow {
val listener = photoFetchListener()
photoFetchRepository.setListener(listener)
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m
android.defaults.buildfeatures.buildconfig=true
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http:https://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
Expand Down
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Jan 27 08:55:19 IST 2022
#Fri May 12 13:29:15 IST 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\:https://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\:https://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 1 addition & 2 deletions navigator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {

android {
compileSdk = AppVersions.COMPILE_SDK

namespace = "com.mutualmobile.praxis.navigator"
defaultConfig {
minSdk = (AppVersions.MIN_SDK)
targetSdk = (AppVersions.TARGET_SDK)
Expand Down Expand Up @@ -54,7 +54,6 @@ dependencies {
/*DI*/
implementation(Lib.Di.hilt)
implementation(Lib.Di.hiltNavigationCompose)
implementation(Lib.Di.viewmodel)
kapt(Lib.Di.hiltCompiler)
kapt(Lib.Di.hiltAndroidCompiler)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ abstract class ComposeNavigator : Navigator() {
is ComposeNavigationCommand.NavigateUpWithResult<*> -> {
navUpWithResult(navigationCommand)
}
else -> {
throw RuntimeException("can't handle this with ComposeNavigator")
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions ui-authentication/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
plugins {
id(BuildPlugins.ANDROID_LIBRARY_PLUGIN)
id(BuildPlugins.KOTLIN_ANDROID_PLUGIN)
id(BuildPlugins.KOTLIN_KAPT)
id(BuildPlugins.DAGGER_HILT)
id(BuildPlugins.KOTLIN_PARCELABLE_PLUGIN)
id("org.jlleitschuh.gradle.ktlint")
id(BuildPlugins.KOTLIN_KAPT)
id(BuildPlugins.ktLint)
}

android {
compileSdk = AppVersions.COMPILE_SDK
namespace = "com.praxis.feat.authentication"

defaultConfig {
minSdk = (AppVersions.MIN_SDK)
Expand Down Expand Up @@ -74,7 +75,6 @@ dependencies {
/*DI*/
implementation(Lib.Di.hilt)
implementation(Lib.Di.hiltNavigationCompose)
implementation(Lib.Di.viewmodel)
kapt(Lib.Di.hiltCompiler)
kapt(Lib.Di.hiltAndroidCompiler)

Expand Down
2 changes: 1 addition & 1 deletion ui-authentication/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http:https://schemas.android.com/apk/res/android"
package="com.praxis.feat.authentication">
>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import com.google.accompanist.insets.statusBarsPadding
import com.mutualmobile.praxis.commonui.material.DefaultSnackbar
import com.mutualmobile.praxis.commonui.material.PraxisSurfaceAppBar
import com.mutualmobile.praxis.commonui.theme.*
import com.praxis.feat.authentication.R
import com.mutualmobile.praxis.commonui.R
import com.praxis.feat.authentication.vm.AuthVM
import com.praxis.feat.authentication.vm.streamProgress
import com.praxis.feat.authentication.vm.uri
Expand Down Expand Up @@ -256,7 +256,7 @@ private fun PasswordTF(authVM: AuthVM, focusRequester: FocusRequester) {
val keyboardController = LocalSoftwareKeyboardController.current

TextField(
value = credentials.password ?: "",
value = credentials.password,
onValueChange = {
authVM.credentials.value = credentials.copy(password = it)
},
Expand Down Expand Up @@ -293,7 +293,7 @@ private fun EmailTF(authVM: AuthVM, focusRequester: FocusRequester) {
val credentials by authVM.credentials.collectAsState()

TextField(
value = credentials.email ?: "",
value = credentials.email,
onValueChange = {
authVM.credentials.value = credentials.copy(email = it)
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.praxis.feat.authentication.ui

import android.annotation.SuppressLint
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.*
import androidx.compose.material.*
Expand All @@ -15,11 +16,11 @@ import com.google.accompanist.insets.navigationBarsPadding
import com.google.accompanist.insets.statusBarsPadding
import com.mutualmobile.praxis.commonui.material.PraxisSurfaceAppBar
import com.mutualmobile.praxis.commonui.theme.*
import com.praxis.feat.authentication.R
import com.mutualmobile.praxis.commonui.R
import com.praxis.feat.authentication.vm.ForgotPasswordVM

@Composable
fun ForgotPasswordUI(forgotPasswordVM: ForgotPasswordVM = hiltViewModel()){
fun ForgotPasswordUI(forgotPasswordVM: ForgotPasswordVM = hiltViewModel()) {
PraxisTheme() {
Scaffold(
backgroundColor = PraxisColorProvider.colors.uiBackground,
Expand Down
Loading

0 comments on commit 6b36615

Please sign in to comment.