Skip to content

Commit

Permalink
Merge pull request #28 from CleverTap/task/upgrade-segment-to-core-702
Browse files Browse the repository at this point in the history
feat: Updating segment with core 7.0.2
  • Loading branch information
CTLalit authored Nov 7, 2024
2 parents 4047002 + 8cf968c commit 30fc857
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 25 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGE LOG

Version 1.7.0 (28 October, 2024)
===================================
*(Supports analytics-android 4.11.3, and Supports CleverTap 7.0.2)*

Version 1.6.0 (14 June, 2023)
===================================
*(Supports analytics-android 4.11.3, and Supports CleverTap 5.0.0)*
Expand Down
25 changes: 13 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.google.gms:google-services:4.3.15'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21"
classpath 'com.android.tools.build:gradle:8.2.2'
classpath 'com.google.gms:google-services:4.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20"
}
}

Expand All @@ -32,7 +32,7 @@ ext {
siteUrl = 'https://github.com/CleverTap/clevertap-segment-android'
gitUrl = 'https://github.com/CleverTap/clevertap-segment-android.git'

libraryVersion = '1.6.0'
libraryVersion = '1.7.0'


licenseName = 'The MIT License (MIT)'
Expand All @@ -55,14 +55,13 @@ group = publishedGroupId


android {
compileSdkVersion 33
buildToolsVersion '33.0.0'
compileSdkVersion 34

defaultConfig {
minSdkVersion 19
targetSdkVersion 33
versionCode 10600
versionName "1.6.0"
targetSdkVersion 34
versionCode 10700
versionName "1.7.0"
}

compileOptions {
Expand Down Expand Up @@ -102,11 +101,14 @@ android {
}
}
}

namespace 'com.segment.analytics.android.integrations.clevertap'
}

task sourcesJar(type: Jar) {
archiveBaseName.set("$artifact")
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
archiveClassifier.set('sources')
}

artifacts {
Expand Down Expand Up @@ -205,8 +207,7 @@ dependencies {
compileOnly 'com.segment.analytics.android:analytics:4.11.3'
compileOnly 'androidx.annotation:annotation:1.2.0'

implementation 'com.clevertap.android:clevertap-android-sdk:5.0.0'

implementation 'com.clevertap.android:clevertap-android-sdk:7.0.2'

testImplementation 'androidx.test:core:1.4.0'
testImplementation 'androidx.core:core:1.4.0'
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ POM_LICENCE_DIST=repo

POM_DEVELOPER_ID=clevertap
POM_DEVELOPER_NAME=CleverTap
android.useAndroidX=true
android.useAndroidX=true

android.defaults.buildfeatures.buildconfig=true
org.gradle.jvmargs=-Xmx4g
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-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.net.Uri;
import android.os.Bundle;

import com.clevertap.android.sdk.BuildConfig;
import com.clevertap.android.sdk.CleverTapAPI;
import com.segment.analytics.Analytics;
import com.segment.analytics.Properties;
Expand Down Expand Up @@ -53,6 +54,15 @@ public class CleverTapIntegration extends Integration<CleverTapAPI> {

private static final Map<String, String> MAP_KNOWN_PROFILE_FIELDS;

static {
Map<String, String> knownFieldsMap = new LinkedHashMap<>();
knownFieldsMap.put("phone", "Phone");
knownFieldsMap.put("name", "Name");
knownFieldsMap.put("email", "Email");
knownFieldsMap.put("birthday", "DOB");
MAP_KNOWN_PROFILE_FIELDS = Collections.unmodifiableMap(knownFieldsMap);
}

public static final Factory FACTORY = new Factory() {
@Override
public Integration<?> create(ValueMap settings, Analytics analytics) {
Expand Down Expand Up @@ -95,7 +105,7 @@ public CleverTapIntegration(CleverTapAPI instance, Logger logger) {
this.mLogger = logger;
if (this.cl != null) {
this.cl.setLibrary("Segment-Android");
this.cl.setCustomSdkVersion("Segment-Android", (int) BuildConfig.VERSION_CODE);
this.cl.setCustomSdkVersion("Segment-Android", BuildConfig.VERSION_CODE);
}
}

Expand Down Expand Up @@ -341,14 +351,4 @@ private void handleOrderCompleted(TrackPayload track) {
cl.pushError("Error handling Order Completed: " + t.getMessage(), 512);
}
}

static {
Map<String, String> knownFieldsMap = new LinkedHashMap<>();
knownFieldsMap.put("phone", "Phone");
knownFieldsMap.put("name", "Name");
knownFieldsMap.put("email", "Email");
knownFieldsMap.put("birthday", "DOB");
MAP_KNOWN_PROFILE_FIELDS = Collections.unmodifiableMap(knownFieldsMap);
}

}

0 comments on commit 30fc857

Please sign in to comment.