Skip to content

Commit

Permalink
Merge pull request #403 from skedgo/feature/20331-TKUIHomeViewControl…
Browse files Browse the repository at this point in the history
…ler-unit-test

[20331] TKUIHomeViewController unit test with Gradle and Kotlin updates.
  • Loading branch information
MichaelReyes authored Jan 8, 2024
2 parents 4939569 + 5712c23 commit 2b5604f
Show file tree
Hide file tree
Showing 27 changed files with 145 additions and 71 deletions.
18 changes: 8 additions & 10 deletions CommonCoreLegacy/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down Expand Up @@ -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) {
Expand All @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion CommonCoreLegacy/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 package="com.skedgo.tripkit.common"
<manifest
xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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?,
Expand Down
21 changes: 11 additions & 10 deletions TripKitAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down Expand Up @@ -111,6 +110,8 @@ dependencies {
implementation libs.map_extension
implementation libs.location

testImplementation libs.mockk

debugApi project(':CommonCoreLegacy')
releaseApi project(':CommonCoreLegacy')
debugApi project(':TripKitDomain')
Expand All @@ -130,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) {
Expand All @@ -145,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
}

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

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Expand Down
2 changes: 1 addition & 1 deletion TripKitAndroid/src/main/java/com/skedgo/rxtry/Try.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.skedgo.rxtry

sealed class Try<T>
open class Try<T>

data class Success<T>(private val value: T) : Try<T>() {
operator fun invoke() = value
Expand Down
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
14 changes: 9 additions & 5 deletions TripKitData/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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) {
Expand All @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion TripKitData/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 package="skedgo.tripkit.data" xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application />
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -30,7 +30,7 @@ class CarParkLocationEntity {
)])
class OpeningDayEntity {
@PrimaryKey
lateinit var id: String
var id: String = ""

@ColumnInfo(index = true)
lateinit var carParkId: String
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
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 {
@PrimaryKey
lateinit var id: String
var id: String = ""
var address: String? = null
lateinit var cellId: String
var lat: Double = 0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions TripKitDomain/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
15 changes: 13 additions & 2 deletions TripKitDomainLegacy/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ apply plugin: "kotlin-kapt"
apply plugin: "maven-publish"

android {

namespace 'skedgo.tripkit.domain.legacy'

compileSdkVersion versions.compileSdkVersion

defaultConfig {
Expand All @@ -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
Expand Down Expand Up @@ -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) {
Expand All @@ -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
}

Expand Down
5 changes: 3 additions & 2 deletions TripKitSamples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ android {
compileSdkVersion versions.compileSdkVersion

buildFeatures {
viewBinding true
dataBinding true
}

Expand All @@ -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
}
}

Expand Down
Loading

0 comments on commit 2b5604f

Please sign in to comment.