Search in sources :

Example 1 with BuildContext

use of org.eclipse.xtext.build.BuildContext in project xtext-core by eclipse.

the class IncrementalBuilder method build.

public IncrementalBuilder.Result build(final BuildRequest request, final Function1<? super URI, ? extends IResourceServiceProvider> languages, final IResourceClusteringPolicy clusteringPolicy) {
    try {
        final XtextResourceSet resourceSet = request.getResourceSet();
        ResourceDescriptionsData _copy = request.getState().getResourceDescriptions().copy();
        Source2GeneratedMapping _copy_1 = request.getState().getFileMappings().copy();
        final IndexState oldState = new IndexState(_copy, _copy_1);
        CancelIndicator _cancelIndicator = request.getCancelIndicator();
        final BuildContext context = new BuildContext(languages, resourceSet, oldState, clusteringPolicy, _cancelIndicator);
        final IncrementalBuilder.InternalStatefulIncrementalBuilder builder = this.provider.get();
        builder.context = context;
        builder.request = request;
        try {
            return builder.launch();
        } catch (final Throwable _t) {
            if (_t instanceof Throwable) {
                final Throwable t = (Throwable) _t;
                this._operationCanceledManager.propagateIfCancelException(t);
                throw t;
            } else {
                throw Exceptions.sneakyThrow(_t);
            }
        }
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : ResourceDescriptionsData(org.eclipse.xtext.resource.impl.ResourceDescriptionsData) BuildContext(org.eclipse.xtext.build.BuildContext) XtextResourceSet(org.eclipse.xtext.resource.XtextResourceSet) Source2GeneratedMapping(org.eclipse.xtext.build.Source2GeneratedMapping) CancelIndicator(org.eclipse.xtext.util.CancelIndicator) IndexState(org.eclipse.xtext.build.IndexState)

Aggregations

BuildContext (org.eclipse.xtext.build.BuildContext)1 IndexState (org.eclipse.xtext.build.IndexState)1 Source2GeneratedMapping (org.eclipse.xtext.build.Source2GeneratedMapping)1 XtextResourceSet (org.eclipse.xtext.resource.XtextResourceSet)1 ResourceDescriptionsData (org.eclipse.xtext.resource.impl.ResourceDescriptionsData)1 CancelIndicator (org.eclipse.xtext.util.CancelIndicator)1