Skip to content

Commit

Permalink
Merge pull request #61 from infinum/develop
Browse files Browse the repository at this point in the history
Release 1.3.7
  • Loading branch information
bojankoma authored Aug 24, 2022
2 parents 72b0629 + 02d8ba6 commit 28fd477
Show file tree
Hide file tree
Showing 29 changed files with 229 additions and 260 deletions.
1 change: 0 additions & 1 deletion .idea/compiler.xml

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

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

## Version 1.3.7

_2022-08-24_

* Make core module pure Kotlin.
* Replace Bundle with Map dependency.
* Fix Android 13 compatibility issues.

## Version 1.3.6

_2022-08-09_
Expand Down
16 changes: 8 additions & 8 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.6"
classpath "com.infinum.collar:collar-plugin:1.3.7"
}
}
```
Expand All @@ -42,7 +42,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.infinum.collar:collar-plugin:1.3.6")
classpath("com.infinum.collar:collar-plugin:1.3.7")
}
}
```
Expand Down Expand Up @@ -77,7 +77,7 @@ Collar.attach(object : Collector {
analyticsProvider.sendScreenName(screenName = screen.name)

override fun onEvent(event: Event) =
analyticsProvider.sendEvent(eventName = event.name, eventParameters = event.params ?: Bundle.EMPTY)
analyticsProvider.sendEvent(eventName = event.name, eventParameters = event.params ?: mapOf<String, *>())

override fun onProperty(property: Property) =
analyticsProvider.sendProperty(property.name, property.value)
Expand Down Expand Up @@ -261,13 +261,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.6"
releaseImplementation "com.infinum.collar:collar-ui-no-op:1.3.6"
debugImplementation "com.infinum.collar:collar-ui:1.3.7"
releaseImplementation "com.infinum.collar:collar-ui-no-op:1.3.7"
```
**KotlinDSL**
```kotlin
debugImplementation("com.infinum.collar:collar-ui:1.3.6")
releaseImplementation("com.infinum.collar:collar-ui-no-op:1.3.6")
debugImplementation("com.infinum.collar:collar-ui:1.3.7")
releaseImplementation("com.infinum.collar:collar-ui-no-op:1.3.7")
```

In order to start tracking with UI you must use _LiveCollector_ as in this example:
Expand All @@ -287,7 +287,7 @@ Collar.attach(object : LiveCollector(configuration) {

override fun onEvent(event: Event) =
super.onEvent(event).run {
analyticsProvider.sendEvent(eventName = event.name, eventParameters = event.params ?: Bundle.EMPTY)
analyticsProvider.sendEvent(eventName = event.name, eventParameters = event.params ?: mapOf<String, *>())
}

override fun onProperty(property: Property) =
Expand Down
4 changes: 2 additions & 2 deletions annotations/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ java {

compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_1_8.toString()
freeCompilerArgs += [
'-Xjvm-default=all'
]
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}

Expand Down
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ task clean(type: Delete) {
}

task lintAll(dependsOn: [
':core:lintRelease',
':ui:lintRelease',
':ui-no-op:lintRelease'
]) {
Expand Down
8 changes: 4 additions & 4 deletions config.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
ext {
def major = 1
def minor = 3
def patch = 6
def patch = 7

buildConfig = [
"minSdk" : 19,
"compileSdk": 32,
"targetSdk" : 32,
"buildTools": "32.0.0"
"compileSdk": 33,
"targetSdk" : 33,
"buildTools": "33.0.0"
]
releaseConfig = [
"group" : "com.infinum.collar",
Expand Down
72 changes: 23 additions & 49 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,47 +1,33 @@
plugins {
id "com.android.library"
id "kotlin-android"
id "java-library"
id "org.jetbrains.kotlin.jvm"
}

android {
buildFeatures {
buildConfig = false
}

compileSdkVersion buildConfig.compileSdk
buildToolsVersion buildConfig.buildTools

defaultConfig {
minSdkVersion buildConfig.minSdk
targetSdkVersion buildConfig.targetSdk
versionCode releaseConfig.versionCode
versionName releaseConfig.version
}
kotlin {
explicitApi()
}

buildTypes {
debug {
debuggable true
minifyEnabled false
}
release {
debuggable false
minifyEnabled true
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.txt"
}
}
java {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
compileKotlin {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
freeCompilerArgs += [
'-Xjvm-default=all',
'-Xexplicit-api=strict'
'-Xjvm-default=all'
]
}
packagingOptions {
}
compileTestKotlin {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}

/*
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
Expand All @@ -52,27 +38,15 @@ android {
exclude 'META-INF/ASL2.0'
exclude("META-INF/*.kotlin_module")
}

sourceSets.each {
it.java.srcDirs += "src/$it.name/kotlin"
}

publishing {
singleVariant('release') {
withSourcesJar()
withJavadocJar()
}
}
}
*/

dependencies {
api libs.libraryannotations
implementation libs.kotlin.core
compileOnly libs.annotations
implementation libs.androidx.core

testImplementation "junit:junit:4.13.2"
testImplementation 'org.mockito:mockito-core:3.11.2'
testImplementation 'org.mockito:mockito-core:4.5.1'
}

apply from: "publish.gradle"
apply from: "publish.gradle"
15 changes: 3 additions & 12 deletions core/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: "signing"

task sourcesJar(type: Jar, dependsOn: assemble) {
archiveClassifier.set("sources")
from android.sourceSets.main.java.source
from sourceSets.main.allSource
}

task javadocsJar(type: Jar, dependsOn: "dokkaJavadoc") {
Expand Down Expand Up @@ -33,11 +33,12 @@ afterEvaluate {
}
publications {
release(MavenPublication) {
from components.java

groupId = releaseConfig.group
artifactId = "collar-core"
version = releaseConfig.version

artifact bundleReleaseAar
artifact sourcesJar
artifact javadocsJar

Expand All @@ -64,16 +65,6 @@ afterEvaluate {
url = "https://github.com/infinum/android-collar"
}
}
pom.withXml {
def root = asNode()
def dependenciesNode = root.appendNode("dependencies")
configurations.implementation.allDependencies.each {
def dependencyNode = dependenciesNode.appendNode("dependency")
dependencyNode.appendNode("groupId", it.group)
dependencyNode.appendNode("artifactId", it.name)
dependencyNode.appendNode("version", it.version)
}
}
signing {
sign publishing.publications.release
}
Expand Down
1 change: 0 additions & 1 deletion core/src/main/AndroidManifest.xml

This file was deleted.

6 changes: 2 additions & 4 deletions core/src/main/kotlin/com/infinum/collar/Collar.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.infinum.collar

import android.os.Bundle

/**
* Singleton object entry point for screen names, events and properties collection.
*/
Expand Down Expand Up @@ -58,11 +56,11 @@ public object Collar {
* @param params value.
*/
@JvmStatic
public fun trackEvent(eventName: String, params: Bundle): Unit =
public fun trackEvent(eventName: String, params: Map<String, *>): Unit =
collector?.onEvent(
Event(
name = eventName,
params = if (params.isEmpty) null else params
params = params.ifEmpty { null }
)
) ?: Unit

Expand Down
4 changes: 1 addition & 3 deletions core/src/main/kotlin/com/infinum/collar/Event.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.infinum.collar

import android.os.Bundle

/**
* This is the container model for the triggered tracking analytics event.
*/
Expand All @@ -15,5 +13,5 @@ public data class Event(
/**
* Optional parameters of the tracked analytics event.
*/
val params: Bundle? = null
val params: Map<String, *>? = null
)
File renamed without changes.
4 changes: 2 additions & 2 deletions generator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ java {

compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_1_8.toString()
freeCompilerArgs += [
'-Xjvm-default=all',
'-opt-in=kotlinx.serialization.ExperimentalSerializationApi'
Expand All @@ -24,7 +24,7 @@ compileKotlin {
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
collar = "1.3.6"
collar = "1.3.7"
gradle = "7.2.2"
lint = "30.2.1"
kotlin = "1.7.10"
Expand Down
4 changes: 2 additions & 2 deletions lint/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ java {

compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_1_8.toString()
freeCompilerArgs += [
'-Xjvm-default=all'
]
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}

Expand Down
2 changes: 1 addition & 1 deletion plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ compileKotlin {
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}

Expand Down
4 changes: 2 additions & 2 deletions processor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ java {

compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_1_8.toString()
freeCompilerArgs += [
'-Xjvm-default=all',
'-opt-in=com.squareup.kotlinpoet.metadata.KotlinPoetMetadataPreview'
Expand All @@ -24,7 +24,7 @@ compileKotlin {
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}

Expand Down
Loading

0 comments on commit 28fd477

Please sign in to comment.