Skip to content
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

Prototype use of ide-starter with gradle-profiler #548

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

asodja
Copy link
Member

@asodja asodja commented Mar 22, 2024

There are two important parts:

  1. Load ide-starter dependencies via a different classloader, so we can use gradle-profiler with Java 8 (unless doing syncs)
  2. implement abstraction over ide-starter so we can use it via a nice API

For 1. we have ide-provisiong-api that has just API compiled with Java 8. And then we have also ide-provisioning that is compiled with Java 17.
With Java SPI we then load implementation if required here

URL[] classpath = GradleInstrumentation.getClasspath("ide-provisioning");
RunIdeStarter ideStarter = ServiceLoader.load(RunIdeStarter.class, new URLClassLoader(classpath, RunIdeStarter.class.getClassLoader())).iterator().next();

At build time we embedded ide-provisioning classpath to the main jar. See the change:
https://github.com/gradle/gradle-profiler/pull/548/files#diff-c0dfa6bc7a8685217f70a860145fbdf416d449eaff052fa28352c5cec1a98c06

@asodja asodja self-assigned this Mar 22, 2024
@@ -0,0 +1,8 @@
package org.gradle.profiler.ide;

public interface CommandChain {
Copy link
Member

Choose a reason for hiding this comment

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

🤔 This is looks like leaked to API implementation details. Not sure that it's reasonable for API client to manipulate Command terms for running an IDE. Client wants just to invoke fun sync(project, ide), probably add some VM arguments, but that's it.

WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants