Skip to content

Commit

Permalink
implement versioned plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
wenxi-zeng committed Mar 8, 2022
1 parent 681630a commit a40380f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ plugins {
id("mvn-publish")
}

val VERSION_NAME: String by project

android {
compileSdk = 31
buildToolsVersion = "31.0.0"
Expand All @@ -17,6 +19,8 @@ android {

testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
consumerProguardFiles("proguard-consumer-rules.pro")

buildConfigField("String", "VERSION_NAME", "\"$VERSION_NAME\"")
}

buildTypes {
Expand All @@ -38,7 +42,7 @@ android {
dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")

implementation("com.segment.analytics.kotlin:android:1.4.3")
implementation("com.segment.analytics.kotlin:android:1.5.0")
implementation("androidx.multidex:multidex:2.0.1")

implementation("androidx.core:core-ktx:1.7.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import android.os.Bundle
import com.appsflyer.AFInAppEventParameterName
import com.segment.analytics.kotlin.android.plugins.AndroidLifecycle
import com.appsflyer.deeplink.DeepLinkListener
import com.segment.analytics.kotlin.core.platform.VersionedPlugin
import com.segment.analytics.kotlin.core.platform.plugins.logger.*
import com.segment.analytics.kotlin.core.utilities.getString
import com.segment.analytics.kotlin.core.utilities.mapTransform
Expand Down Expand Up @@ -61,7 +62,7 @@ data class AppsFlyerSettings(
class AppsFlyerDestination(
private val applicationContext: Context,
private var isDebug: Boolean = false
) : DestinationPlugin(), AndroidLifecycle {
) : DestinationPlugin(), AndroidLifecycle, VersionedPlugin {

internal var settings: AppsFlyerSettings? = null
internal var appsflyer: AppsFlyerLib? = null
Expand Down Expand Up @@ -237,4 +238,8 @@ class AppsFlyerDestination(
}
}

override fun version(): String {
return BuildConfig.VERSION_NAME
}

}

0 comments on commit a40380f

Please sign in to comment.