Skip to content

Commit

Permalink
Fix Eclipse Plugin imports
Browse files Browse the repository at this point in the history
See gh-277
  • Loading branch information
philwebb committed Oct 7, 2021
1 parent ee6e054 commit 3e962d7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.buildship.core;resolution:=optional,
net.sf.eclipsecs.core;resolution:=optional
Bundle-ClassPath: .,
lib/spring-javaformat-formatter-eclipse.jar,
lib/spring-javaformat-config.jar,
lib/spring-javaformat-formatter.jar,
lib/spring-javaformat-checkstyle.jar
lib/spring-javaformat-checkstyle.jar,
lib/spring-javaformat-formatter-eclipse-jdt-jdk11.jar,
lib/spring-javaformat-formatter-eclipse-jdt-jdk8.jar
Bundle-ActivationPolicy: lazy
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ bin.includes = META-INF/,\
lib/spring-javaformat-checkstyle.jar,\
lib/spring-javaformat-config.jar,\
lib/spring-javaformat-formatter.jar,\
lib/spring-javaformat-formatter-eclipse.jar
lib/spring-javaformat-formatter-eclipse-jdt-jdk11.jar,\
lib/spring-javaformat-formatter-eclipse-jdt-jdk8.jar
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@
<artifactId>spring-javaformat-formatter-eclipse-jdt-jdk8</artifactId>
<version>${project.version}</version>
</additionalDependency>
<additionalDependency>
<groupId>io.spring.javaformat</groupId>
<artifactId>spring-javaformat-formatter-eclipse-jdt-jdk11</artifactId>
<version>${project.version}</version>
</additionalDependency>
</additionalDependencies>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@

package io.spring.javaformat.eclipse;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.core.runtime.Plugin;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

import io.spring.javaformat.eclipse.jdt.core.JavaCore;

/**
* The activator class controls the plug-in life cycle.
*
Expand All @@ -35,22 +37,27 @@ public class Activator extends AbstractUIPlugin {

private static Activator plugin;

private JavaCore javaCore;
private final List<Plugin> javaCorePlugins = new ArrayList<>();

public Activator() {
this.javaCore = new JavaCore();
this.javaCorePlugins.add(new io.spring.javaformat.eclipse.jdt.jdk8.core.JavaCore());
this.javaCorePlugins.add(new io.spring.javaformat.eclipse.jdt.jdk11.core.JavaCore());
}

@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
this.javaCore.start(context);
for (Plugin javaCorePlugin : this.javaCorePlugins) {
javaCorePlugin.start(context);
}
}

@Override
public void stop(BundleContext context) throws Exception {
this.javaCore.stop(context);
for (Plugin javaCorePlugin : this.javaCorePlugins) {
javaCorePlugin.stop(context);
}
plugin = null;
super.stop(context);
}
Expand Down

0 comments on commit 3e962d7

Please sign in to comment.