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

disable vm install job in jdt #2919

Merged
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
5 changes: 5 additions & 0 deletions tycho-apitools-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@
<artifactId>org.eclipse.jdt.core</artifactId>
<version>3.35.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.launching</artifactId>
<version>3.20.100</version>
</dependency>
<!-- libs -->
<dependency>
<groupId>org.ow2.asm</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,16 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.IJobChangeListener;
import org.eclipse.core.runtime.jobs.IJobManager;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.launching.LaunchingPlugin;
import org.eclipse.osgi.service.resolver.ResolverError;
import org.eclipse.pde.api.tools.internal.BundleListTargetLocation;
import org.eclipse.pde.api.tools.internal.FilterStore;
Expand Down Expand Up @@ -94,8 +100,42 @@ public ApiAnalysis(Collection<Path> baselineBundles, Collection<Path> dependency
public ApiAnalysisResult call() throws Exception {
ApiAnalysisResult result = new ApiAnalysisResult();
Platform.addLogListener((status, plugin) -> debug(status.toString()));
IJobManager jobManager = Job.getJobManager();
jobManager.addJobChangeListener(new IJobChangeListener() {

@Override
public void sleeping(IJobChangeEvent event) {
debug("Job " + event.getJob() + " sleeping...");
}

@Override
public void scheduled(IJobChangeEvent event) {
debug("Job " + event.getJob() + " scheduled...");
}

@Override
public void running(IJobChangeEvent event) {
debug("Job " + event.getJob() + " running...");
}

@Override
public void done(IJobChangeEvent event) {
debug("Job " + event.getJob() + " done...");
}

@Override
public void awake(IJobChangeEvent event) {
debug("Job " + event.getJob() + " awake...");
}

@Override
public void aboutToRun(IJobChangeEvent event) {
debug("Job " + event.getJob() + " aboutToRun...");
}
});
printVersion();
disableAutoBuild();
disableJVMDiscovery();
setTargetPlatform();
deleteAllProjects();
BundleComponent projectComponent = importProject();
Expand Down Expand Up @@ -125,6 +165,12 @@ public ApiAnalysisResult call() throws Exception {
return result;
}

private void disableJVMDiscovery() {
IEclipsePreferences instanceNode = InstanceScope.INSTANCE
.getNode(LaunchingPlugin.getDefault().getBundle().getSymbolicName());
instanceNode.putBoolean(LaunchingPlugin.PREF_DETECT_VMS_AT_STARTUP, false);
}

private BundleComponent importProject() throws CoreException, IOException {
IPath projectPath = IPath.fromOSString(projectDir);
IPath projectDescriptionFile = projectPath.append(IProjectDescription.DESCRIPTION_FILE_NAME);
Expand Down
Loading