blob: 161c083678d37a88c7c73e8b28fdf6ee2122ca46 [file] [log] [blame]
Ed Willink17785c52014-05-20 12:29:51 +01001/*******************************************************************************
Ed Willink52e3d062015-05-19 10:14:44 +01002 * Copyright (c) 2011 Willink Transformations and others.
Ed.Willink83f9a0a2011-08-09 19:13:12 +01003 * All rights reserved. This program and the accompanying materials
Ed Willink2b4d8be2018-06-13 11:53:02 +01004 * are made available under the terms of the Eclipse Public License v2.0
Ed.Willink83f9a0a2011-08-09 19:13:12 +01005 * which accompanies this distribution, and is available at
Ed Willink2b4d8be2018-06-13 11:53:02 +01006 * http://www.eclipse.org/legal/epl-v20.html
Ed.Willink83f9a0a2011-08-09 19:13:12 +01007 *
8 * Contributors:
9 * E.D.Willink - initial API and implementation
10 *
Ed.Willink83f9a0a2011-08-09 19:13:12 +010011 * 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 Willink17785c52014-05-20 12:29:51 +010014 *******************************************************************************/
Ed.Willink83f9a0a2011-08-09 19:13:12 +010015module GenerateMarkupEditor
16
Ed Willinkb3763092020-06-12 15:33:10 +010017import org.eclipse.xtext.xtext.generator.*
18import org.eclipse.xtext.xtext.generator.model.project.*
19import org.eclipse.xtext.xtext.generator.ui.codemining.CodeMiningFragment
Ed.Willink83f9a0a2011-08-09 19:13:12 +010020
Ed Willinka55dbe42015-02-24 21:49:23 +000021var markupProjectName = "org.eclipse.ocl.xtext.markup"
22var markupRuntimeProject = "../../plugins/${markupProjectName}"
Ed.Willink83f9a0a2011-08-09 19:13:12 +010023
Ed Willinkb3763092020-06-12 15:33:10 +010024var rootPath = "../../plugins"
25
Ed.Willink83f9a0a2011-08-09 19:13:12 +010026/**
27 * Generate the markup Editor.
28 */
29Workflow {
Ed Willinkb3763092020-06-12 15:33:10 +010030 bean = org.eclipse.emf.mwe.utils.StandaloneSetup {
Ed.Willink916daad2011-10-21 23:00:14 +010031 scanClassPath = true
Ed Willinkb4d16682013-04-11 15:01:58 +010032 platformUri = ".."
Ed Willink8ecbb222014-12-05 15:40:39 +000033 registerGeneratedEPackage = "org.eclipse.ocl.xtext.markupcs.MarkupPackage"
Ed Willink62842592014-12-05 13:07:26 +000034 registerGenModelFile = "platform:/resource/org.eclipse.ocl.xtext.markup/model/Markup.genmodel"
Ed.Willink83f9a0a2011-08-09 19:13:12 +010035 }
36
Ed Willinkb3763092020-06-12 15:33:10 +010037 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 Willink09a1c0e2023-10-05 20:49:53 +010063 lineDelimiter = "\n"
Ed Willinkb3763092020-06-12 15:33:10 +010064 encoding = "UTF-8"
65 fileHeader =
Ed Willink8435f242016-01-04 21:04:04 +000066"/*******************************************************************************
67 * Copyright (c) 2011, \${year} Willink Transformations and others.
68 * All rights reserved. This program and the accompanying materials
Ed Willink2b4d8be2018-06-13 11:53:02 +010069 * are made available under the terms of the Eclipse Public License v2.0
Ed Willink8435f242016-01-04 21:04:04 +000070 * which accompanies this distribution, and is available at
Ed Willink2b4d8be2018-06-13 11:53:02 +010071 * http://www.eclipse.org/legal/epl-v20.html
Ed Willink8435f242016-01-04 21:04:04 +000072 *
Ed Willinkb3763092020-06-12 15:33:10 +010073 * SPDX-License-Identifier: EPL-2.0
74 *
Ed Willink8435f242016-01-04 21:04:04 +000075 * Contributors:
76 * E.D.Willink - initial API and implementation
77 *******************************************************************************/"
Ed.Willink83f9a0a2011-08-09 19:13:12 +010078 }
Ed Willinkb3763092020-06-12 15:33:10 +010079 }
Ed Willink0f3b96c2023-10-07 13:18:50 +010080 language = org.eclipse.ocl.examples.build.fragments.MyStandardLanguage {
Ed Willinkb3763092020-06-12 15:33:10 +010081 name = "${markupProjectName}.Markup"
82 fileExtensions = "markupocl"
Ed Willink63ea1972023-11-10 09:32:45 +000083 grammarUri = "platform:/resource/${markupProjectName}/src/org/eclipse/ocl/xtext/markup/Markup.xtext"
Ed Willinkb3763092020-06-12 15:33:10 +010084 generator = null
Ed Willinkd0260ba2023-10-06 20:45:23 +010085 serializer = org.eclipse.ocl.examples.build.fragments.DeclarativeSerializerFragmentXtend {
Ed Willink09a1c0e2023-10-05 20:49:53 +010086 generateStub = true
Ed.Willink83f9a0a2011-08-09 19:13:12 +010087 }
Ed Willinkb3763092020-06-12 15:33:10 +010088 validator = {
89 // composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
90 generateDeprecationValidation = false
Ed.Willink83f9a0a2011-08-09 19:13:12 +010091 }
Ed Willinkb3763092020-06-12 15:33:10 +010092 /* 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 Willinkd0260ba2023-10-06 20:45:23 +0100102 formatter = org.eclipse.ocl.examples.build.fragments.DeclarativeFormatterFragmentXtend {
Ed Willink09a1c0e2023-10-05 20:49:53 +0100103 generateStub = true
Ed Willinkb3763092020-06-12 15:33:10 +0100104 }
Ed Willinkbc59db22014-03-21 08:45:15 +0000105 // *.xtextbin support on Xtext 2.3
Ed Willink09a1c0e2023-10-05 20:49:53 +0100106 fragment = org.eclipse.ocl.examples.build.fragments.CompatibilityFragment {}
Ed.Willink83f9a0a2011-08-09 19:13:12 +0100107 }
108 }
Ed Willinkb3763092020-06-12 15:33:10 +0100109 component = org.eclipse.ocl.examples.build.xtend.GenerateGrammarXtend {
Ed Willinka55dbe42015-02-24 21:49:23 +0000110 javaFolder = "${markupRuntimeProject}/src-gen"
111 javaPackageName = "${markupProjectName}"
112 grammarFileStem = "Markup"
Ed Willinkeefcf372015-02-21 17:31:29 +0000113 }
Ed Willinkb3763092020-06-12 15:33:10 +0100114 component = org.eclipse.ocl.examples.build.utilities.InjectCompatibilityAbstractInternalAntlrParser {
Ed Willinka60aa682020-05-22 15:44:13 +0100115 fileName = "${markupRuntimeProject}/src-gen/org/eclipse/ocl/xtext/markup/parser/antlr/internal/InternalMarkupParser.java"
116 }
Ed Willinkb3763092020-06-12 15:33:10 +0100117 component = org.eclipse.ocl.examples.build.utilities.ConvertToUnixLineEndings {
Ed Willink09a1c0e2023-10-05 20:49:53 +0100118 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 Willinka55dbe42015-02-24 21:49:23 +0000127 directory = "${markupRuntimeProject}/src-gen"
128 }
Ed Willinkb3763092020-06-12 15:33:10 +0100129 component = org.eclipse.ocl.examples.build.utilities.ConvertToUnixLineEndings {
Ed Willink09a1c0e2023-10-05 20:49:53 +0100130 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 Willinka55dbe42015-02-24 21:49:23 +0000136 directory = "${markupRuntimeProject}.ui/src-gen"
Ed Willinkeefcf372015-02-21 17:31:29 +0000137 }
Ed.Willink83f9a0a2011-08-09 19:13:12 +0100138}