From 43e4b47e8e205e2f8f1d87455bbfc712f41eaf73 Mon Sep 17 00:00:00 2001 From: Michael Angelo Reyes Date: Fri, 29 Dec 2023 23:28:09 +0800 Subject: [PATCH 1/3] [20331] *Update TimetableFragment and TimetableViewModel to handle TimetableEntry item click logic to TimetableViewModel itself and avoid doing it to the parent fragment using TripPreviewPagerListener.onTimetableEntryClicked. *Introduced TRIPKIT_UI_VERSION buildConfigField for backwards compatibility flag in order to have a refactored version but still able to support the old approach that's being used by the old SDK users, e.g. TripGo. *Moved logic, data fetching from repositories to viewModel on TKUIHomeViewControllerFragment --- TripKitAndroid/build.gradle | 2 ++ dependencies.gradle | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/TripKitAndroid/build.gradle b/TripKitAndroid/build.gradle index 86a1fbfd..c91821cb 100644 --- a/TripKitAndroid/build.gradle +++ b/TripKitAndroid/build.gradle @@ -111,6 +111,8 @@ dependencies { implementation libs.map_extension implementation libs.location + testImplementation libs.mockk + debugApi project(':CommonCoreLegacy') releaseApi project(':CommonCoreLegacy') debugApi project(':TripKitDomain') diff --git a/dependencies.gradle b/dependencies.gradle index 03ed83c1..48c5a5ac 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -33,6 +33,8 @@ versions.javaxAnnotation = "1.3.2" versions.instabug = '11.11.0' versions.paging = "3.0.0" versions.viewPager2 = "1.0.0" +versions.mockk = "1.13.8" +versions.archCore = "2.1.0" ext.versions = versions @@ -49,6 +51,7 @@ libs.jodaTimeAndroid = "net.danlew:android.joda:2.10.6" libs.androidJob = "com.evernote:android-job:1.2.6" libs.javaxAnnotation = "javax.annotation:javax.annotation-api:$versions.javaxAnnotation" libs.instabug = "com.instabug.library:instabug:$versions.instabug" +libs.mockk = "io.mockk:mockk:$versions.mockk" // Support Library package libs.supportAnnotations = "androidx.annotation:annotation:$versions.androidxVersion" @@ -154,4 +157,6 @@ libs.viewPager2 = "androidx.viewpager2:viewpager2:$versions.viewPager2" libs.volley = "com.android.volley:volley:$versions.volley" libs.jetBrainsAnnotation = "org.jetbrains:annotations-java5:$versions.jetBrainsJava5" +libs.archCoreTesting = "androidx.arch.core:core-testing:$versions.archCore" + ext.libs = libs From 54bee652c6d67d596862f61907e4de479b712cd1 Mon Sep 17 00:00:00 2001 From: Michael Angelo Reyes Date: Wed, 3 Jan 2024 10:46:26 +0800 Subject: [PATCH 2/3] [20331] *Update compileOptions and kotlinOptions Java version to 17 and eliminate inconsistencies. *Upgrade android gradle plugin to 8.0.2 and gradle-wrapper.properties to 8.2. *Update gradle.properties with new configs required by the update. *Update build.gradle(s) to add namespace as required by latest android gradle and remove package names in AndroidManifest.xml. *Remove deprecated kotlin-android-extensions and add new kotlin-parcelize and remove androidExtensions experimental used for the old kotlin parcelize in kotlin-android-extensions. *Update gradle to replace classifier that was deprecated when gradle plugin is updated, with archiveClassifier. *Update kotlin from 1.6.20 to 1.8.20 and update codes affected or caused errors after the update *Add and setup MockK *Add MockKTest.kt as base class for test class using MockK *Add TKUIHomeViewControllerViewModelTest.kt --- CommonCoreLegacy/build.gradle | 18 ++++++++---------- CommonCoreLegacy/src/main/AndroidManifest.xml | 2 +- .../tripkit/regionrouting/data/Direction.kt | 2 +- TripKitAndroid/build.gradle | 19 +++++++++---------- TripKitAndroid/src/main/AndroidManifest.xml | 3 +-- .../src/main/java/com/skedgo/rxtry/Try.kt | 2 +- .../com/skedgo/tripkit/RoutingUserError.kt | 2 +- TripKitData/build.gradle | 14 +++++++++----- TripKitData/src/main/AndroidManifest.xml | 2 +- .../locations/bikepods/BikePodEntity.kt | 2 +- .../carparks/CarParkLocationEntity.kt | 6 +++--- .../locations/carpods/CarPodEntity.kt | 2 +- .../FreeFloatingLocationEntity.kt | 2 +- .../onstreetparking/OnStreetParkingEntity.kt | 2 +- .../data/database/stops/StopLocationEntity.kt | 2 +- TripKitDomain/build.gradle | 4 ++-- TripKitDomainLegacy/build.gradle | 15 +++++++++++++-- TripKitSamples/build.gradle | 5 +++-- ValidBookingCountData/build.gradle | 15 +++++++++++++-- ValidBookingCountDomain/build.gradle | 8 ++++---- build.gradle | 4 ++-- dependencies.gradle | 6 +++--- route-persistence/build.gradle | 11 +++++++++++ rxlifecyclecomponents/build.gradle | 18 +++++++++++++++--- sqliteutils/build.gradle | 8 ++++++-- trip-kit-booking-ui/build.gradle | 17 +++++++++++++++-- trip-kit-booking/build.gradle | 14 +++++++++----- 27 files changed, 136 insertions(+), 69 deletions(-) diff --git a/CommonCoreLegacy/build.gradle b/CommonCoreLegacy/build.gradle index 5ee83ecd..72f71b47 100644 --- a/CommonCoreLegacy/build.gradle +++ b/CommonCoreLegacy/build.gradle @@ -3,16 +3,14 @@ apply plugin: "com.android.library" // See https://jitpack.io/docs/ANDROID/. apply plugin: "kotlin-android" apply plugin: "kotlin-kapt" -apply plugin: 'kotlin-android-extensions' -apply plugin: "org.jetbrains.kotlin.android.extensions" apply plugin: 'maven-publish' +apply plugin: 'kotlin-parcelize' android { - compileSdkVersion versions.compileSdkVersion - androidExtensions { - experimental = true - } + namespace 'com.skedgo.tripkit.common' + + compileSdkVersion versions.compileSdkVersion defaultConfig { minSdkVersion versions.proMinSdkVersion @@ -38,8 +36,8 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } publishing { @@ -89,7 +87,7 @@ dependencies { // build a jar with source files task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier.set('sources') } task javadoc(type: Javadoc) { @@ -104,7 +102,7 @@ task javadoc(type: Javadoc) { // build a jar with javadoc task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier.set('javadoc') from javadoc.destinationDir } diff --git a/CommonCoreLegacy/src/main/AndroidManifest.xml b/CommonCoreLegacy/src/main/AndroidManifest.xml index 0e5d9751..a53ee105 100644 --- a/CommonCoreLegacy/src/main/AndroidManifest.xml +++ b/CommonCoreLegacy/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ - diff --git a/CommonCoreLegacy/src/main/java/com/skedgo/tripkit/regionrouting/data/Direction.kt b/CommonCoreLegacy/src/main/java/com/skedgo/tripkit/regionrouting/data/Direction.kt index 15e54136..0903c2c9 100644 --- a/CommonCoreLegacy/src/main/java/com/skedgo/tripkit/regionrouting/data/Direction.kt +++ b/CommonCoreLegacy/src/main/java/com/skedgo/tripkit/regionrouting/data/Direction.kt @@ -6,7 +6,7 @@ import com.skedgo.tripkit.common.util.KParcelable import com.skedgo.tripkit.common.util.parcelableCreator import com.skedgo.tripkit.routing.ModeInfo import com.skedgo.tripkit.routing.ServiceColor -import kotlinx.android.parcel.Parcelize +import kotlinx.parcelize.Parcelize data class Direction( val encodedShape: String?, diff --git a/TripKitAndroid/build.gradle b/TripKitAndroid/build.gradle index c91821cb..e501081f 100644 --- a/TripKitAndroid/build.gradle +++ b/TripKitAndroid/build.gradle @@ -5,14 +5,13 @@ apply plugin: 'maven-publish' apply plugin: "kotlin-android" apply plugin: "kotlin-kapt" apply plugin: 'org.jetbrains.dokka' -apply plugin: 'org.jetbrains.kotlin.android.extensions' +apply plugin: 'kotlin-parcelize' android { - compileSdkVersion versions.compileSdkVersion - androidExtensions { - experimental = true - } + namespace 'com.skedgo.tripkit' + + compileSdkVersion versions.compileSdkVersion defaultConfig { minSdkVersion versions.proMinSdkVersion @@ -28,11 +27,11 @@ android { compileOptions { coreLibraryDesugaringEnabled true - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() + jvmTarget = JavaVersion.VERSION_17.toString() } testOptions { unitTests { @@ -132,7 +131,7 @@ dependencies { // build a jar with source files task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier.set('sources') } task javadoc(type: Javadoc) { @@ -147,7 +146,7 @@ task javadoc(type: Javadoc) { // build a jar with javadoc task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier.set('javadoc') from javadoc.destinationDir } diff --git a/TripKitAndroid/src/main/AndroidManifest.xml b/TripKitAndroid/src/main/AndroidManifest.xml index 81560e1c..9ecc1b00 100644 --- a/TripKitAndroid/src/main/AndroidManifest.xml +++ b/TripKitAndroid/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + diff --git a/TripKitAndroid/src/main/java/com/skedgo/rxtry/Try.kt b/TripKitAndroid/src/main/java/com/skedgo/rxtry/Try.kt index 9e8b4cce..caa78894 100644 --- a/TripKitAndroid/src/main/java/com/skedgo/rxtry/Try.kt +++ b/TripKitAndroid/src/main/java/com/skedgo/rxtry/Try.kt @@ -1,6 +1,6 @@ package com.skedgo.rxtry -sealed class Try +open class Try data class Success(private val value: T) : Try() { operator fun invoke() = value diff --git a/TripKitAndroid/src/main/java/com/skedgo/tripkit/RoutingUserError.kt b/TripKitAndroid/src/main/java/com/skedgo/tripkit/RoutingUserError.kt index f97ac64a..664f9375 100644 --- a/TripKitAndroid/src/main/java/com/skedgo/tripkit/RoutingUserError.kt +++ b/TripKitAndroid/src/main/java/com/skedgo/tripkit/RoutingUserError.kt @@ -1,6 +1,6 @@ package com.skedgo.tripkit -sealed class RoutingError(detailMessage: String) : RuntimeException(detailMessage) +open class RoutingError(detailMessage: String) : RuntimeException(detailMessage) class RoutingUserError(detailMessage: String) : RoutingError(detailMessage) diff --git a/TripKitData/build.gradle b/TripKitData/build.gradle index 22068356..fa9c80f8 100644 --- a/TripKitData/build.gradle +++ b/TripKitData/build.gradle @@ -4,8 +4,12 @@ apply plugin: "com.android.library" apply plugin: 'maven-publish' apply plugin: "kotlin-android" apply plugin: "kotlin-kapt" +apply plugin: 'kotlin-parcelize' android { + + namespace 'skedgo.tripkit.data' + compileSdkVersion versions.compileSdkVersion defaultConfig { @@ -24,12 +28,12 @@ android { warning "InvalidPackage" } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() + jvmTarget = JavaVersion.VERSION_17.toString() } publishing { @@ -121,7 +125,7 @@ kapt { // build a jar with source files task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier.set('sources') } task javadoc(type: Javadoc) { @@ -136,7 +140,7 @@ task javadoc(type: Javadoc) { // build a jar with javadoc task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier.set('javadoc') from javadoc.destinationDir } diff --git a/TripKitData/src/main/AndroidManifest.xml b/TripKitData/src/main/AndroidManifest.xml index 8e8a7f45..4e750a47 100644 --- a/TripKitData/src/main/AndroidManifest.xml +++ b/TripKitData/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/bikepods/BikePodEntity.kt b/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/bikepods/BikePodEntity.kt index cf72e495..c04b0bc4 100644 --- a/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/bikepods/BikePodEntity.kt +++ b/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/bikepods/BikePodEntity.kt @@ -11,7 +11,7 @@ import androidx.room.PrimaryKey @Keep class BikePodLocationEntity { @PrimaryKey - lateinit var identifier: String + var identifier: String = "" var cellId: String? = null var lat: Double = 0.0 var lng: Double = 0.0 diff --git a/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/carparks/CarParkLocationEntity.kt b/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/carparks/CarParkLocationEntity.kt index a545be6b..273cb939 100644 --- a/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/carparks/CarParkLocationEntity.kt +++ b/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/carparks/CarParkLocationEntity.kt @@ -7,7 +7,7 @@ import androidx.room.* class CarParkLocationEntity { @PrimaryKey - lateinit var identifier: String + var identifier: String = "" lateinit var cellId: String lateinit var name: String var lat: Double = 0.0 @@ -30,7 +30,7 @@ class CarParkLocationEntity { )]) class OpeningDayEntity { @PrimaryKey - lateinit var id: String + var id: String = "" @ColumnInfo(index = true) lateinit var carParkId: String @@ -69,7 +69,7 @@ class ParkingOperatorEntity { )]) class PricingTableEntity { @PrimaryKey - lateinit var id: String + var id: String = "" lateinit var title: String var subtitle: String? = null lateinit var currencySymbol: String diff --git a/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/carpods/CarPodEntity.kt b/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/carpods/CarPodEntity.kt index 2041b978..01c4da4f 100644 --- a/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/carpods/CarPodEntity.kt +++ b/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/carpods/CarPodEntity.kt @@ -6,7 +6,7 @@ import androidx.room.ForeignKey.CASCADE @Entity(tableName = "carPods") class CarPodEntity { @PrimaryKey - lateinit var id: String + var id: String = "" var address: String? = null lateinit var cellId: String var lat: Double = 0.0 diff --git a/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/freefloating/FreeFloatingLocationEntity.kt b/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/freefloating/FreeFloatingLocationEntity.kt index c239c10d..4605c442 100644 --- a/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/freefloating/FreeFloatingLocationEntity.kt +++ b/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/freefloating/FreeFloatingLocationEntity.kt @@ -10,7 +10,7 @@ import com.skedgo.tripkit.parkingspots.models.Parking @Keep class FreeFloatingLocationEntity { @PrimaryKey - lateinit var identifier: String + var identifier: String = "" var cellId: String? = null var lat: Double = 0.0 var lng: Double = 0.0 diff --git a/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/onstreetparking/OnStreetParkingEntity.kt b/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/onstreetparking/OnStreetParkingEntity.kt index 5b13ac45..66071ea0 100644 --- a/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/onstreetparking/OnStreetParkingEntity.kt +++ b/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/onstreetparking/OnStreetParkingEntity.kt @@ -8,7 +8,7 @@ import com.skedgo.tripkit.parkingspots.models.Parking @TypeConverters(VacancyConverters::class) class OnStreetParkingEntity { @PrimaryKey - lateinit var identifier: String + var identifier: String = "" lateinit var cellId: String lateinit var name: String lateinit var encodedPolyline: String diff --git a/TripKitData/src/main/java/com/skedgo/tripkit/data/database/stops/StopLocationEntity.kt b/TripKitData/src/main/java/com/skedgo/tripkit/data/database/stops/StopLocationEntity.kt index 9a80c544..b6f2fec2 100644 --- a/TripKitData/src/main/java/com/skedgo/tripkit/data/database/stops/StopLocationEntity.kt +++ b/TripKitData/src/main/java/com/skedgo/tripkit/data/database/stops/StopLocationEntity.kt @@ -15,7 +15,7 @@ class StopLocationEntity { var address: String? = null @PrimaryKey - lateinit var code: String + var code: String = "" lateinit var name: String var popularify: Int = 0 lateinit var services: String diff --git a/TripKitDomain/build.gradle b/TripKitDomain/build.gradle index 7aa752b9..02b9195f 100644 --- a/TripKitDomain/build.gradle +++ b/TripKitDomain/build.gradle @@ -28,12 +28,12 @@ dependencies { } task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' + archiveClassifier.set('sources') from sourceSets.main.allSource } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier.set('javadoc') from javadoc.destinationDir } diff --git a/TripKitDomainLegacy/build.gradle b/TripKitDomainLegacy/build.gradle index 02497b27..654d8347 100644 --- a/TripKitDomainLegacy/build.gradle +++ b/TripKitDomainLegacy/build.gradle @@ -6,6 +6,9 @@ apply plugin: "kotlin-kapt" apply plugin: "maven-publish" android { + + namespace 'skedgo.tripkit.domain.legacy' + compileSdkVersion versions.compileSdkVersion defaultConfig { @@ -18,6 +21,14 @@ android { warning 'InvalidPackage' } + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17.toString() + } + publishing { singleVariant("release") { // if you don't want sources/javadoc, remove these lines @@ -46,7 +57,7 @@ dependencies { // build a jar with source files task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier.set('sources') } task javadoc(type: Javadoc) { @@ -61,7 +72,7 @@ task javadoc(type: Javadoc) { // build a jar with javadoc task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier.set('javadoc') from javadoc.destinationDir } diff --git a/TripKitSamples/build.gradle b/TripKitSamples/build.gradle index 1348d53a..732f3356 100644 --- a/TripKitSamples/build.gradle +++ b/TripKitSamples/build.gradle @@ -6,6 +6,7 @@ android { compileSdkVersion versions.compileSdkVersion buildFeatures { + viewBinding true dataBinding true } @@ -31,8 +32,8 @@ android { lintOptions { abortOnError false } compileOptions { coreLibraryDesugaringEnabled true - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } } diff --git a/ValidBookingCountData/build.gradle b/ValidBookingCountData/build.gradle index dbdfbcc1..77ae01ea 100644 --- a/ValidBookingCountData/build.gradle +++ b/ValidBookingCountData/build.gradle @@ -4,6 +4,9 @@ apply plugin: 'kotlin-kapt' apply plugin: 'maven-publish' android { + + namespace 'com.skedgo.tripkit.validbookingcount.data' + compileSdkVersion versions.compileSdkVersion defaultConfig { @@ -16,6 +19,14 @@ android { warning 'InvalidPackage' } + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17.toString() + } + publishing { singleVariant("release") { // if you don't want sources/javadoc, remove these lines @@ -60,7 +71,7 @@ dependencies { // build a jar with source files task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier.set('sources') } task javadoc(type: Javadoc) { @@ -75,7 +86,7 @@ task javadoc(type: Javadoc) { // build a jar with javadoc task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier.set('javadoc') from javadoc.destinationDir } diff --git a/ValidBookingCountDomain/build.gradle b/ValidBookingCountDomain/build.gradle index 80e3a002..ca17bf50 100644 --- a/ValidBookingCountDomain/build.gradle +++ b/ValidBookingCountDomain/build.gradle @@ -4,8 +4,8 @@ apply plugin: 'maven-publish' apply plugin: 'kotlin-kapt' // To fix error of converting bytecode to dex. -targetCompatibility = '1.7' -sourceCompatibility = '1.7' +targetCompatibility = JavaVersion.VERSION_17 +sourceCompatibility = JavaVersion.VERSION_17 dependencies { testImplementation libs.junit @@ -22,12 +22,12 @@ dependencies { task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' + archiveClassifier.set('sources') from sourceSets.main.allSource } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier.set('javadoc') from javadoc.destinationDir } diff --git a/build.gradle b/build.gradle index 72d95904..da7466ac 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.3.50' + ext.kotlin_version = '1.8.20' apply from: "dependencies.gradle" ext.kotlinVersion = versions.kotlinVersion ext.dokkaVersion = '0.10.0' @@ -11,7 +11,7 @@ buildscript { } dependencies { - classpath libs.androidGradlePlugin + classpath "com.android.tools.build:gradle:7.3.0" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion" diff --git a/dependencies.gradle b/dependencies.gradle index 48c5a5ac..4a68409b 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -12,16 +12,16 @@ versions.proMinSdkVersion = 21 versions.compileSdkVersion = 33 versions.targetSdkVersion = 33 // See change-log at https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md. -versions.kotlinVersion = "1.6.20" +versions.kotlinVersion = "1.8.20" versions.kotlinCoroutinesVersion = "1.4.0" versions.supportLibraryVersion = "28.0.0" -versions.androidGradlePlugin = "7.3.0" +versions.androidGradlePlugin = "8.0.2" versions.okHttpVersion = "4.9.0" versions.retrofitVersion = "2.8.1" versions.androidxVersion = "1.1.0" versions.room = "2.4.1" versions.architectureComponents = "1.0.0" -versions.testcore = "1.1.0" +versions.testcore = "1.4.0" versions.dagger = "2.24" versions.lifecycle = "2.4.0" versions.volley = "1.2.0" diff --git a/route-persistence/build.gradle b/route-persistence/build.gradle index 2b7194d3..afe55eb8 100644 --- a/route-persistence/build.gradle +++ b/route-persistence/build.gradle @@ -3,6 +3,9 @@ apply plugin: 'maven-publish' apply plugin: 'kotlin-android' android { + + namespace 'com.skedgo.routepersistence' + compileSdkVersion versions.compileSdkVersion // defaultPublishConfig 'debug' @@ -29,6 +32,14 @@ android { } } + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17.toString() + } + publishing { singleVariant("release") { // if you don't want sources/javadoc, remove these lines diff --git a/rxlifecyclecomponents/build.gradle b/rxlifecyclecomponents/build.gradle index be8ec1aa..65c1a676 100644 --- a/rxlifecyclecomponents/build.gradle +++ b/rxlifecyclecomponents/build.gradle @@ -1,15 +1,19 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'maven-publish' +apply plugin: 'kotlin-parcelize' android { - compileSdkVersion 29 - buildToolsVersion "29.0.1" + + namespace 'com.skedgo.rxlifecyclecomponents' + + compileSdkVersion versions.compileSdkVersion + buildToolsVersion "33.0.0" defaultConfig { minSdkVersion 19 - targetSdkVersion 29 + targetSdkVersion 33 versionCode 1 versionName "1.0" @@ -24,6 +28,14 @@ android { } } + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17.toString() + } + publishing { singleVariant("release") { // if you don't want sources/javadoc, remove these lines diff --git a/sqliteutils/build.gradle b/sqliteutils/build.gradle index 75fcbc4d..14aa6c7f 100644 --- a/sqliteutils/build.gradle +++ b/sqliteutils/build.gradle @@ -1,9 +1,13 @@ apply plugin: 'com.android.library' apply plugin: 'maven-publish' +apply plugin: 'kotlin-parcelize' android { - compileSdkVersion 29 - buildToolsVersion "29.0.1" + + namespace 'com.skedgo.sqlite' + + compileSdkVersion versions.compileSdkVersion + buildToolsVersion "33.0.0" defaultConfig { diff --git a/trip-kit-booking-ui/build.gradle b/trip-kit-booking-ui/build.gradle index a63f9d7f..d39c4b98 100644 --- a/trip-kit-booking-ui/build.gradle +++ b/trip-kit-booking-ui/build.gradle @@ -2,8 +2,12 @@ apply plugin: 'com.android.library' apply plugin: 'maven-publish' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' +apply plugin: 'kotlin-parcelize' android { + + namespace 'com.skedgo.tripkit.booking.ui' + compileSdkVersion versions.compileSdkVersion defaultConfig { @@ -13,6 +17,7 @@ android { } buildFeatures { + viewBinding true dataBinding true } @@ -27,6 +32,14 @@ android { } } + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17.toString() + } + publishing { singleVariant("release") { // if you don't want sources/javadoc, remove these lines @@ -80,7 +93,7 @@ dependencies { // build a jar with source files task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier.set('sources') } task javadoc(type: Javadoc) { @@ -95,7 +108,7 @@ task javadoc(type: Javadoc) { // build a jar with javadoc task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier.set('javadoc') from javadoc.destinationDir } diff --git a/trip-kit-booking/build.gradle b/trip-kit-booking/build.gradle index 38060ce3..7069ceba 100644 --- a/trip-kit-booking/build.gradle +++ b/trip-kit-booking/build.gradle @@ -2,8 +2,12 @@ apply plugin: 'com.android.library' apply plugin: 'maven-publish' apply plugin: "kotlin-android" apply plugin: "kotlin-kapt" +apply plugin: 'kotlin-parcelize' android { + + namespace 'com.skedgo.tripkit.booking' + compileSdkVersion versions.compileSdkVersion testOptions.unitTests.includeAndroidResources = true @@ -24,11 +28,11 @@ android { abortOnError false } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = "1.8" + jvmTarget = JavaVersion.VERSION_17.toString() } publishing { @@ -82,7 +86,7 @@ dependencies { // build a jar with source files task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs - classifier = 'sources' + archiveClassifier.set('sources') } task javadoc(type: Javadoc) { @@ -97,7 +101,7 @@ task javadoc(type: Javadoc) { // build a jar with javadoc task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' + archiveClassifier.set('javadoc') from javadoc.destinationDir } From 5712c231202aae3a91eb09b8257633eee8bdb0d7 Mon Sep 17 00:00:00 2001 From: Michael Angelo Reyes Date: Sun, 7 Jan 2024 12:01:13 +0800 Subject: [PATCH 3/3] [20331] *Update compileOptions and kotlinOptions Java version to 17 and eliminate inconsistencies. *Upgrade android gradle plugin to 8.0.2 and gradle-wrapper.properties to 8.2. *Update gradle.properties with new configs required by the update. *Update build.gradle(s) to add namespace as required by latest android gradle and remove package names in AndroidManifest.xml. *Remove deprecated kotlin-android-extensions and add new kotlin-parcelize and remove androidExtensions experimental used for the old kotlin parcelize in kotlin-android-extensions. *Update gradle to replace classifier that was deprecated when gradle plugin is updated, with archiveClassifier. *Update kotlin from 1.6.20 to 1.8.20 and update codes affected or caused errors after the update *Update Room version and update affected classes caused by it --- .../tripkit/data/database/locations/carpods/CarPodEntity.kt | 2 +- dependencies.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/carpods/CarPodEntity.kt b/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/carpods/CarPodEntity.kt index 01c4da4f..883b7705 100644 --- a/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/carpods/CarPodEntity.kt +++ b/TripKitData/src/main/java/com/skedgo/tripkit/data/database/locations/carpods/CarPodEntity.kt @@ -1,7 +1,7 @@ package com.skedgo.tripkit.data.database.locations.carpods import androidx.room.* -import androidx.room.ForeignKey.CASCADE +import androidx.room.ForeignKey.Companion.CASCADE @Entity(tableName = "carPods") class CarPodEntity { diff --git a/dependencies.gradle b/dependencies.gradle index 4a68409b..bd1d1371 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -19,7 +19,7 @@ versions.androidGradlePlugin = "8.0.2" versions.okHttpVersion = "4.9.0" versions.retrofitVersion = "2.8.1" versions.androidxVersion = "1.1.0" -versions.room = "2.4.1" +versions.room = "2.5.1" versions.architectureComponents = "1.0.0" versions.testcore = "1.4.0" versions.dagger = "2.24"