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
3 changes: 3 additions & 0 deletions sentry-android-distribution/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@ androidComponents.beforeVariants {

dependencies {
implementation(projects.sentry)
implementation(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other modules force the version (like sentry-android-core) which could cause unexpected behavior in consumers.

I thought using implementation is simpler to understand than a version constraint.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm I guess this is a bit weird that we leak the annotations to the runtime classpath (given that we only need them for compilation), but if there's no easy way around it, it's fine I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annotations are quite leanient in the jvm world IIRC. If their dependencies aren’t present at compile time, it will still work so clients of the library can use an older version and it should be fine.

libs.jetbrains.annotations
) // Use implementation instead of compileOnly to override kotlin stdlib's version
implementation(kotlin(Config.kotlinStdLib, Config.kotlinStdLibVersionAndroid))
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ import io.sentry.Integration
import io.sentry.SentryOptions
import io.sentry.UpdateInfo
import io.sentry.UpdateStatus
import org.jetbrains.annotations.ApiStatus

/**
* The public Android SDK for Sentry Build Distribution.
*
* Provides functionality to check for app updates and download new versions from Sentry's preprod
* artifacts system.
*/
@ApiStatus.Experimental
public class DistributionIntegration(context: Context) : Integration, IDistributionApi {

private lateinit var scopes: IScopes
Expand Down
2 changes: 2 additions & 0 deletions sentry/src/main/java/io/sentry/IDistributionApi.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.sentry;

import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;

/**
Expand All @@ -8,6 +9,7 @@
* <p>Provides methods to check for app updates and download new versions from Sentry's preprod
* artifacts system.
*/
@ApiStatus.Experimental
public interface IDistributionApi {

/**
Expand Down
2 changes: 2 additions & 0 deletions sentry/src/main/java/io/sentry/NoOpDistributionApi.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package io.sentry;

import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;

/** No-op implementation of IDistributionApi. Used when distribution module is not available. */
@ApiStatus.Experimental
public final class NoOpDistributionApi implements IDistributionApi {

private static final NoOpDistributionApi instance = new NoOpDistributionApi();
Expand Down
5 changes: 5 additions & 0 deletions sentry/src/main/java/io/sentry/SentryOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@ public class SentryOptions {
* SentryAndroidOptions, but there's a circular dependency issue between sentry-android-core and
* sentry-android-distribution modules.
*/
@ApiStatus.Experimental
public static final class DistributionOptions {
/** Organization authentication token for API access */
public String orgAuthToken = "";
Expand Down Expand Up @@ -2848,10 +2849,12 @@ public void setReplayController(final @Nullable ReplayController replayControlle
replayController != null ? replayController : NoOpReplayController.getInstance();
}

@ApiStatus.Experimental
public @NotNull IDistributionApi getDistributionController() {
return distributionController;
}

@ApiStatus.Experimental
public void setDistributionController(final @Nullable IDistributionApi distributionController) {
this.distributionController =
distributionController != null ? distributionController : NoOpDistributionApi.getInstance();
Expand Down Expand Up @@ -3567,10 +3570,12 @@ public interface BeforeSendLogCallback {
}
}

@ApiStatus.Experimental
public @NotNull DistributionOptions getDistribution() {
return distribution;
}

@ApiStatus.Experimental
public void setDistribution(final @NotNull DistributionOptions distribution) {
this.distribution = distribution != null ? distribution : new DistributionOptions();
}
Expand Down
2 changes: 2 additions & 0 deletions sentry/src/main/java/io/sentry/UpdateInfo.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package io.sentry;

import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;

/** Information about an available app update. */
@ApiStatus.Experimental
public final class UpdateInfo {
private final @NotNull String id;
private final @NotNull String buildVersion;
Expand Down
2 changes: 2 additions & 0 deletions sentry/src/main/java/io/sentry/UpdateStatus.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package io.sentry;

import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;

/** Represents the result of checking for app updates. */
@ApiStatus.Experimental
public abstract class UpdateStatus {

/** Current app version is up to date, no update available. */
Expand Down
Loading