Skip to content

Commit

Permalink
* Update Kotlin to 1.6.10.
Browse files Browse the repository at this point in the history
* Update Gradle wrapper to 7.3.3.
* Update AndroidX dependencies.
* Fix collecting flows on lifecycle.
* Fix core JVM static method calls with Kotlin 1.6.x.
* Fix missing event parameters in session list.
* Fix large event parameters in detail view.
* Fix large event parameters for in app notification.
* Add exhaustive branches in generated code.
  • Loading branch information
Bojan committed Dec 24, 2021
1 parent 9aa7266 commit 74b3788
Show file tree
Hide file tree
Showing 25 changed files with 229 additions and 70 deletions.
1 change: 1 addition & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
Change Log
==========

## Version 1.3.2

_2021-12-24_

* Update Kotlin to 1.6.10.
* Update Gradle wrapper to 7.3.3.
* Update AndroidX dependencies.
* Fix collecting flows on lifecycle.
* Fix core JVM static method calls with Kotlin 1.6.x.
* Fix missing event parameters in session list.
* Fix large event parameters in detail view.
* Fix large event parameters for in app notification.
* Add exhaustive branches in generated code.

## Version 1.3.1

_2021-09-27_
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "com.infinum.collar:collar-plugin:1.3.1"
classpath "com.infinum.collar:collar-plugin:1.3.2"
}
}
```
Expand All @@ -42,7 +42,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.infinum.collar:collar-plugin:1.3.1")
classpath("com.infinum.collar:collar-plugin:1.3.2")
}
}
```
Expand Down Expand Up @@ -259,13 +259,13 @@ You can search, filter and clear all sent analytics.
In your app `build.gradle` or `build.gradle.kts` add:
**Groovy**
```gradle
debugImplementation "com.infinum.collar:collar-ui:1.3.1"
releaseImplementation "com.infinum.collar:collar-ui-no-op:1.3.1"
debugImplementation "com.infinum.collar:collar-ui:1.3.2"
releaseImplementation "com.infinum.collar:collar-ui-no-op:1.3.2"
```
**KotlinDSL**
```kotlin
debugImplementation("com.infinum.collar:collar-ui:1.3.1")
releaseImplementation("com.infinum.collar:collar-ui-no-op:1.3.1")
debugImplementation("com.infinum.collar:collar-ui:1.3.2")
releaseImplementation("com.infinum.collar:collar-ui-no-op:1.3.2")
```

In order to start tracking with UI you must use _LiveCollector_ as in this example:
Expand Down
4 changes: 2 additions & 2 deletions config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ext {
]
releaseConfig = [
"group" : "com.infinum.collar",
"version" : "1.3.1",
"versionCode": 1 * 100 * 100 + 3 * 100 + 1
"version" : "1.3.2",
"versionCode": 1 * 100 * 100 + 3 * 100 + 2
]
}
6 changes: 6 additions & 0 deletions core/src/main/kotlin/com/infinum/collar/Collar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public object Collar {
*
* @param screenName value.
*/
@JvmStatic
public fun trackScreen(screenName: String): Unit =
collector?.onScreen(
Screen(
Expand All @@ -46,6 +47,7 @@ public object Collar {
*
* @param screen wrapper class.
*/
@JvmStatic
public fun trackScreen(screen: Screen): Unit =
collector?.onScreen(screen) ?: Unit

Expand All @@ -55,6 +57,7 @@ public object Collar {
* @param eventName value.
* @param params value.
*/
@JvmStatic
public fun trackEvent(eventName: String, params: Bundle): Unit =
collector?.onEvent(
Event(
Expand All @@ -68,6 +71,7 @@ public object Collar {
*
* @param event wrapper class.
*/
@JvmStatic
public fun trackEvent(event: Event): Unit =
collector?.onEvent(event) ?: Unit

Expand All @@ -78,6 +82,7 @@ public object Collar {
* @param name value.
* @param value value.
*/
@JvmStatic
public fun trackProperty(name: String, value: String?): Unit =
collector?.onProperty(
Property(
Expand All @@ -91,6 +96,7 @@ public object Collar {
*
* @param property wrapper class.
*/
@JvmStatic
public fun trackProperty(property: Property): Unit =
collector?.onProperty(property) ?: Unit
}
45 changes: 23 additions & 22 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
[versions]
collar = "1.3.1"
gradle = "7.0.2"
lint = "30.0.2"
kotlin = "1.5.31"
coroutines = "1.5.2"
serialization = "1.3.0"
poet = "1.10.1"
annotations = "22.0.0"
core = "1.6.0"
appcompat = "1.3.1"
activity = "1.3.1"
fragment = "1.3.6"
lifecycle = "2.3.1"
collar = "1.3.2"
gradle = "7.0.4"
lint = "30.0.4"
kotlin = "1.6.10"
coroutines = "1.6.0"
serialization = "1.3.1"
poet = "1.10.2"
annotations = "23.0.0"
core = "1.7.0"
appcompat = "1.4.0"
activity = "1.4.0"
fragment = "1.4.0"
lifecycle = "2.4.0"
recyclerview = "1.2.1"
room = "2.4.0-alpha04"
room = "2.4.0"
startup = "1.1.0"
dynamicanimation = "1.0.0"
design = "1.4.0"
koin = "3.1.2"
timber = "5.0.0"
detekt = "1.18.1"
ktlint = "10.2.0"
cpd = "3.1"
dokka = "1.5.30"
koin = "3.1.4"
timber = "5.0.1"
detekt = "1.18.0"
ktlintplugin = "10.2.0"
ktlint = "0.43.1"
cpd = "3.2"
dokka = "1.6.0"

[libraries]
libraryannotations = { module = "com.infinum.collar:collar-annotations", version.ref = "collar" }
Expand Down Expand Up @@ -55,7 +56,7 @@ androidx-activity = { module = "androidx.activity:activity-ktx", version.ref = "
androidx-fragment = { module = "androidx.fragment:fragment-ktx", version.ref = "fragment" }
androidx-lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "lifecycle" }
androidx-lifecycle-livedata = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "lifecycle" }
androidx-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime", version.ref = "lifecycle" }
androidx-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle" }
androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "recyclerview" }
androidx-dynamicanimation = { module = "androidx.dynamicanimation:dynamicanimation", version.ref = "dynamicanimation" }
androidx-startup = { module = "androidx.startup:startup-runtime", version.ref = "startup" }
Expand All @@ -75,7 +76,7 @@ timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" }
detekt-gradle = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detekt" }
detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" }

ktlint = { module = "org.jlleitschuh.gradle:ktlint-gradle", version.ref = "ktlint" }
ktlint = { module = "org.jlleitschuh.gradle:ktlint-gradle", version.ref = "ktlintplugin" }

cpd = { module = "de.aaschmid:gradle-cpd-plugin", version.ref = "cpd" }

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion ktlint.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: "org.jlleitschuh.gradle.ktlint"

ktlint {
version = "0.42.1"
version = libs.versions.ktlint.get()
debug = false
android = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ internal class AnalyticsEventsSpec(
unindent()
addStatement(STATEMENT_EVENT_CLASS_END)
}
addStatement("else -> Unit")
}
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ internal class ScreenNameSpec(
holders.forEach {
addStatement(this, it)
}
addStatement("else -> Unit")
}
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ internal class UserPropertiesSpec(
it.propertyParameterNames.single()
)
}
addStatement("else -> Unit")
}
.build()
}
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ android {
javaCompileOptions {
annotationProcessorOptions {
argument "events_count", "100"
argument "event_parameters_count", "17"
argument "event_parameters_count", "60"
argument "event_name_length", "20"
argument "reserved_prefixes", "ga_,fb_"
}
Expand Down
48 changes: 47 additions & 1 deletion sample/src/main/java/com/infinum/collar/sample/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,53 @@ public void onClick(View v) {
18,
2L,
Short.MAX_VALUE,
buildBundle()
buildBundle(),
"awesome",
true,
Byte.MAX_VALUE,
Character.MAX_VALUE,
7.11,
31.5f,
18,
2L,
Short.MAX_VALUE,
"awesome",
true,
Byte.MAX_VALUE,
Character.MAX_VALUE,
7.11,
31.5f,
18,
2L,
Short.MAX_VALUE,
"awesome",
true,
Byte.MAX_VALUE,
Character.MAX_VALUE,
7.11,
31.5f,
18,
2L,
Short.MAX_VALUE,
buildBundle(),
"awesome",
true,
Byte.MAX_VALUE,
Character.MAX_VALUE,
7.11,
31.5f,
18,
2L,
Short.MAX_VALUE,
"awesome",
true,
Byte.MAX_VALUE,
Character.MAX_VALUE,
7.11,
31.5f,
18,
2L,
Short.MAX_VALUE
));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,53 @@ sealed class AnalyticsEvent {
val myInt: Int,
val myLong: Long,
val myShort: Short,
val myBundle: Bundle
val myBundle: Bundle,
val myOtherString: String,
val myOtherBoolean: Boolean,
val myOtherByte: Byte,
val myOtherChar: Char,
val myOtherDouble: Double,
val myOtherFloat: Float,
val myOtherInt: Int,
val myOtherLong: Long,
val myOtherShort: Short,
val myBrandString: String,
val myBrandBoolean: Boolean,
val myBrandByte: Byte,
val myBrandChar: Char,
val myBrandDouble: Double,
val myBrandFloat: Float,
val myBrandInt: Int,
val myBrandLong: Long,
val myBrandShort: Short,
val myString2: String,
val myBoolean2: Boolean,
val myByte2: Byte,
val myChar2: Char,
val myDouble2: Double,
val myFloat2: Float,
val myInt2: Int,
val myLong2: Long,
val myShort2: Short,
val myBundle2: Bundle,
val myOtherString2: String,
val myOtherBoolean2: Boolean,
val myOtherByte2: Byte,
val myOtherChar2: Char,
val myOtherDouble2: Double,
val myOtherFloat2: Float,
val myOtherInt2: Int,
val myOtherLong2: Long,
val myOtherShort2: Short,
val myBrandString2: String,
val myBrandBoolean2: Boolean,
val myBrandByte2: Byte,
val myBrandChar2: Char,
val myBrandDouble2: Double,
val myBrandFloat2: Float,
val myBrandInt2: Int,
val myBrandLong2: Long,
val myBrandShort2: Short
) : AnalyticsEvent()

data class Event2(
Expand Down
2 changes: 1 addition & 1 deletion ui/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id "com.android.library"
id "kotlin-android"
id "com.google.devtools.ksp" version "1.5.31-1.0.0"
id "com.google.devtools.ksp" version "1.6.10-1.0.2"
}

android {
Expand Down
Loading

0 comments on commit 74b3788

Please sign in to comment.