Ed Willink | 17785c5 | 2014-05-20 12:29:51 +0100 | [diff] [blame] | 1 | /******************************************************************************* |
Ed Willink | 52e3d06 | 2015-05-19 10:14:44 +0100 | [diff] [blame] | 2 | * Copyright (c) 2011 Willink Transformations and others. |
Ed.Willink | 83f9a0a | 2011-08-09 19:13:12 +0100 | [diff] [blame] | 3 | * All rights reserved. This program and the accompanying materials |
Ed Willink | 2b4d8be | 2018-06-13 11:53:02 +0100 | [diff] [blame] | 4 | * are made available under the terms of the Eclipse Public License v2.0 |
Ed.Willink | 83f9a0a | 2011-08-09 19:13:12 +0100 | [diff] [blame] | 5 | * which accompanies this distribution, and is available at |
Ed Willink | 2b4d8be | 2018-06-13 11:53:02 +0100 | [diff] [blame] | 6 | * http://www.eclipse.org/legal/epl-v20.html |
Ed.Willink | 83f9a0a | 2011-08-09 19:13:12 +0100 | [diff] [blame] | 7 | * |
| 8 | * Contributors: |
| 9 | * E.D.Willink - initial API and implementation |
| 10 | * |
Ed.Willink | 83f9a0a | 2011-08-09 19:13:12 +0100 | [diff] [blame] | 11 | * Run As->MWE2 Workflow to regenerate the editor. |
| 12 | * If it fails with a stack dump, open the Xtext file and do |
| 13 | * a dummy edit. Generally there is an error in the source file. |
Ed Willink | 17785c5 | 2014-05-20 12:29:51 +0100 | [diff] [blame] | 14 | *******************************************************************************/ |
Ed.Willink | 83f9a0a | 2011-08-09 19:13:12 +0100 | [diff] [blame] | 15 | module GenerateMarkupEditor |
| 16 | |
Ed Willink | b376309 | 2020-06-12 15:33:10 +0100 | [diff] [blame] | 17 | import org.eclipse.xtext.xtext.generator.* |
| 18 | import org.eclipse.xtext.xtext.generator.model.project.* |
| 19 | import org.eclipse.xtext.xtext.generator.ui.codemining.CodeMiningFragment |
Ed.Willink | 83f9a0a | 2011-08-09 19:13:12 +0100 | [diff] [blame] | 20 | |
Ed Willink | a55dbe4 | 2015-02-24 21:49:23 +0000 | [diff] [blame] | 21 | var markupProjectName = "org.eclipse.ocl.xtext.markup" |
| 22 | var markupRuntimeProject = "../../plugins/${markupProjectName}" |
Ed.Willink | 83f9a0a | 2011-08-09 19:13:12 +0100 | [diff] [blame] | 23 | |
Ed Willink | b376309 | 2020-06-12 15:33:10 +0100 | [diff] [blame] | 24 | var rootPath = "../../plugins" |
| 25 | |
Ed.Willink | 83f9a0a | 2011-08-09 19:13:12 +0100 | [diff] [blame] | 26 | /** |
| 27 | * Generate the markup Editor. |
| 28 | */ |
| 29 | Workflow { |
Ed Willink | b376309 | 2020-06-12 15:33:10 +0100 | [diff] [blame] | 30 | bean = org.eclipse.emf.mwe.utils.StandaloneSetup { |
Ed.Willink | 916daad | 2011-10-21 23:00:14 +0100 | [diff] [blame] | 31 | scanClassPath = true |
Ed Willink | b4d1668 | 2013-04-11 15:01:58 +0100 | [diff] [blame] | 32 | platformUri = ".." |
Ed Willink | 8ecbb22 | 2014-12-05 15:40:39 +0000 | [diff] [blame] | 33 | registerGeneratedEPackage = "org.eclipse.ocl.xtext.markupcs.MarkupPackage" |
Ed Willink | 6284259 | 2014-12-05 13:07:26 +0000 | [diff] [blame] | 34 | registerGenModelFile = "platform:/resource/org.eclipse.ocl.xtext.markup/model/Markup.genmodel" |
Ed.Willink | 83f9a0a | 2011-08-09 19:13:12 +0100 | [diff] [blame] | 35 | } |
| 36 | |
Ed Willink | b376309 | 2020-06-12 15:33:10 +0100 | [diff] [blame] | 37 | component = XtextGenerator { |
| 38 | standaloneSetup = XtextGeneratorStandaloneSetup { |
| 39 | scanClasspath = false |
| 40 | } |
| 41 | configuration = org.eclipse.ocl.examples.build.fragments.MyDefaultGeneratorModule { |
| 42 | project = org.eclipse.ocl.examples.build.fragments.MyStandardProjectConfig { |
| 43 | activatorName = "MarkupActivator" |
| 44 | baseName = "${markupProjectName}" |
| 45 | rootPath = rootPath |
| 46 | runtimeTest = { |
| 47 | enabled = false |
| 48 | } |
| 49 | eclipsePlugin = { |
| 50 | enabled = true |
| 51 | } |
| 52 | eclipsePluginTest = { |
| 53 | enabled = false |
| 54 | } |
| 55 | genericIde = { |
| 56 | enabled = true |
| 57 | name = "${markupProjectName}.ui" |
| 58 | } |
| 59 | createEclipseMetaData = true |
| 60 | } |
| 61 | code = { |
| 62 | preferXtendStubs = false |
Ed Willink | 09a1c0e | 2023-10-05 20:49:53 +0100 | [diff] [blame] | 63 | lineDelimiter = "\n" |
Ed Willink | b376309 | 2020-06-12 15:33:10 +0100 | [diff] [blame] | 64 | encoding = "UTF-8" |
| 65 | fileHeader = |
Ed Willink | 8435f24 | 2016-01-04 21:04:04 +0000 | [diff] [blame] | 66 | "/******************************************************************************* |
| 67 | * Copyright (c) 2011, \${year} Willink Transformations and others. |
| 68 | * All rights reserved. This program and the accompanying materials |
Ed Willink | 2b4d8be | 2018-06-13 11:53:02 +0100 | [diff] [blame] | 69 | * are made available under the terms of the Eclipse Public License v2.0 |
Ed Willink | 8435f24 | 2016-01-04 21:04:04 +0000 | [diff] [blame] | 70 | * which accompanies this distribution, and is available at |
Ed Willink | 2b4d8be | 2018-06-13 11:53:02 +0100 | [diff] [blame] | 71 | * http://www.eclipse.org/legal/epl-v20.html |
Ed Willink | 8435f24 | 2016-01-04 21:04:04 +0000 | [diff] [blame] | 72 | * |
Ed Willink | b376309 | 2020-06-12 15:33:10 +0100 | [diff] [blame] | 73 | * SPDX-License-Identifier: EPL-2.0 |
| 74 | * |
Ed Willink | 8435f24 | 2016-01-04 21:04:04 +0000 | [diff] [blame] | 75 | * Contributors: |
| 76 | * E.D.Willink - initial API and implementation |
| 77 | *******************************************************************************/" |
Ed.Willink | 83f9a0a | 2011-08-09 19:13:12 +0100 | [diff] [blame] | 78 | } |
Ed Willink | b376309 | 2020-06-12 15:33:10 +0100 | [diff] [blame] | 79 | } |
Ed Willink | 0f3b96c | 2023-10-07 13:18:50 +0100 | [diff] [blame] | 80 | language = org.eclipse.ocl.examples.build.fragments.MyStandardLanguage { |
Ed Willink | b376309 | 2020-06-12 15:33:10 +0100 | [diff] [blame] | 81 | name = "${markupProjectName}.Markup" |
| 82 | fileExtensions = "markupocl" |
Ed Willink | 63ea197 | 2023-11-10 09:32:45 +0000 | [diff] [blame] | 83 | grammarUri = "platform:/resource/${markupProjectName}/src/org/eclipse/ocl/xtext/markup/Markup.xtext" |
Ed Willink | b376309 | 2020-06-12 15:33:10 +0100 | [diff] [blame] | 84 | generator = null |
Ed Willink | d0260ba | 2023-10-06 20:45:23 +0100 | [diff] [blame] | 85 | serializer = org.eclipse.ocl.examples.build.fragments.DeclarativeSerializerFragmentXtend { |
Ed Willink | 09a1c0e | 2023-10-05 20:49:53 +0100 | [diff] [blame] | 86 | generateStub = true |
Ed.Willink | 83f9a0a | 2011-08-09 19:13:12 +0100 | [diff] [blame] | 87 | } |
Ed Willink | b376309 | 2020-06-12 15:33:10 +0100 | [diff] [blame] | 88 | validator = { |
| 89 | // composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator" |
| 90 | generateDeprecationValidation = false |
Ed.Willink | 83f9a0a | 2011-08-09 19:13:12 +0100 | [diff] [blame] | 91 | } |
Ed Willink | b376309 | 2020-06-12 15:33:10 +0100 | [diff] [blame] | 92 | /* fragment = CodeMiningFragment { |
| 93 | generateStub = true |
| 94 | generateXtendStub = false |
| 95 | } */ |
| 96 | parserGenerator = parser.antlr.XtextAntlrGeneratorFragment2 { |
| 97 | options = parser.antlr.AntlrOptions { |
| 98 | backtrack = true |
| 99 | classSplitting = true |
| 100 | } |
| 101 | } |
Ed Willink | d0260ba | 2023-10-06 20:45:23 +0100 | [diff] [blame] | 102 | formatter = org.eclipse.ocl.examples.build.fragments.DeclarativeFormatterFragmentXtend { |
Ed Willink | 09a1c0e | 2023-10-05 20:49:53 +0100 | [diff] [blame] | 103 | generateStub = true |
Ed Willink | b376309 | 2020-06-12 15:33:10 +0100 | [diff] [blame] | 104 | } |
Ed Willink | bc59db2 | 2014-03-21 08:45:15 +0000 | [diff] [blame] | 105 | // *.xtextbin support on Xtext 2.3 |
Ed Willink | 09a1c0e | 2023-10-05 20:49:53 +0100 | [diff] [blame] | 106 | fragment = org.eclipse.ocl.examples.build.fragments.CompatibilityFragment {} |
Ed.Willink | 83f9a0a | 2011-08-09 19:13:12 +0100 | [diff] [blame] | 107 | } |
| 108 | } |
Ed Willink | b376309 | 2020-06-12 15:33:10 +0100 | [diff] [blame] | 109 | component = org.eclipse.ocl.examples.build.xtend.GenerateGrammarXtend { |
Ed Willink | a55dbe4 | 2015-02-24 21:49:23 +0000 | [diff] [blame] | 110 | javaFolder = "${markupRuntimeProject}/src-gen" |
| 111 | javaPackageName = "${markupProjectName}" |
| 112 | grammarFileStem = "Markup" |
Ed Willink | eefcf37 | 2015-02-21 17:31:29 +0000 | [diff] [blame] | 113 | } |
Ed Willink | b376309 | 2020-06-12 15:33:10 +0100 | [diff] [blame] | 114 | component = org.eclipse.ocl.examples.build.utilities.InjectCompatibilityAbstractInternalAntlrParser { |
Ed Willink | a60aa68 | 2020-05-22 15:44:13 +0100 | [diff] [blame] | 115 | fileName = "${markupRuntimeProject}/src-gen/org/eclipse/ocl/xtext/markup/parser/antlr/internal/InternalMarkupParser.java" |
| 116 | } |
Ed Willink | b376309 | 2020-06-12 15:33:10 +0100 | [diff] [blame] | 117 | component = org.eclipse.ocl.examples.build.utilities.ConvertToUnixLineEndings { |
Ed Willink | 09a1c0e | 2023-10-05 20:49:53 +0100 | [diff] [blame] | 118 | directory = "${markupRuntimeProject}/META-INF" |
| 119 | } |
| 120 | component = org.eclipse.ocl.examples.build.utilities.ConvertToUnixLineEndings { |
| 121 | directory = "${markupRuntimeProject}/emf-gen" |
| 122 | } |
| 123 | component = org.eclipse.ocl.examples.build.utilities.ConvertToUnixLineEndings { |
| 124 | directory = "${markupRuntimeProject}/src" |
| 125 | } |
| 126 | component = org.eclipse.ocl.examples.build.utilities.ConvertToUnixLineEndings { |
Ed Willink | a55dbe4 | 2015-02-24 21:49:23 +0000 | [diff] [blame] | 127 | directory = "${markupRuntimeProject}/src-gen" |
| 128 | } |
Ed Willink | b376309 | 2020-06-12 15:33:10 +0100 | [diff] [blame] | 129 | component = org.eclipse.ocl.examples.build.utilities.ConvertToUnixLineEndings { |
Ed Willink | 09a1c0e | 2023-10-05 20:49:53 +0100 | [diff] [blame] | 130 | directory = "${markupRuntimeProject}.ui/META-INF" |
| 131 | } |
| 132 | component = org.eclipse.ocl.examples.build.utilities.ConvertToUnixLineEndings { |
| 133 | directory = "${markupRuntimeProject}.ui/src" |
| 134 | } |
| 135 | component = org.eclipse.ocl.examples.build.utilities.ConvertToUnixLineEndings { |
Ed Willink | a55dbe4 | 2015-02-24 21:49:23 +0000 | [diff] [blame] | 136 | directory = "${markupRuntimeProject}.ui/src-gen" |
Ed Willink | eefcf37 | 2015-02-21 17:31:29 +0000 | [diff] [blame] | 137 | } |
Ed.Willink | 83f9a0a | 2011-08-09 19:13:12 +0100 | [diff] [blame] | 138 | } |