[437] | 1 | module com.framsticks.framclipse.FramScript |
---|
| 2 | |
---|
| 3 | import org.eclipse.emf.mwe.utils.* |
---|
| 4 | import org.eclipse.xtext.generator.* |
---|
| 5 | import org.eclipse.xtext.ui.generator.* |
---|
| 6 | |
---|
| 7 | var grammarURI = "classpath:/com/framsticks/framclipse/FramScript.xtext" |
---|
| 8 | var file.extensions = "neuro, expdef, style, show, script, inc" |
---|
| 9 | var projectName = "com.framsticks.framclipse" |
---|
| 10 | var runtimeProject = "../${projectName}" |
---|
| 11 | |
---|
| 12 | Workflow { |
---|
| 13 | bean = StandaloneSetup { |
---|
| 14 | platformUri = "${runtimeProject}/.." |
---|
| 15 | } |
---|
| 16 | |
---|
| 17 | component = DirectoryCleaner { |
---|
| 18 | directory = "${runtimeProject}/src-gen" |
---|
| 19 | } |
---|
| 20 | |
---|
| 21 | component = DirectoryCleaner { |
---|
| 22 | directory = "${runtimeProject}.ui/src-gen" |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | component = Generator { |
---|
| 26 | pathRtProject = runtimeProject |
---|
| 27 | pathUiProject = "${runtimeProject}.ui" |
---|
| 28 | projectNameRt = projectName |
---|
| 29 | projectNameUi = "${projectName}.ui" |
---|
| 30 | |
---|
| 31 | language = { |
---|
| 32 | uri = grammarURI |
---|
| 33 | fileExtensions = file.extensions |
---|
| 34 | |
---|
| 35 | // Java API to access grammar elements (required by several other fragments) |
---|
| 36 | fragment = grammarAccess.GrammarAccessFragment {} |
---|
| 37 | |
---|
| 38 | // generates Java API for the generated EPackages |
---|
| 39 | fragment = ecore.EcoreGeneratorFragment { |
---|
| 40 | // referencedGenModels = "uri to genmodel, uri to next genmodel" |
---|
| 41 | } |
---|
| 42 | |
---|
| 43 | // the serialization component |
---|
| 44 | fragment = parseTreeConstructor.ParseTreeConstructorFragment {} |
---|
| 45 | |
---|
| 46 | // a custom ResourceFactory for use with EMF |
---|
| 47 | fragment = resourceFactory.ResourceFactoryFragment { |
---|
| 48 | fileExtensions = file.extensions |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | // the following fragment tries to use the Antlr Generator fragment which can be installed via update manager from http://download.itemis.com/updates/ |
---|
| 52 | fragment = AntlrDelegatingFragment {} |
---|
| 53 | |
---|
| 54 | // java-based API for validation |
---|
| 55 | fragment = validation.JavaValidatorFragment { |
---|
| 56 | composedCheck = "org.eclipse.xtext.validation.ImportUriValidator" |
---|
| 57 | composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator" |
---|
| 58 | // registerForImportedPackages = true |
---|
| 59 | } |
---|
| 60 | |
---|
| 61 | // scoping and exporting API |
---|
| 62 | /* |
---|
| 63 | fragment = scoping.ImportURIScopingFragment {} |
---|
| 64 | fragment = exporting.SimpleNamesFragment {} |
---|
| 65 | */ |
---|
| 66 | |
---|
| 67 | // scoping and exporting API |
---|
| 68 | fragment = scoping.ImportURIScopingFragment {} |
---|
| 69 | fragment = exporting.QualifiedNamesFragment {} |
---|
| 70 | |
---|
| 71 | // formatter API |
---|
| 72 | fragment = formatting.FormatterFragment {} |
---|
| 73 | |
---|
| 74 | // labeling API |
---|
| 75 | fragment = labeling.LabelProviderFragment {} |
---|
| 76 | |
---|
| 77 | // outline API |
---|
| 78 | fragment = outline.TransformerFragment {} |
---|
| 79 | fragment = outline.OutlineNodeAdapterFactoryFragment {} |
---|
| 80 | fragment = outline.QuickOutlineFragment {} |
---|
| 81 | |
---|
| 82 | // java-based API for content assistance |
---|
| 83 | fragment = contentAssist.JavaBasedContentAssistFragment {} |
---|
| 84 | |
---|
| 85 | // the following fragment tries to use the Antlr based content assist |
---|
| 86 | // fragment which can be downloaded from http://www.itemis.com |
---|
| 87 | // and will be ignored if it's not available. |
---|
| 88 | fragment = DelegatingGeneratorFragment { |
---|
| 89 | delegate = "de.itemis.xtext.antlr.XtextAntlrUiGeneratorFragment" |
---|
| 90 | message="You are generating without ANTLR. It is highly recommended to download and use the plugin \'de.itemis.xtext.antlr\' \n\t using the update site http:\//download.itemis.com/updates/." |
---|
| 91 | } |
---|
| 92 | |
---|
| 93 | fragment = builder.BuilderIntegrationFragment {} |
---|
| 94 | |
---|
| 95 | // project wizard (optional) |
---|
| 96 | /* |
---|
| 97 | fragment = projectWizard.SimpleProjectWizardFragment { |
---|
| 98 | generatorProjectName = "${projectName}.generator" |
---|
| 99 | modelFileExtension = file.extensions |
---|
| 100 | } |
---|
| 101 | */ |
---|
| 102 | |
---|
| 103 | // quickfix API |
---|
| 104 | fragment = quickfix.QuickfixProviderFragment {} |
---|
| 105 | } |
---|
| 106 | } |
---|
| 107 | } |
---|