Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions WooCommerce/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ dependencies {

implementation(libs.google.guava)

implementation(libs.google.protobuf.javalite)
implementation(libs.google.protobuf.kotlinlite)

testImplementation(testFixtures(project(":libs:fluxc-plugin")))

Expand All @@ -465,17 +465,6 @@ protobuf {
}
}

androidComponents {
onVariants(selector().all(), { variant ->
afterEvaluate {
def capName = variant.name.capitalize()
tasks.getByName("ksp${capName}Kotlin") {
setSource(tasks.getByName("generate${capName}Proto").outputs)
}
}
})
}

task copyGoogleServicesExampleFile(type: Copy) {
from('.')
into('.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class CardReaderInteracRefundErrorMapper @Inject constructor() {
CardInteracRefundStatus.RefundStatusErrorType.NonRetryable -> InteracRefundFlowError.NonRetryableGeneric
CardInteracRefundStatus.RefundStatusErrorType.Server -> InteracRefundFlowError.Server
CardInteracRefundStatus.RefundStatusErrorType.Cancelled -> InteracRefundFlowError.Cancelled
else -> InteracRefundFlowError.Generic
}

@Suppress("ComplexMethod")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class SitePlanRestClient @Inject constructor(
when (originalResponse) {
is Success -> {
Success(
data = gson.fromJson<Map<Int, SitePlanDto>?>(originalResponse.data, type)
data = gson.fromJson<Map<Int, SitePlanDto>>(originalResponse.data, type)
.filterValues { it.currentPlan == true }
.toList()
.firstOrNull()
Expand Down Expand Up @@ -85,7 +85,7 @@ class SitePlanRestClient @Inject constructor(
when (originalResponse) {
is Success -> {
Success(
data = gson.fromJson<Map<Int, SitePlanDto>?>(originalResponse.data, type)
data = gson.fromJson<Map<Int, SitePlanDto>>(originalResponse.data, type)
.mapValues { (id, sitePlanDto) ->
if (sitePlanDto.expirationDate == null) {
null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ class WCMaterialOutlinedCurrencyEditTextView @JvmOverloads constructor(

private lateinit var currencyEditText: CurrencyEditText

val editText: TextInputEditText
get() = currencyEditText
Comment on lines -59 to -60
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As editText was hiding the Java's getEditText function, the compiler raised a warning about it, I updated the code to override getEditText directly.


@Inject
lateinit var parameterRepository: ParameterRepository

Expand Down Expand Up @@ -91,6 +88,9 @@ class WCMaterialOutlinedCurrencyEditTextView @JvmOverloads constructor(
}
}

val value: LiveData<BigDecimal?>
get() = currencyEditText.value

init {
context.obtainStyledAttributes(
attrs,
Expand Down Expand Up @@ -152,8 +152,9 @@ class WCMaterialOutlinedCurrencyEditTextView @JvmOverloads constructor(
currencyEditText.initView(siteParameters.currencyFormattingParameters)
}

val value: LiveData<BigDecimal?>
get() = currencyEditText.value
override fun getEditText(): TextInputEditText {
return currencyEditText
}

fun getText() = currencyEditText.text.toString()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class BlazeCampaignCreationPreviewViewModelTests : BaseUnitTest() {
on { formatCurrency(amount = any(), any(), any()) }.doAnswer { it.getArgument<BigDecimal>(0).toString() }
}
private val resourceProvider: ResourceProvider = mock {
on { getString(any()) } doAnswer { it.getArgument<Any?>(0).toString() }
on { getString(any()) } doAnswer { it.getArgument<Any>(0).toString() }
on { getString(any(), anyVararg()) } doAnswer { it.arguments.joinToString { it.toString() } }
}
private val blazeRepository: BlazeRepository = mock {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class BlazeCampaignTargetLocationSelectionViewModelTests : BaseUnitTest() {
onBlocking { fetchLocations(any()) } doReturn Result.success(sampleLocations)
}
private val resourceProvider: ResourceProvider = mock {
on { getString(any()) } doAnswer { it.getArgument<Any?>(0).toString() }
on { getString(any()) } doAnswer { it.getArgument<Any>(0).toString() }
}
private lateinit var viewModel: BlazeCampaignTargetLocationSelectionViewModel

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class BlazeCampaignTargetSelectionViewModelTests : BaseUnitTest() {
on { observeDevices() } doReturn devicesFlow
}
private val resourceProvider: ResourceProvider = mock {
on { getString(any()) } doAnswer { it.getArgument<Any?>(0).toString() }
on { getString(any()) } doAnswer { it.getArgument<Any>(0).toString() }
}
private val analyticsTracker: AnalyticsTrackerWrapper = mock()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ProductDetailCardBuilderTest : BaseUnitTest() {
}

private val resourceProvider: ResourceProvider = mock {
on { getString(any()) } doAnswer { it.getArgument<Any?>(0).toString() }
on { getString(any()) } doAnswer { it.getArgument<Any>(0).toString() }
}

@Before
Expand Down
14 changes: 8 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import com.automattic.android.measure.reporters.InternalA8cCiReporter
import com.automattic.android.measure.reporters.RemoteBuildCacheMetricsReporter
import com.automattic.android.measure.reporters.SlowSlowTasksMetricsReporter
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand Down Expand Up @@ -44,14 +45,15 @@ measureBuilds {
allprojects {
apply plugin: libs.plugins.detekt.get().pluginId

tasks.withType(KotlinCompile).all {
kotlinOptions {
jvmTarget = libs.versions.java.get()
tasks.withType(KotlinCompile).configureEach {
compilerOptions {
jvmTarget = JvmTarget.fromTarget(libs.versions.java.get())
allWarningsAsErrors = true
freeCompilerArgs += [
"-opt-in=kotlin.RequiresOptIn",
optIn.add("kotlin.RequiresOptIn")
freeCompilerArgs.addAll([
"-Xjvm-default=all-compatibility",
]
"-Xannotation-default-target=param-property"
])
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ json-path = '2.9.0'
json-smart = '2.6.0'
junit = '4.13.2'
lottie = '6.6.7'
kotlin = '2.1.10'
kotlin = '2.2.20'
kotlinx-coroutines = '1.10.2'
ksp = '2.1.10-1.0.29'
ksp = '2.2.20-2.0.4'
mockito-kotlin = '5.4.0'
mpandroidchart = 'v3.1.0'
photoview = '2.3.0'
Expand Down Expand Up @@ -235,7 +235,7 @@ google-play-services-auth = { group = "com.google.android.gms", name = "play-ser
google-play-services-code-scanner = { group = "com.google.android.gms", name = "play-services-code-scanner", version.ref = "google-play-services-code-scanner" }
google-play-services-wearable = { group = "com.google.android.gms", name = "play-services-wearable", version.ref = "google-play-services-wearable" }
google-play-services-mlkit-subject-segmentation = { group = "com.google.android.gms", name = "play-services-mlkit-subject-segmentation", version.ref = "google-mlkit-subject-segmentation" }
google-protobuf-javalite = { group = "com.google.protobuf", name = "protobuf-javalite", version.ref = "google-protobuf-library" }
google-protobuf-kotlinlite = { group = "com.google.protobuf", name = "protobuf-kotlin-lite", version.ref = "google-protobuf-library" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With kotlin-lite dependency, we don't need the previous hack that was blocking the update.

google-protobuf-protoc = { group = "com.google.protobuf", name = "protoc", version.ref = "google-protobuf-library" }
google-zxing-core = { group = "com.google.zxing", name = "core", version.ref = "google-zxing" }
gravatar = { group = "com.gravatar", name = "gravatar", version.ref = "gravatar" }
Expand Down