/*
 * Copyright (c) 2011 Google Inc.
 *
 * All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse
 * Public License v1.0 which accompanies this distribution, and is available at
 *
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Generated by Xtext
 */
module com.google.eclipse.protobuf.Protobuf

import com.google.eclipse.protobuf.*
import org.eclipse.emf.mwe.utils.*
import org.eclipse.xtext.generator.*
import org.eclipse.xtext.ui.generator.*

var grammarURI = "classpath:/com/google/eclipse/protobuf/Protobuf.xtext"
var file.extensions = "proto, protodevel"
var projectName = "com.google.eclipse.protobuf"
var runtimeProject = "../${projectName}"

Workflow {
  bean = StandaloneSetup {
    platformUri = "${runtimeProject}/.."
  }

  component = DirectoryCleaner {
    directory = "${runtimeProject}/src-gen"
  }

  component = DirectoryCleaner {
    directory = "${runtimeProject}.ui/src-gen"
  }

  component = ProtobufGenerator {
    pathRtProject = runtimeProject
    pathUiProject = "${runtimeProject}.ui"
    projectNameRt = projectName
    projectNameUi = "${projectName}.ui"
    language = {
      uri = grammarURI
      fileExtensions = file.extensions

      // Java API for accessing grammar elements (required by several other fragments)
      fragment = grammarAccess.GrammarAccessFragment {}

      // Generates Java API for the generated EPackages
      fragment = ecore.EMFGeneratorFragment {
      // referencedGenModels = "uri to genmodel, uri to next genmodel"
      }

      // Serializer 2.0
      fragment = serializer.SerializerFragment {
        generateStub = false
      }

      // The serialization component
      // fragment = parseTreeConstructor.ParseTreeConstructorFragment {}

      // A custom ResourceFactory for use with EMF
      fragment = resourceFactory.ResourceFactoryFragment {
        fileExtensions = file.extensions
      }

      // The antlr parser generator fragment.
      fragment = parser.antlr.XtextAntlrGeneratorFragment {
        // options = {
        //  backtrack = true
        // }
      }

      // Java-based API for validation
      fragment = validation.JavaValidatorFragment {
      // composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
      // composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
      // registerForImportedPackages = true
      }

      // Scoping and exporting API
      // fragment = scoping.ImportURIScopingFragment {}
      // fragment = exporting.SimpleNamesFragment {}

      // Scoping and exporting API
      fragment = scoping.ProtobufImportNamespacesScopingFragment {}
      fragment = exporting.QualifiedNamesFragment {}
      fragment = builder.BuilderIntegrationFragment {}

      // Formatter API
      fragment = formatting.FormatterFragment {}

      // Labeling API
      fragment = labeling.LabelProviderFragment {}

      // Outline API
      fragment = outline.OutlineTreeProviderFragment {}
      fragment = outline.QuickOutlineFragment {}

      // Quickfix API
      fragment = quickfix.QuickfixProviderFragment {}

      // Rename refactoring
      fragment = refactoring.RefactorElementNameFragment {}

      // Content assist API
      fragment = contentAssist.JavaBasedContentAssistFragment {}

      // Generates a more lightweight Antlr parser and lexer tailored for content assist
      fragment = parser.antlr.XtextAntlrUiGeneratorFragment {
        // options = {
        //   backtrack = true
        // }
      }

      // Project wizard (optional)
      // fragment = projectWizard.SimpleProjectWizardFragment {
      //   generatorProjectName = "${projectName}.generator"
      //   modelFileExtension = file.extensions
      // }
    }
  }
}
