-
Notifications
You must be signed in to change notification settings - Fork 153
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
Move Android Studio related code out of GradleScenarioInvoker and rel… #374
Conversation
9b641db
to
343f2a6
Compare
343f2a6
to
659a68a
Compare
659a68a
to
4777180
Compare
src/main/java/org/gradle/profiler/studio/invoker/StudioSample.java
Outdated
Show resolved
Hide resolved
GRADLE_EXECUTION_TIME("Gradle execution time") { | ||
@Override | ||
public Duration extractFrom(BuildInvocationResult result) { | ||
StudioBuildActionResult studioResult = (StudioBuildActionResult) result.getActionResult(); |
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.
We don't want to introduce a StudioBuildInvocationResult
to avoid this cast?
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.
That would be ideal, but it requires some changes, I will check what I can do.
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.
What I did: I created a StudioBuildInvocationResult, and I do a cast there. It's not totally perfect, but I think that right now that is the simplest and cleanest solution.
Otherwise, we would have to inject (or override some method that will return) a custom BuildUnderTestInvoker
into GradleScenarioInvoker
and also create a new InvokeAndMeasureAction
that would return StudioBuildInvocationResult
. Additionally to that, BuildAction
would have to return generic result from run
method and that would require passing generics everywhere and it will get a bit messy.
I would try to avoid that. WDYT?
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.
Alright, one step at a time.
7528009
to
b8f6c61
Compare
b8f6c61
to
71a64c3
Compare
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.
LGTM.
…ated classes
So yeah, I did not introduce generics to BuildAction at the moment since this can complicate things. So right now I just wrap Gradle invoker logic and enhance samples, here is some casting involved that might not be that nice (in
StudioSample
class), but it makes a solution simpler.Fixes: #371