Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import com.android.build.gradle.BaseExtension
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext {
kotlin_version = '2.2.0'
}
repositories {
mavenCentral()
google()
Expand All @@ -18,7 +13,6 @@ buildscript {
// For displaying method/field counts when building with Gradle:
// https://github.com/KeepSafe/dexcount-gradle-plugin
classpath("com.getkeepsafe.dexcount:dexcount-gradle-plugin:4.0.0")
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down Expand Up @@ -76,11 +70,6 @@ subprojects { subproject ->
plugins.withId("com.android.library") {
configureAndroidModule(subproject)
}
tasks.withType(KotlinCompile).configureEach {
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
}
}
tasks.withType(JavaCompile).configureEach {
// enable deprecation checks
options.compilerArgs += "-Xlint:deprecation"
Expand Down
1 change: 0 additions & 1 deletion contract-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ plugins {
id("com.android.application")
// make sure this line comes *after* you apply the Android plugin
id("com.getkeepsafe.dexcount")
id 'org.jetbrains.kotlin.android'
}

android {
Expand Down
1 change: 0 additions & 1 deletion example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ plugins {
id("com.android.application")
// make sure this line comes *after* you apply the Android plugin
id("com.getkeepsafe.dexcount")
id 'org.jetbrains.kotlin.android'
}

android {
Expand Down
1 change: 0 additions & 1 deletion launchdarkly-android-client-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ plugins {
id("signing")
id("maven-publish")
id("com.getkeepsafe.dexcount")
id 'org.jetbrains.kotlin.android'
}

group = "com.launchdarkly"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
package com.launchdarkly.sdk.android.integrations;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import java.util.Collections;
import java.util.List;
import java.util.Objects;

/**
* Result of attempting to register all configured {@link Plugin}s during SDK initialization.
*
* <p>This is a closed type hierarchy with exactly two subtypes: {@link Success} and {@link Failure}.
*/
public abstract class RegistrationCompleteResult {

private RegistrationCompleteResult() {
// sealed: only the nested subtypes may extend this class.
}

/**
* @return a {@link Success} result indicating that every plugin registered without error.
*/
@NonNull
public static RegistrationCompleteResult success() {
return Success.INSTANCE;
}

/**
* @param failures the per-plugin failures collected during registration; must be non-null.
* @return a {@link Failure} result wrapping the supplied failures.
*/
@NonNull
public static RegistrationCompleteResult failure(@NonNull List<Failure.PluginFailure> failures) {
return new Failure(failures);
}

/**
* Indicates that all plugins registered successfully.
*/
public static final class Success extends RegistrationCompleteResult {
/** The single instance. */
public static final Success INSTANCE = new Success();

private Success() {}

@Override public boolean equals(Object other) { return other instanceof Success; }
@Override public int hashCode() { return Success.class.hashCode(); }
@Override public String toString() { return "Success"; }
}

/**
* Indicates that one or more plugins failed to register. The wrapped list contains
* the failure details for each plugin that threw during registration.
*/
public static final class Failure extends RegistrationCompleteResult {
@NonNull private final List<PluginFailure> failures;

public Failure(@NonNull List<PluginFailure> failures) {
this.failures = Collections.unmodifiableList(failures);
}

@NonNull
public List<PluginFailure> getFailures() {
return failures;
}

@Override
public boolean equals(Object other) {
if (this == other) return true;
if (!(other instanceof Failure)) return false;
return failures.equals(((Failure) other).failures);
}

@Override
public int hashCode() {
return failures.hashCode();
}

@Override
public String toString() {
return "Failure(failures=" + failures + ")";
}

/**
* Details about a single plugin's registration failure.
*/
public static final class PluginFailure {
@NonNull private final String pluginName;
@Nullable private final String message;
@Nullable private final Throwable cause;

public PluginFailure(@NonNull String pluginName, @Nullable String message, @Nullable Throwable cause) {
this.pluginName = pluginName;
this.message = message;
this.cause = cause;
}

@NonNull
public String getPluginName() {
return pluginName;
}

@Nullable
public String getMessage() {
return message;
}

@Nullable
public Throwable getCause() {
return cause;
}

@Override
public boolean equals(Object other) {
if (this == other) return true;
if (!(other instanceof PluginFailure)) return false;
PluginFailure that = (PluginFailure) other;
return pluginName.equals(that.pluginName)
&& Objects.equals(message, that.message)
&& Objects.equals(cause, that.cause);
}

@Override
public int hashCode() {
return Objects.hash(pluginName, message, cause);
}

@Override
public String toString() {
return "PluginFailure(pluginName=" + pluginName
+ ", message=" + message
+ ", cause=" + cause + ")";
}
}
}
}

This file was deleted.

1 change: 0 additions & 1 deletion shared-test-code/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
id("com.android.library")
id("com.getkeepsafe.dexcount")
id 'org.jetbrains.kotlin.android'
}

group = "com.launchdarkly"
Expand Down
Loading