Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit 24a2cb5

Browse files
prepare 4.14.0 release (#192)
1 parent 4125970 commit 24a2cb5

File tree

15 files changed

+1171
-661
lines changed

15 files changed

+1171
-661
lines changed

build.gradle

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,14 @@ def shadeDependencies(jarTask) {
249249
}
250250

251251
def addOsgiManifest(jarTask, List<Configuration> importConfigs, List<Configuration> exportConfigs) {
252+
// For a prerelease build with "-beta", "-rc", etc., the prerelease qualifier has to be
253+
// removed from the bundle version because OSGi doesn't understand it.
254+
def implementationVersion = version.replaceFirst('-.*$', '')
252255
jarTask.manifest {
253256
attributes(
254-
"Implementation-Version": version,
257+
"Implementation-Version": implementationVersion,
255258
"Bundle-SymbolicName": "com.launchdarkly.client",
256-
"Bundle-Version": version,
259+
"Bundle-Version": implementationVersion,
257260
"Bundle-Name": "LaunchDarkly SDK",
258261
"Bundle-ManifestVersion": "2",
259262
"Bundle-Vendor": "LaunchDarkly"
@@ -270,7 +273,7 @@ def addOsgiManifest(jarTask, List<Configuration> importConfigs, List<Configurati
270273

271274
// Similarly, we're adding package exports for every package in whatever libraries we're
272275
// making publicly available.
273-
def sdkExports = getAllSdkPackages().collect { bundleExport(it, version) }
276+
def sdkExports = getAllSdkPackages().collect { bundleExport(it, implementationVersion) }
274277
def exportedDependencies = forEachArtifactAndVisiblePackage(exportConfigs, { a, p ->
275278
bundleExport(p, a.moduleVersion.id.version)
276279
})

packaging-test/test-app/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ dependencies {
3636

3737
jar {
3838
bnd(
39+
// This consumer-policy directive completely turns off version checking for the test app's
40+
// OSGi imports, so for instance if the app uses version 2.x of package P, the import will
41+
// just be for p rather than p;version="[2.x,3)". One wouldn't normally do this, but we
42+
// need to be able to run the CI tests for snapshot/beta versions, and bnd does not handle
43+
// those correctly (5.0.0-beta1 will become "[5.0.0,6)" which will not work because the
44+
// beta is semantically *before* 5.0.0).
45+
'-consumer-policy': '',
3946
'Bundle-Activator': 'testapp.TestAppOsgiEntryPoint'
4047
)
4148
}

src/main/java/com/launchdarkly/client/Components.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.launchdarkly.client.integrations.PollingDataSourceBuilder;
88
import com.launchdarkly.client.integrations.StreamingDataSourceBuilder;
99
import com.launchdarkly.client.interfaces.DiagnosticDescription;
10+
import com.launchdarkly.client.interfaces.EventSender;
1011
import com.launchdarkly.client.interfaces.HttpAuthentication;
1112
import com.launchdarkly.client.interfaces.HttpConfiguration;
1213
import com.launchdarkly.client.interfaces.PersistentDataStoreFactory;
@@ -393,12 +394,18 @@ public EventProcessor createEventProcessor(String sdkKey, LDConfig config,
393394
if (config.offline || !config.deprecatedSendEvents) {
394395
return new NullEventProcessor();
395396
}
396-
return new DefaultEventProcessor(sdkKey,
397+
URI eventsBaseUri = config.deprecatedEventsURI == null ? LDConfig.DEFAULT_EVENTS_URI : config.deprecatedEventsURI;
398+
EventSender eventSender = new DefaultEventSender.Factory().createEventSender(
399+
sdkKey,
400+
config.httpConfig
401+
);
402+
return new DefaultEventProcessor(
397403
config,
398404
new EventsConfiguration(
399405
config.deprecatedAllAttributesPrivate,
400406
config.deprecatedCapacity,
401-
config.deprecatedEventsURI == null ? LDConfig.DEFAULT_EVENTS_URI : config.deprecatedEventsURI,
407+
eventSender,
408+
eventsBaseUri,
402409
config.deprecatedFlushInterval,
403410
config.deprecatedInlineUsersInEvents,
404411
config.deprecatedPrivateAttrNames,
@@ -407,7 +414,6 @@ public EventProcessor createEventProcessor(String sdkKey, LDConfig config,
407414
config.deprecatedUserKeysFlushInterval,
408415
EventProcessorBuilder.DEFAULT_DIAGNOSTIC_RECORDING_INTERVAL_SECONDS
409416
),
410-
config.httpConfig,
411417
diagnosticAccumulator
412418
);
413419
}
@@ -667,11 +673,15 @@ public EventProcessor createEventProcessor(String sdkKey, LDConfig config, Diagn
667673
if (config.offline) {
668674
return new NullEventProcessor();
669675
}
670-
return new DefaultEventProcessor(sdkKey,
676+
EventSender eventSender =
677+
(eventSenderFactory == null ? new DefaultEventSender.Factory() : eventSenderFactory)
678+
.createEventSender(sdkKey, config.httpConfig);
679+
return new DefaultEventProcessor(
671680
config,
672681
new EventsConfiguration(
673682
allAttributesPrivate,
674683
capacity,
684+
eventSender,
675685
baseURI == null ? LDConfig.DEFAULT_EVENTS_URI : baseURI,
676686
flushIntervalSeconds,
677687
inlineUsersInEvents,
@@ -681,7 +691,6 @@ public EventProcessor createEventProcessor(String sdkKey, LDConfig config, Diagn
681691
userKeysFlushIntervalSeconds,
682692
diagnosticRecordingIntervalSeconds
683693
),
684-
config.httpConfig,
685694
diagnosticAccumulator
686695
);
687696
}

0 commit comments

Comments
 (0)