Search in sources :

Example 1 with Application

use of org.applause.lang.applauseDsl.Application in project applause by applause.

the class AbstractBuildStrategy method build.

public void build(IProgressMonitor monitor) throws CoreException {
    if (canBuildProject()) {
        final IFolder folder = getPlatformProject().getFolder(getGeneratedSourcesFolderName());
        // FIXME: maybe we should just create the folder if it's missing?!
        if (!folder.exists())
            return;
        List<EObject> objects = new ArrayList<EObject>();
        for (Delta d : context.getDeltas()) {
            if (d.getNew() != null) {
                for (IEObjectDescription desc : d.getNew().getExportedObjects()) {
                    EObject obj = context.getResourceSet().getEObject(desc.getEObjectURI(), true);
                    EcoreUtil2.resolveAll(context.getResourceSet());
                    objects.add(obj);
                }
            }
        }
        Iterable<Application> applicationObjects = Iterables.filter(objects, Application.class);
        if (!Iterables.isEmpty(applicationObjects)) {
            deletePreviouslyGeneratedFiles(monitor, folder);
        }
        for (Application app : applicationObjects) {
            OutputImpl output = new OutputImpl();
            Outlet outlet = createOutlet(folder);
            configureOutlet(outlet);
            output.addOutlet(outlet);
            // IFolder rootFolder = (IFolder) getPlatformProject().getAdapter(IFolder.class);
            // // IPath location = getPlatformProject().getFullPath();
            // // IFolder rootFolder = ResourcesPlugin.getWorkspace().getRoot().getFolder(location);
            // Outlet projectRootOutlet = createOutlet(rootFolder);
            // projectRootOutlet.setName("ROOT");
            // output.addOutlet(projectRootOutlet);
            generate(app, output);
            copyResources(app, getModelProject().getFolder("/Images"));
            getPlatformProject().build(IncrementalProjectBuilder.CLEAN_BUILD, monitor);
            return;
        }
    }
}
Also used : Delta(org.eclipse.xtext.resource.IResourceDescription.Delta) EObject(org.eclipse.emf.ecore.EObject) ArrayList(java.util.ArrayList) Outlet(org.eclipse.xpand2.output.Outlet) Application(org.applause.lang.applauseDsl.Application) OutputImpl(org.eclipse.xpand2.output.OutputImpl) IFolder(org.eclipse.core.resources.IFolder) IEObjectDescription(org.eclipse.xtext.resource.IEObjectDescription)

Example 2 with Application

use of org.applause.lang.applauseDsl.Application in project applause by applause.

the class ModelImpl method basicSetApplication.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetApplication(Application newApplication, NotificationChain msgs) {
    Application oldApplication = application;
    application = newApplication;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ApplauseDslPackage.MODEL__APPLICATION, oldApplication, newApplication);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) Application(org.applause.lang.applauseDsl.Application)

Aggregations

Application (org.applause.lang.applauseDsl.Application)2 ArrayList (java.util.ArrayList)1 IFolder (org.eclipse.core.resources.IFolder)1 EObject (org.eclipse.emf.ecore.EObject)1 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1 Outlet (org.eclipse.xpand2.output.Outlet)1 OutputImpl (org.eclipse.xpand2.output.OutputImpl)1 IEObjectDescription (org.eclipse.xtext.resource.IEObjectDescription)1 Delta (org.eclipse.xtext.resource.IResourceDescription.Delta)1