Skip to main content
summaryrefslogblamecommitdiffstats
blob: 5119a69af4d5d82250bcc5df64c2d76127f90c9f (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                                                                
                                                         







                                                                        


                                                                
                                                                                 



                                       
                                                 
                                             













                                                                         







                                                                                                                      
                                                                                                                           










                                                                     










                                                                                  













                                                                                                    

                                                                                                                           
                                                                                                                                            


                                                      
                                                                   











































































                                                                                                                                                                              

                                                                                        

                 




                                                                   



                                                                  

                                                                     
 
/*******************************************************************************
 * Copyright (c) 2012 Willink Transformations and others.
 * 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
 *
 * Contributors:
 *     E.D.Willink - initial API and implementation
 *
 * Run As->MWE2 Workflow to regenerate the editor.
 * If it fails with a stack dump, open the Xtext file and do
 * a dummy edit. Generally there is an error in the source file.
 *******************************************************************************/
module GenerateQVTrelationEditor

import org.eclipse.emf.mwe.utils.*
import org.eclipse.ocl.examples.build.*
import org.eclipse.ocl.examples.build.utilities.*
import org.eclipse.ocl.examples.build.xtend.*
import org.eclipse.xtext.generator.*
import org.eclipse.xtext.ui.generator.*

var QVTrelation.file.extensions = "qvtr"
var QVTrelationProjectName = "org.eclipse.qvtd.xtext.qvtrelation"
var QVTrelationRuntimeProject = "../../plugins/${QVTrelationProjectName}"

/**
 *	Generate the QVTrelation Editor.
 */
Workflow {
    bean = StandaloneSetup {
		platformUri = "${QVTrelationRuntimeProject}/.."
   		scanClassPath = true
//		registerEcoreFile = "platform:/resource/org.eclipse.ocl.pivot/model/Pivot.ecore"
//		registerEcoreFile = "platform:/resource/org.eclipse.qvtd.pivot.qvtbase/model/QVTbase.ecore"
//		registerEcoreFile = "platform:/resource/org.eclipse.qvtd.pivot.qvttemplate/model/QVTtemplate.ecore"
//		registerEcoreFile = "platform:/resource/org.eclipse.qvtd.pivot.qvtrelation/model/QVTrelation.ecore"
//		registerEcoreFile = "platform:/resource/org.eclipse.ocl.xtext.base/model/BaseCS.ecore"
//		registerEcoreFile = "platform:/resource/org.eclipse.ocl.xtext.essentialocl/model/EssentialOCLCS.ecore"
//		registerEcoreFile = "platform:/resource/org.eclipse.qvtd.xtext.qvtrelation/model/QVTrelationCS.ecore"
		registerGeneratedEPackage = "org.eclipse.qvtd.xtext.qvtrelationcs.QVTrelationCSPackage"
		registerGenModelFile = "platform:/resource/org.eclipse.qvtd.xtext.qvtrelation/model/QVTrelationCS.genmodel"
	}
	
	component = DirectoryCleaner {
		directory = "${QVTrelationRuntimeProject}/src-gen"
	}
	
	component = DirectoryCleaner {
		directory = "${QVTrelationRuntimeProject}.ui/src-gen"
	}
	
	component = Generator {
		fileHeader =
"/*******************************************************************************
 * Copyright (c) 2011, \${year} Willink Transformations and others.
 * 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
 *
 * Contributors:
 *     E.D.Willink - initial API and implementation
 *******************************************************************************/"
		pathRtProject = QVTrelationRuntimeProject
		pathUiProject = "${QVTrelationRuntimeProject}.ui"
		projectNameRt = QVTrelationProjectName
		projectNameUi = "${QVTrelationProjectName}.ui"
		mergeManifest = false

		language = {
			uri = "classpath:/org/eclipse/qvtd/xtext/qvtrelation/QVTrelation.xtext"
			fileExtensions = QVTrelation.file.extensions
			
			// Java API to access grammar elements (required by several other fragments)
			fragment = grammarAccess.GrammarAccessFragment {}
			
			// generates Java API for the generated EPackages 
//			fragment = ecore.EcoreGeneratorFragment {
//				referencedGenModels = "platform:/resource/org.eclipse.emf.erelation/model/Ecore.genmodel"  
//				referencedGenModels = "platform:/resource/org.eclipse.ocl.xtext.essentialocl/model/EssentialOCLCST.genmodel"
//			}
			
			// the serialization component
			fragment = serializer.SerializerFragment {}
			
			// a custom ResourceFactory for use with EMF 
			fragment = resourceFactory.ResourceFactoryFragment {
				fileExtensions = QVTrelation.file.extensions
			}
				
			// the following fragment tries to use the Antlr Generator fragment which can be installed via update manager from http://download.itemis.com/updates/
//			fragment = de.itemis.xtext.antlr.XtextAntlrGeneratorFragment {
//				options = { backtrack = true classSplitting = true }
//			}
			fragment = parser.antlr.XtextAntlrGeneratorFragment {
				options = { backtrack = true classSplitting = true }			
				antlrParam = "-Xconversiontimeout" antlrParam = "10000"
			}
			
			// check-based API for validation
			/*
			fragment = validation.CheckFragment {}
			*/
			 
			// java-based API for validation 
			fragment = validation.JavaValidatorFragment {
                composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
//                composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
            }
            
			// scoping and exporting API
			/*
			fragment = scoping.ImportURIScopingFragment {}
			fragment = exporting.SimpleNamesFragment {}
			*/
			
			// scoping and exporting API 
			fragment = scoping.ImportNamespacesScopingFragment {}
			fragment = exporting.QualifiedNamesFragment {}
			
			// formatter API 
			fragment = formatting.FormatterFragment {}

			// labeling API 
			fragment = labeling.LabelProviderFragment {}

			// outline API 
//			fragment = outline.TransformerFragment {}
//			fragment = outline.OutlineNodeAdapterFactoryFragment {}
			fragment = outline.OutlineTreeProviderFragment {}
			fragment = outline.QuickOutlineFragment {}

			// java-based API for content assistance 
			fragment = contentAssist.JavaBasedContentAssistFragment {}
						
//			fragment = de.itemis.xtext.antlr.XtextAntlrGeneratorFragment {
//				options = { backtrack = true classSplitting = true}
//			}
			fragment = parser.antlr.XtextAntlrUiGeneratorFragment {
				options = { backtrack = true classSplitting = true}			
				antlrParam = "-Xconversiontimeout" antlrParam = "10000"
			}

			fragment = builder.BuilderIntegrationFragment {}

			// project wizard (optional) 
			/*
			fragment = projectWizard.SimpleProjectWizardFragment {
				generatorProjectName = "${projectName}.generator" 
				modelFileExtension = file.extensions
			}
			*/
			
			// quickfix API 
			fragment = quickfix.QuickfixProviderFragment {}			
				
			// EssentialOCL bindings 
			fragment = fragments.EssentialOCLFragment {}							
			// Support Markup in Hover text 
			fragment = fragments.MarkupHoverFragment {}			
			// *.xtextbin support on Xtext 2.3		
			fragment = fragments.CompatibilityFragment {}			
		}
	}
	component = GenerateGrammarXtend {
		javaFolder = "${QVTrelationRuntimeProject}/src-gen"
		javaPackageName = "${QVTrelationProjectName}"
		grammarFileStem = "QVTrelation"
	}
	component = ConvertToUnixLineEndings {
		directory = "${QVTrelationRuntimeProject}/src-gen"
	}
	component = ConvertToUnixLineEndings {
		directory = "${QVTrelationRuntimeProject}.ui/src-gen"
	}
}

Back to the top