Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Kotlin Parcelize plugin #3058

Merged
merged 1 commit into from
Nov 19, 2020
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
6 changes: 1 addition & 5 deletions example/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
id 'checkstyle'
id 'org.jetbrains.kotlin.plugin.parcelize'
}

assemble.dependsOn('lint')
Expand Down Expand Up @@ -167,10 +167,6 @@ android {
}
}

androidExtensions {
features = []
}

task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
main = "com.pinterest.ktlint.Main"
Expand Down
7 changes: 1 addition & 6 deletions stripe/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'kotlin-android-extensions'
id 'checkstyle'
id 'org.jetbrains.dokka'
id 'org.jetbrains.kotlin.plugin.parcelize'

id 'maven'
id 'signing'
Expand Down Expand Up @@ -127,11 +127,6 @@ android {
}
}

androidExtensions {
features = ['parcelize']
experimental = true
}

task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
main = "com.pinterest.ktlint.Main"
Expand Down
2 changes: 1 addition & 1 deletion stripe/src/main/java/com/stripe/android/AppInfo.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.stripe.android

import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

/**
* Data for identifying your plug-in or library.
Expand Down
2 changes: 1 addition & 1 deletion stripe/src/main/java/com/stripe/android/EphemeralKey.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.stripe.android

import com.stripe.android.model.StripeModel
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

/**
* Represents an Ephemeral Key that can be used temporarily for API operations that typically
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import android.os.Parcelable
import com.stripe.android.model.PaymentMethod
import com.stripe.android.model.ShippingInformation
import com.stripe.android.model.Source
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

internal sealed class EphemeralOperation : Parcelable {
internal abstract val id: String
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.stripe.android

import com.stripe.android.model.StripeModel
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize
import org.json.JSONObject
import java.util.concurrent.TimeUnit

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.stripe.android

import android.content.Context
import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize
import org.json.JSONArray
import org.json.JSONObject
import java.util.Currency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import androidx.core.os.bundleOf
import com.stripe.android.stripe3ds2.init.ui.StripeToolbarCustomization
import com.stripe.android.view.AuthActivityStarter
import com.stripe.android.view.PaymentAuthWebViewActivity
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

/**
* A class that manages starting a [PaymentAuthWebViewActivity] instance with the correct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.stripe.android
import android.content.Context
import android.content.SharedPreferences
import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
data class PaymentConfiguration internal constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import com.stripe.android.model.Source
import com.stripe.android.model.StripeIntent
import com.stripe.android.networking.ApiRequest
import com.stripe.android.view.AuthActivityStarter
import kotlinx.android.parcel.Parceler
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parceler
import kotlinx.parcelize.Parcelize

internal interface PaymentController {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.stripe.android

import com.stripe.android.model.PaymentIntent
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

/**
* A model representing the result of a [PaymentIntent] confirmation via [Stripe.confirmPayment]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import com.stripe.android.model.Source
import com.stripe.android.model.StripeIntent
import com.stripe.android.view.AuthActivityStarter
import com.stripe.android.view.PaymentRelayActivity
import kotlinx.android.parcel.Parceler
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parceler
import kotlinx.parcelize.Parcelize

/**
* Starts an instance of [PaymentRelayStarter].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import com.stripe.android.view.PaymentMethodsActivity
import com.stripe.android.view.SelectShippingMethodWidget
import com.stripe.android.view.ShippingInfoWidget
import com.stripe.android.view.ShippingInfoWidget.CustomizableShippingField
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize
import java.io.Serializable
import java.util.Locale

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import android.os.Parcelable
import com.stripe.android.model.PaymentMethod
import com.stripe.android.model.ShippingInformation
import com.stripe.android.model.ShippingMethod
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

/**
* A data class representing the state of the associated [PaymentSession].
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.stripe.android

import com.stripe.android.model.SetupIntent
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

/**
* A model representing the result of a [SetupIntent] confirmation via [Stripe.confirmSetupIntent]
Expand Down
2 changes: 1 addition & 1 deletion stripe/src/main/java/com/stripe/android/StripeError.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.stripe.android

import com.stripe.android.model.StripeModel
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize
import java.io.Serializable

/**
Expand Down
2 changes: 1 addition & 1 deletion stripe/src/main/java/com/stripe/android/cards/Bin.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.stripe.android.cards

import com.stripe.android.model.StripeModel
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
internal data class Bin internal constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.stripe.android.model

import android.os.Parcelable
import com.stripe.android.ObjectBuilder
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

/**
* [Create an account token](https://stripe.com/docs/api/tokens/create_account)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.stripe.android.model

import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
internal data class AccountRange internal constructor(
Expand Down
2 changes: 1 addition & 1 deletion stripe/src/main/java/com/stripe/android/model/Address.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.stripe.android.model

import com.stripe.android.ObjectBuilder
import com.stripe.android.model.parsers.AddressJsonParser
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize
import org.json.JSONObject
import java.util.Locale

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.stripe.android.model

import android.os.Parcelable
import com.stripe.android.ObjectBuilder
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize
import java.util.Locale

@Parcelize
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.stripe.android.model

import com.stripe.android.StripeIntentResult
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
internal data class AlipayAuthResult(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.stripe.android.model

import androidx.annotation.Size
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

/**
* [The bank account object](https://stripe.com/docs/api/customer_bank_accounts/object)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.stripe.android.model

import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

/**
* [Create a bank account token](https://stripe.com/docs/api/tokens/create_bank_account)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.stripe.android.model

import com.stripe.android.cards.CardNumber
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
internal data class BinRange(
Expand Down
2 changes: 1 addition & 1 deletion stripe/src/main/java/com/stripe/android/model/Card.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import androidx.annotation.Size
import com.stripe.android.CardUtils
import com.stripe.android.ObjectBuilder
import com.stripe.android.model.parsers.CardJsonParser
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize
import org.json.JSONObject
import java.util.Calendar

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.stripe.android.model

import com.stripe.android.cards.Bin
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
internal data class CardMetadata internal constructor(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.stripe.android.model

import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

/**
* [Create a card token](https://stripe.com/docs/api/tokens/create_card)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import com.stripe.android.model.ConfirmStripeIntentParams.Companion.PARAM_PAYMEN
import com.stripe.android.model.ConfirmStripeIntentParams.Companion.PARAM_PAYMENT_METHOD_ID
import com.stripe.android.model.ConfirmStripeIntentParams.Companion.PARAM_RETURN_URL
import com.stripe.android.model.ConfirmStripeIntentParams.Companion.PARAM_USE_STRIPE_SDK
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

/**
* Model representing parameters for [confirming a PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.stripe.android.model.ConfirmStripeIntentParams.Companion.PARAM_PAYMEN
import com.stripe.android.model.ConfirmStripeIntentParams.Companion.PARAM_PAYMENT_METHOD_ID
import com.stripe.android.model.ConfirmStripeIntentParams.Companion.PARAM_RETURN_URL
import com.stripe.android.model.ConfirmStripeIntentParams.Companion.PARAM_USE_STRIPE_SDK
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

/**
* Model representing parameters for [confirming a SetupIntent](https://stripe.com/docs/api/setup_intents/confirm).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.stripe.android.model

import com.stripe.android.model.parsers.CustomerJsonParser
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize
import org.json.JSONObject

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.stripe.android.model

import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

/**
* Model of the "data" object inside a [Customer] "source" object.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.stripe.android.model

import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
data class CvcTokenParams(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.stripe.android.model

import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
data class DateOfBirth(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.stripe.android.model

import com.stripe.android.view.FpxBank
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize
import org.jetbrains.annotations.TestOnly

@Parcelize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.stripe.android.model
import android.os.Parcelable
import com.stripe.android.model.StripeJsonUtils.optString
import com.stripe.android.model.parsers.TokenJsonParser
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize
import org.json.JSONException
import org.json.JSONObject

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.stripe.android.model

import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
data class IssuingCardPin(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.stripe.android.model

import android.os.Parcelable
import com.stripe.android.model.KlarnaSourceParams.LineItem
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

/**
* Model representing parameters for creating a Klarna Source.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.stripe.android.model

import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
internal data class ListPaymentMethodsParams(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.stripe.android.model

import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

/**
* Mandate Data parameters for
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.stripe.android.model

import com.stripe.android.model.parsers.PaymentIntentJsonParser
import kotlinx.android.parcel.Parcelize
import kotlinx.android.parcel.RawValue
import kotlinx.parcelize.Parcelize
import kotlinx.parcelize.RawValue
import org.json.JSONObject
import java.util.regex.Pattern

Expand Down
Loading