Skip to content

Commit

Permalink
Change how Kotlin code is used in the Eclipse plugin, because the Kot…
Browse files Browse the repository at this point in the history
…lin Eclipse plugin is extremely buggy.

Update to Spoofax 2.5.0-SNAPSHOT.
  • Loading branch information
Gohla committed Feb 8, 2018
1 parent e877f3d commit edb271a
Show file tree
Hide file tree
Showing 19 changed files with 118 additions and 61 deletions.
2 changes: 1 addition & 1 deletion lang/cfg/example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.metaborg</groupId>
<artifactId>parent.language</artifactId>
<version>2.4.0-SNAPSHOT</version>
<version>2.5.0-SNAPSHOT</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion lang/cfg/langspec/.mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<extension>
<groupId>org.metaborg</groupId>
<artifactId>spoofax-maven-plugin-pomless</artifactId>
<version>2.4.0-SNAPSHOT</version>
<version>2.5.0-SNAPSHOT</version>
</extension>
</extensions>
2 changes: 1 addition & 1 deletion lang/cfg/langspec/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.metaborg</groupId>
<artifactId>parent.language</artifactId>
<version>2.4.0-SNAPSHOT</version>
<version>2.5.0-SNAPSHOT</version>
</parent>

<repositories>
Expand Down
2 changes: 1 addition & 1 deletion lang/cfg/test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.metaborg</groupId>
<artifactId>parent.language</artifactId>
<version>2.4.0-SNAPSHOT</version>
<version>2.5.0-SNAPSHOT</version>
</parent>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.SECONDS)
@State(Scope.Benchmark)
public class PullingExecFullBenchmark {
public class TopDownExecFullBenchmark {
@Setup(Level.Invocation)
public void setup(SpoofaxPieState spoofaxPie, WorkspaceState workspace, InfraState infra, PullingExecState exec) throws IOException {
workspace.setup(spoofaxPie);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@BenchmarkMode(Mode.SingleShotTime)
@OutputTimeUnit(TimeUnit.SECONDS)
@State(Scope.Benchmark)
public class DirtyFlaggingExecIncrBenchmark {
public class BottomUpDirtyTopDownExecIncrBenchmark {
@Setup(Level.Trial)
public void setupTrial(SpoofaxPieState spoofaxPie, WorkspaceState workspace, IncrState incr, InfraState infra, DirtyFlaggingExecState exec) throws IOException {
workspace.setup(spoofaxPie);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@BenchmarkMode(Mode.SingleShotTime)
@OutputTimeUnit(TimeUnit.SECONDS)
@State(Scope.Benchmark)
public class ObservingExecIncrBenchmark {
public class BottomUpObservingExecIncrBenchmark {
@Setup(Level.Trial)
public void setupTrial(SpoofaxPieState spoofaxPie, WorkspaceState workspace, IncrState incr, InfraState infra, ObservingExecState exec) throws IOException {
workspace.setup(spoofaxPie);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.SECONDS)
@State(Scope.Benchmark)
public class PullingExecIncrBenchmark {
public class TopDownExecIncrBenchmark {
@Setup(Level.Trial)
public void setupTrial(SpoofaxPieState spoofaxPie, WorkspaceState workspace, IncrState incr, InfraState infra, PullingExecState exec) throws IOException {
workspace.setup(spoofaxPie);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import kotlin.Unit;
import mb.pie.runtime.core.ExecException;
import mb.pie.runtime.core.exec.DirtyFlaggingExecutor;
import mb.pie.runtime.core.exec.DirtyFlaggingTopDownExecutor;
import mb.pie.runtime.core.exec.ObsFuncApp;
import mb.pie.runtime.core.impl.exec.DirtyFlaggingExecutorImpl;
import mb.pie.runtime.core.impl.exec.DirtyFlaggingTopDownExecutorImpl;
import mb.spoofax.runtime.pie.builder.SpoofaxPipeline;
import mb.util.async.NullCancelled;
import mb.vfs.path.PPath;
Expand All @@ -19,7 +19,7 @@

@State(Scope.Benchmark)
public class DirtyFlaggingExecState {
public DirtyFlaggingExecutor executor;
public DirtyFlaggingTopDownExecutor executor;

public void setup(SpoofaxPieState spoofaxPieState, WorkspaceState workspaceState, InfraState infraState) {
init(spoofaxPieState, workspaceState, infraState);
Expand All @@ -41,7 +41,7 @@ public void exec(WorkspaceState workspaceState, List<PPath> changedPaths) {

private void init(SpoofaxPieState spoofaxPieState, WorkspaceState workspaceState, InfraState infraState) {
this.executor =
new DirtyFlaggingExecutorImpl(infraState.store, infraState.cache, infraState.share, infraState.layer,
new DirtyFlaggingTopDownExecutorImpl(infraState.store, infraState.cache, infraState.share, infraState.layer,
infraState.logger, infraState.funcs, spoofaxPieState.logger);
final PPath root = workspaceState.root;
try(final Stream<PPath> stream = root.list(PPaths.directoryPathMatcher())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
import kotlin.Unit;
import mb.pie.runtime.core.ExecException;
import mb.pie.runtime.core.FuncApp;
import mb.pie.runtime.core.exec.ExecutionVariant;
import mb.pie.runtime.core.exec.ObservingExecutor;
import mb.pie.runtime.core.impl.exec.ObservingExecutorImpl;
import mb.pie.runtime.core.exec.BottomUpObservingExecutor;
import mb.pie.runtime.core.exec.BottomUpObservingExecutorFactory.Variant;
import mb.pie.runtime.core.impl.exec.BottomUpObservingExecutorImpl;
import mb.spoofax.runtime.pie.builder.SpoofaxPipeline;
import mb.spoofax.runtime.pie.generated.processProject;
import mb.util.async.NullCancelled;
import mb.vfs.path.PPath;
import mb.vfs.path.PPaths;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;

Expand All @@ -21,7 +22,9 @@

@State(Scope.Benchmark)
public class ObservingExecState {
public ObservingExecutor executor;
public BottomUpObservingExecutor executor;
@Param({"Naive", "DirtyFlagging"}) public Variant variant;


public void setup(SpoofaxPieState spoofaxPieState, WorkspaceState workspaceState, InfraState infraState) {
init(spoofaxPieState, workspaceState, infraState);
Expand All @@ -41,9 +44,8 @@ public void exec(WorkspaceState workspaceState, List<PPath> changedPaths) {

private void init(SpoofaxPieState spoofaxPieState, WorkspaceState workspaceState, InfraState infraState) {
this.executor =
new ObservingExecutorImpl(infraState.store, infraState.cache, ExecutionVariant.Naive, infraState.share,
infraState.layer,
infraState.logger, spoofaxPieState.logger, infraState.funcs);
new BottomUpObservingExecutorImpl(infraState.store, infraState.cache, variant, infraState.share,
infraState.layer, infraState.logger, spoofaxPieState.logger, infraState.funcs);
final PPath root = workspaceState.root;
try(final Stream<PPath> stream = root.list(PPaths.directoryPathMatcher())) {
for(PPath project : (Iterable<PPath>) stream.filter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import mb.pie.runtime.core.ExecException;
import mb.pie.runtime.core.ExecInfo;
import mb.pie.runtime.core.FuncApp;
import mb.pie.runtime.core.exec.PullingExec;
import mb.pie.runtime.core.impl.exec.PullingExecImpl;
import mb.pie.runtime.core.exec.TopDownExec;
import mb.pie.runtime.core.impl.exec.TopDownExecImpl;
import mb.util.async.NullCancelled;
import mb.vfs.path.PPath;
import org.openjdk.jmh.annotations.Scope;
Expand All @@ -15,17 +15,17 @@

@State(Scope.Benchmark)
public class PullingExecState {
public PullingExec exec;
public TopDownExec exec;

public void setup(InfraState infraState) {
this.exec =
new PullingExecImpl(infraState.store, infraState.cache, infraState.share, infraState.layer.get(),
new TopDownExecImpl(infraState.store, infraState.cache, infraState.share, infraState.layer.get(),
infraState.logger.get(), infraState.funcs);
}

public void renew(InfraState infraState) {
this.exec =
new PullingExecImpl(infraState.store, infraState.cache, infraState.share, infraState.layer.get(),
new TopDownExecImpl(infraState.store, infraState.cache, infraState.share, infraState.layer.get(),
infraState.logger.get(), infraState.funcs);
}

Expand Down
24 changes: 23 additions & 1 deletion runtime/eclipse.externaldeps/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,28 @@
<parent>
<groupId>org.metaborg</groupId>
<artifactId>parent</artifactId>
<version>2.4.0-SNAPSHOT</version>
<version>2.5.0-SNAPSHOT</version>
<relativePath />
</parent>

<dependencies>
<!-- Kotlin code -->
<dependency>
<groupId>org.metaborg</groupId>
<artifactId>pie.runtime.core</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.metaborg</groupId>
<artifactId>pie.runtime.builtin</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.metaborg</groupId>
<artifactId>spoofax.runtime.pie</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>

<!-- kotlin-stdlib -->
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
Expand Down Expand Up @@ -156,6 +173,9 @@
<Bundle-Version>$(replace;${project.version};-SNAPSHOT;.${forceContextQualifier})</Bundle-Version>
<!-- Embed dependencies into plugin bundle, so they are exportable. -->
<Embed-Dependency>
pie.runtime.core,
pie.runtime.builtin,
spoofax.runtime.pie,
kotlin-stdlib,
kotlin-stdlib-jdk8,
kotlin-stdlib-jdk7,
Expand All @@ -176,6 +196,8 @@
</Embed-Dependency>
<!-- Export dependency packages -->
<Export-Package>
mb.pie.*,
mb.spoofax.runtime.pie.*,
kotlin.*;provider=metaborg;mandatory:=provider;version=0,
kotlinx.*;provider=metaborg;mandatory:=provider;version=0,
org.jetbrains.annotations.*;provider=metaborg;mandatory:=provider;version=0,
Expand Down
10 changes: 2 additions & 8 deletions runtime/eclipse/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,10 @@ Require-Bundle: org.eclipse.core.runtime,
log,
vfs,
util,
pie.runtime.core,
pie.runtime.builtin,
spoofax.runtime.model,
spoofax.runtime.impl,
spoofax.runtime.impl.legacy,
spoofax.runtime.eclipse.externaldeps,
spoofax.runtime.pie
spoofax.runtime.eclipse.externaldeps
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Vendor: metaborg.org
Bundle-ActivationPolicy: lazy
Expand All @@ -55,11 +52,8 @@ Eclipse-RegisterBuddy:
log,
vfs,
util,
pie.runtime.core,
pie.runtime.builtin,
spoofax.runtime.model,
spoofax.runtime.impl,
spoofax.runtime.impl.legacy,
spoofax.runtime.eclipse.externaldeps,
spoofax.runtime.pie
spoofax.runtime.eclipse.externaldeps
Import-Package: mb.util.async

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions runtime/eclipse/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
<parent>
<groupId>org.metaborg</groupId>
<artifactId>parent.eclipse.plugin</artifactId>
<version>2.4.0-SNAPSHOT</version>
<version>2.5.0-SNAPSHOT</version>
<relativePath />
</parent>

<dependencies>
<dependency>
<!--dependency>
<groupId>org.metaborg</groupId>
<artifactId>pie.runtime.core</artifactId>
<version>0.1.0-SNAPSHOT</version>
Expand All @@ -25,7 +25,7 @@
<groupId>org.metaborg</groupId>
<artifactId>pie.runtime.builtin</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
</dependency-->

<dependency>
<groupId>org.metaborg</groupId>
Expand All @@ -37,6 +37,11 @@
<artifactId>spoofax.runtime.impl</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
<!-->dependency>
<groupId>org.metaborg</groupId>
<artifactId>spoofax.runtime.pie</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency-->

<dependency>
<groupId>org.metaborg</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import mb.log.Logger;
import mb.pie.runtime.core.ExecException;
import mb.pie.runtime.core.FuncApp;
import mb.pie.runtime.core.exec.DirtyFlaggingExecutor;
import mb.pie.runtime.core.exec.DirtyFlaggingTopDownExecutor;
import mb.pie.runtime.core.exec.ObsFuncApp;
import mb.spoofax.runtime.eclipse.SpoofaxPlugin;
import mb.spoofax.runtime.eclipse.editor.SpoofaxEditor;
Expand All @@ -41,7 +41,7 @@ public class DirtyFlaggingPipelineAdapter implements PipelineAdapter {

private final IWorkspaceRoot eclipseRoot;
private final PPath root;
private final DirtyFlaggingExecutor executor;
private final DirtyFlaggingTopDownExecutor executor;


@Inject public DirtyFlaggingPipelineAdapter(PipelineObservers observers, PipelinePathChanges pathChanges,
Expand All @@ -57,7 +57,7 @@ public class DirtyFlaggingPipelineAdapter implements PipelineAdapter {
this.eclipseRoot = ResourcesPlugin.getWorkspace().getRoot();
this.root = pathSrv.resolve(eclipseRoot);

this.executor = pieSrv.getDirtyFlaggingExecutor(root, SpoofaxPlugin.useInMemoryStore);
this.executor = pieSrv.getDirtyFlaggingTopDownExecutor(root, SpoofaxPlugin.useInMemoryStore);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import mb.log.Logger;
import mb.pie.runtime.core.ExecException;
import mb.pie.runtime.core.FuncApp;
import mb.pie.runtime.core.exec.ExecutionVariant;
import mb.pie.runtime.core.exec.ObservingExecutor;
import mb.pie.runtime.core.exec.BottomUpObservingExecutor;
import mb.pie.runtime.core.exec.BottomUpObservingExecutorFactory;
import mb.spoofax.runtime.eclipse.SpoofaxPlugin;
import mb.spoofax.runtime.eclipse.editor.SpoofaxEditor;
import mb.spoofax.runtime.eclipse.util.Nullable;
Expand All @@ -43,7 +43,7 @@ public class ObservingPipelineAdapter implements PipelineAdapter {

private final IWorkspaceRoot eclipseRoot;
private final PPath root;
private final ObservingExecutor executor;
private final BottomUpObservingExecutor executor;


@Inject public ObservingPipelineAdapter(PipelineObservers observers, PipelinePathChanges pathChanges, Logger logger,
Expand All @@ -59,7 +59,8 @@ public class ObservingPipelineAdapter implements PipelineAdapter {
this.eclipseRoot = ResourcesPlugin.getWorkspace().getRoot();
this.root = pathSrv.resolve(eclipseRoot);

this.executor = pieSrv.getObservingExecutor(root, SpoofaxPlugin.useInMemoryStore, ExecutionVariant.DirtyFlagging);
this.executor = pieSrv.getBottomUpObservingExecutor(root, SpoofaxPlugin.useInMemoryStore,
BottomUpObservingExecutorFactory.Variant.DirtyFlagging);
}


Expand Down
34 changes: 33 additions & 1 deletion runtime/pie/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<groupId>org.metaborg</groupId>
<artifactId>parent.java</artifactId>
<version>2.5.0-SNAPSHOT</version>
<relativePath/>
<relativePath />
</parent>

<properties>
Expand Down Expand Up @@ -190,5 +190,37 @@
</executions>
</plugin>
</plugins>

<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the
Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<versionRange>[1.2.20,)</versionRange>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Loading

0 comments on commit edb271a

Please sign in to comment.