Skip to content

Commit

Permalink
build: update segment-java to 3.4.0 and gson to 2.10.1
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Bricon <[email protected]>
  • Loading branch information
fbricon committed Dec 21, 2023
1 parent 117454f commit 3ed5b40
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
11 changes: 9 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,16 @@ publishPlugin {
}

dependencies {
implementation('com.segment.analytics.java:analytics:3.4.0') {
exclude group: 'org.jetbrains.kotlin'
exclude group: 'com.squareup.retrofit2', module: 'retrofit-mock'
exclude group: 'com.google.auto.value', module: 'auto-value-annotations'
}
implementation('com.squareup.okio:okio:3.6.0') {
exclude group: 'org.jetbrains.kotlin'
}
implementation(
'com.segment.analytics.java:analytics:2.1.1',
'com.squareup.okhttp3:okhttp:4.9.3'
'com.google.code.gson:gson:2.10.1'
)
testImplementation(
"org.junit.jupiter:junit-jupiter:5.9.1",
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ jetBrainsToken=invalid
jetBrainsChannel=stable
nexusUser=invalid
nexusPassword=invalid

# https://plugins.jetbrains.com/docs/intellij/using-kotlin.html#kotlin-standard-library
kotlin.stdlib.default.dependency=false
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
package com.redhat.devtools.intellij.telemetry.core.service;

import com.intellij.util.messages.MessageBusConnection;
import com.jakewharton.retrofit.Ok3Client;
import com.redhat.devtools.intellij.telemetry.core.IService;
import com.redhat.devtools.intellij.telemetry.core.configuration.TelemetryConfiguration;
import com.redhat.devtools.intellij.telemetry.core.service.segment.ISegmentConfiguration;
Expand All @@ -26,7 +25,6 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import retrofit.client.Client;

import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -123,7 +121,7 @@ void should_send_feedback() {
// then
}

private Analytics createAnalytics(BlockingFlush blockingFlush, Client client) {
private Analytics createAnalytics(BlockingFlush blockingFlush, OkHttpClient client) {
return Analytics.builder(SEGMENT_WRITE_KEY)
.flushQueueSize(1)
.plugin(new StdOutLogging())
Expand All @@ -132,19 +130,17 @@ private Analytics createAnalytics(BlockingFlush blockingFlush, Client client) {
.build();
}

private Client createClient() {
return new Ok3Client(
new OkHttpClient.Builder()
.connectTimeout(5, TimeUnit.SECONDS)
.readTimeout(5, TimeUnit.SECONDS)
.writeTimeout(5, TimeUnit.SECONDS)
.build());
private OkHttpClient createClient() {
return new OkHttpClient.Builder()
.connectTimeout(5, TimeUnit.SECONDS)
.readTimeout(5, TimeUnit.SECONDS)
.writeTimeout(5, TimeUnit.SECONDS)
.build();
}

private void shutdownAnalytics() {
analytics.flush();
blockingFlush.block();
analytics.shutdown();
}

}

0 comments on commit 3ed5b40

Please sign in to comment.