Skip to content

Commit

Permalink
Merge branch 'CORE/update/FCAN-2021_update-link-router-libraries' int…
Browse files Browse the repository at this point in the history
…o 'main'

FCAN-2021 | Update (CORE) : update libraries

Closes FCAN-2021

See merge request veepee/offerdiscovery/products/front-mobile/android/link-router!30
  • Loading branch information
Julio Cesar Bueno Cotta committed Oct 9, 2023
2 parents ff0cf80 + b38cd4c commit 4572d91
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 40 deletions.
4 changes: 2 additions & 2 deletions Sample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ plugins {

android {
namespace "com.veepee.sample"

compileSdk 34
defaultConfig {
applicationId "com.veepee.sample"
minSdkVersion 21
targetSdkVersion 33
compileSdk 33

versionCode 1
versionName "1.0"

Expand Down
4 changes: 2 additions & 2 deletions Sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.8.20"
ext.kotlin_version = "1.9.10"
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:8.0.1"
classpath "com.android.tools.build:gradle:8.1.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
Expand Down
4 changes: 2 additions & 2 deletions Sample/feature_a/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ plugins {

android {
namespace "com.veepee.feature.a"
compileSdk 34
defaultConfig {
minSdkVersion 21
targetSdkVersion 33
compileSdk 33

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand All @@ -32,7 +32,7 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion '1.4.6'
kotlinCompilerExtensionVersion '1.5.3'
}
}

Expand Down
5 changes: 2 additions & 3 deletions Sample/feature_b/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ plugins {

android {
namespace "com.veepee.feature.b"

compileSdk 34
defaultConfig {
minSdkVersion 21
targetSdkVersion 33
compileSdk 33

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand All @@ -33,7 +32,7 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion '1.4.6'
kotlinCompilerExtensionVersion '1.5.3'
}
}

Expand Down
2 changes: 1 addition & 1 deletion Sample/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 1 addition & 2 deletions Sample/login/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ plugins {

android {
namespace "com.veepee.feature.login"

compileSdk 34
defaultConfig {
minSdkVersion 21
targetSdkVersion 33
compileSdk 33

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand Down
5 changes: 2 additions & 3 deletions Sample/routes/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ plugins {

android {
namespace "com.veepee.routes"

compileSdk 34
defaultConfig {
minSdkVersion 21
targetSdkVersion 33
compileSdk 33

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand Down Expand Up @@ -38,5 +37,5 @@ dependencies {
implementation libs.androidx.appcompat
implementation libs.material

api 'com.veepee.vpcore.link-router:link-router:0.3.0'
api 'com.veepee.vpcore.link-router:link-router:0.5.2'
}
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.8.20"
ext.kotlin_version = "1.9.10"
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:8.0.1"
classpath "com.android.tools.build:gradle:8.1.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
Expand Down
6 changes: 6 additions & 0 deletions changelog/next/CORE_FCAN-2021_update-link-router-libraries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: update libraries
url: https://jira.vptech.eu/browse/FCAN-2021
author: Julio Cesar Bueno Cotta
---
Closes FCAN-2021
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ plugins {

android {
namespace = "com.veepee.vpcore.link.route"
compileSdk 34
defaultConfig {
minSdkVersion 21
targetSdkVersion 33
compileSdk 33
aarMetadata {
minCompileSdk = 21
}
Expand All @@ -37,7 +37,7 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion '1.4.6'
kotlinCompilerExtensionVersion '1.5.3'
}

testOptions {
Expand Down
31 changes: 17 additions & 14 deletions library/src/main/java/com/veepee/vpcore/route/BundleExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,44 @@ package com.veepee.vpcore.route
import android.app.Activity
import android.content.Intent
import android.os.Bundle
import androidx.core.content.IntentCompat
import androidx.core.os.BundleCompat
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.LifecycleOwner
import com.veepee.vpcore.route.link.Parameter
import com.veepee.vpcore.route.link.ParcelableParameter

internal val LINK_PARAMETER = "${Parameter::class.java.name}.LINK_PARAMETER"
internal val LINK_PARAMETER_REQUEST_KEY = "${LINK_PARAMETER}_REQUEST_KEY"
val LINK_PARAMETER = "${Parameter::class.java.name}.LINK_PARAMETER"
val LINK_PARAMETER_REQUEST_KEY = "${LINK_PARAMETER}_REQUEST_KEY"

fun <T : ParcelableParameter> Activity.requireLinkParameter(): T {
inline fun <reified T : ParcelableParameter> Activity.requireLinkParameter(): T {
return intent.requireLinkParameter()
}

fun <T : ParcelableParameter> Intent.requireLinkParameter(): T {
inline fun <reified T : ParcelableParameter> Intent.requireLinkParameter(): T {
return getLinkParameter()!!
}

fun <T : ParcelableParameter> Intent.getLinkParameter(): T? {
return getParcelableExtra(LINK_PARAMETER)
inline fun <reified T : ParcelableParameter> Intent.getLinkParameter(): T? {
return IntentCompat.getParcelableExtra(this, LINK_PARAMETER, T::class.java)
}

fun <T : ParcelableParameter> Bundle.requireLinkParameter(): T {
inline fun <reified T : ParcelableParameter> Bundle.requireLinkParameter(): T {
return getLinkParameter()!!
}

fun <T : ParcelableParameter> Bundle.getLinkParameter(): T? {
return getParcelable(LINK_PARAMETER)
inline fun <reified T : ParcelableParameter> Bundle.getLinkParameter(): T? {
return BundleCompat.getParcelable(this, LINK_PARAMETER, T::class.java)
}

fun <T : ParcelableParameter> Fragment.requireLinkParameter(): T {
inline fun <reified T : ParcelableParameter> Fragment.requireLinkParameter(): T {
return getLinkParameter()!!
}

fun <T : ParcelableParameter> Fragment.getLinkParameter(): T? {
return arguments?.getParcelable(LINK_PARAMETER)
inline fun <reified T : ParcelableParameter> Fragment.getLinkParameter(): T? {
val args = arguments ?: return null
return BundleCompat.getParcelable(args, LINK_PARAMETER, T::class.java)
}

fun FragmentManager.setLinkParameterResult(
Expand All @@ -62,10 +65,10 @@ fun FragmentManager.setLinkParameterResult(
setFragmentResult(requestKey, parameter.asBundle())
}

fun <T : ParcelableParameter> FragmentManager.setLinkParameterResultListener(
inline fun <reified T : ParcelableParameter> FragmentManager.setLinkParameterResultListener(
requestKey: String = LINK_PARAMETER_REQUEST_KEY,
lifecycleOwner: LifecycleOwner,
listener: (T) -> Unit
crossinline listener: (T) -> Unit
) {
setFragmentResultListener(
requestKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
*/
package com.veepee.vpcore.route.link.compose

internal class NoComposableNameMapperException(composableLink: ComposableLink<ComposableName, out ComposableEvent>) :
internal class NoComposableNameMapperException(composableLink: ComposableLink<ComposableName, ComposableEvent>) :
IllegalArgumentException("$composableLink has no registered ComposableNameMapper registered for it.")
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ import com.veepee.vpcore.route.link.compose.ComposableNameMapper
import com.veepee.vpcore.route.link.interceptor.LinkInterceptor

interface ComposableLinkInterceptor :
LinkInterceptor<ComposableNameMapper<out ComposableName>, ComposableLink<ComposableName, out ComposableEvent>>
LinkInterceptor<ComposableNameMapper<out ComposableName>, ComposableLink<ComposableName, ComposableEvent>>
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ internal class FragmentLinkRouterImpl(
if (newFragmentLink != fragmentLink) {
return fragmentFor(newFragmentLink)
}
val fragment = mapper.map(fragmentLink).newInstance()
val fragment = mapper.map(fragmentLink).getDeclaredConstructor().newInstance()
return fragment.apply {
arguments = Bundle().setLinkParameter(fragmentLink.parameter)
}
Expand Down
8 changes: 4 additions & 4 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ include ':library'
dependencyResolutionManagement {
versionCatalogs {
libs {
def kotlinVersion = version('koltin', "1.8.20")
def kotlinVersion = version('koltin', "1.9.10")
library('lang.kotlin', 'org.jetbrains.kotlin', 'kotlin-stdlib').versionRef(kotlinVersion)
library('androidx.core', 'androidx.core', 'core').versionRef(version('core', '1.10.0'))
library('androidx.fragment', 'androidx.fragment', 'fragment').versionRef(version('fragment', '1.5.7'))
library('androidx.core', 'androidx.core', 'core').versionRef(version('core', '1.12.0'))
library('androidx.fragment', 'androidx.fragment', 'fragment').versionRef(version('fragment', '1.6.1'))
library('material.components', 'com.google.android.material', 'material').versionRef(version('material', '1.8.0'))
library('test.junit', 'junit', 'junit').versionRef(version('junit', '4.13.1'))
library('test.androidx.test.core', 'androidx.test', 'core-ktx').versionRef(version('core-test', '1.5.0'))
library('test.robolectric', 'org.robolectric', 'robolectric').versionRef(version('robolectric', '4.10.1'))
library('test.mockito.inline', 'org.mockito', 'mockito-inline').versionRef(version('mockito-inline', '3.11.2'))
library('test.mockito.kotlin', 'org.mockito.kotlin', 'mockito-kotlin').versionRef(version('mockito-kotlin', '3.2.0'))

def composeVersion = version('compose', '1.4.2')
def composeVersion = version('compose', '1.5.3')
library('androidx.compose.foundation', 'androidx.compose.foundation', 'foundation').versionRef(composeVersion)
library('androidx.compose.ui.test', 'androidx.compose.ui', 'ui-test-junit4').versionRef(composeVersion)
library('androidx.compose.ui.test.manifest', 'androidx.compose.ui', 'ui-test-manifest').versionRef(composeVersion)
Expand Down

0 comments on commit 4572d91

Please sign in to comment.