-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement gradle plugin to facilitate okhttp instrumentation #137
Conversation
id("dependency-license-config") | ||
id("java-gradle-plugin") | ||
id("maven-publish") | ||
id("com.vanniktech.maven.publish") version "0.28.0" apply false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can just reference the libs catalog we use everywhere alias(libs.plugins.maven.publish)
} | ||
|
||
apply { | ||
plugin("com.vanniktech.maven.publish") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why it doesn't apply it at top just to do it here, maybe some weird ordering issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cargo culting the upstream repo, let me see if i can simplify
|
||
id("dependency-license-config") | ||
id("java-gradle-plugin") | ||
id("maven-publish") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nah, removed
/** | ||
* See https://github.com/getsentry/sentry/blob/c943de2afc785083554e7fdfb10c67d0c0de0f98/static/app/components/events/eventEntries.tsx#L57-L58 | ||
*/ | ||
private val MINIFIED_CLASSNAME_SENTRY_REGEX = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -85,6 +85,8 @@ cargo { | |||
targetDirectory = "../../../target" | |||
targets = listOf("arm64", "x86_64") | |||
pythonCommand = "python3" | |||
rustcCommand = "/Users/snow/.cargo/bin/rustc" | |||
cargoCommand = "/Users/snow/.cargo/bin/cargo" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a chance the gradle update broke the tool resolution but I can't seem to reproduce so will just remove this unless we run into CI issues. We can revert the gradle change / fix upstream if it becomes an issue
Yell at me if you get errors about rustc
not found :)
@@ -147,7 +147,6 @@ class FirstFragment : Fragment() { | |||
|
|||
private fun provideOkHttpClient(): OkHttpClient { | |||
return OkHttpClient.Builder() | |||
.eventListenerFactory(CaptureOkHttpEventListenerFactory()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are multiple okhttp clients will it affect them all? e.g. if they use a separate one for apollo graphql
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the plugin will traverse all the clients in the system and add it everywhere. If using both at the same time causes issues we should figure out how to make the interoperate well, this is probably easier than trying to figure out how to make it conditional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i'm working on that pr now, i'll think about it
@@ -16,6 +16,7 @@ import androidx.navigation.ui.AppBarConfiguration | |||
import androidx.navigation.ui.navigateUp | |||
import androidx.navigation.ui.setupActionBarWithNavController | |||
import io.bitdrift.gradletestapp.databinding.ActivityMainBinding | |||
import okhttp3.OkHttpClient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
@@ -1,6 +1,6 @@ | |||
distributionBase=GRADLE_USER_HOME | |||
distributionPath=wrapper/dists | |||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip | |||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make sure to also update bazel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can do this separately
This adds a gradle plugin inspired by https://github.com/getsentry/sentry-android-gradle-plugin that allows us to automatically install the OkHttpEventListener for all Okhttp clients.