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) 2013 Willink Transformations and others. |
Ed Willink | c27f84e | 2013-07-06 14:56:08 +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 | c27f84e | 2013-07-06 14:56:08 +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 | c27f84e | 2013-07-06 14:56:08 +0100 | [diff] [blame] | 7 | * |
| 8 | * Contributors: |
| 9 | * E.D.Willink - initial API and implementation |
Ed Willink | 17785c5 | 2014-05-20 12:29:51 +0100 | [diff] [blame] | 10 | *******************************************************************************/ |
Ed.Willink | f1ec73c | 2013-07-10 11:36:49 +0100 | [diff] [blame] | 11 | module SubGenerateASModel |
Ed Willink | c27f84e | 2013-07-06 14:56:08 +0100 | [diff] [blame] | 12 | |
| 13 | import org.eclipse.ocl.examples.build.utilities.GenerateModel |
Ed.Willink | f1ec73c | 2013-07-10 11:36:49 +0100 | [diff] [blame] | 14 | import org.eclipse.ocl.examples.build.xtend.GenerateASVisitors |
Ed Willink | c27f84e | 2013-07-06 14:56:08 +0100 | [diff] [blame] | 15 | import org.eclipse.emf.ecore.resource.ResourceSet |
| 16 | |
| 17 | /** |
| 18 | * A ResourceSet that may be shared by workflow components. |
| 19 | */ |
| 20 | var ResourceSet resourceSet |
| 21 | |
| 22 | /** |
Ed Willink | 6284259 | 2014-12-05 13:07:26 +0000 | [diff] [blame] | 23 | * The name of the project hosting the generated models; e.g. "org.eclipse.ocl.xtext.essentialocl" |
Ed Willink | c27f84e | 2013-07-06 14:56:08 +0100 | [diff] [blame] | 24 | */ |
| 25 | var projectName |
| 26 | |
| 27 | /** |
Adolfo SBH | 8acd569 | 2016-01-20 17:53:47 +0000 | [diff] [blame] | 28 | * The project-relative genmodel file; e.g. "model/MyModel.genmodel". |
Ed Willink | c27f84e | 2013-07-06 14:56:08 +0100 | [diff] [blame] | 29 | */ |
Adolfo SBH | 8acd569 | 2016-01-20 17:53:47 +0000 | [diff] [blame] | 30 | var genModelFile |
| 31 | |
Ed Willink | c27f84e | 2013-07-06 14:56:08 +0100 | [diff] [blame] | 32 | |
| 33 | /** |
Adolfo SBH | 8acd569 | 2016-01-20 17:53:47 +0000 | [diff] [blame] | 34 | * (Optional) The name of the inherited project hosting the generated models; e.g. "org.eclipse.ocl.xtext.basecs", "" for a base visitor. |
Ed Willink | c27f84e | 2013-07-06 14:56:08 +0100 | [diff] [blame] | 35 | */ |
Adolfo SBH | 8acd569 | 2016-01-20 17:53:47 +0000 | [diff] [blame] | 36 | var superProjectName = "" |
Ed Willink | c27f84e | 2013-07-06 14:56:08 +0100 | [diff] [blame] | 37 | |
| 38 | /** |
Adolfo SBH | 8acd569 | 2016-01-20 17:53:47 +0000 | [diff] [blame] | 39 | * (Optional) The project-relative genmodel file of the inherited project; e.g. "model/MyModel.genmodel"; default: "". |
Ed Willink | c27f84e | 2013-07-06 14:56:08 +0100 | [diff] [blame] | 40 | */ |
Adolfo SBH | 8acd569 | 2016-01-20 17:53:47 +0000 | [diff] [blame] | 41 | var superGenModelFile = "" |
Ed Willink | c27f84e | 2013-07-06 14:56:08 +0100 | [diff] [blame] | 42 | |
| 43 | /** |
Adolfo SBH | 8acd569 | 2016-01-20 17:53:47 +0000 | [diff] [blame] | 44 | * (Optional) The name of the base project hosting the generated models; e.g. "org.eclipse.ocl.xtext.basecs", "" for a base visitor. |
Ed Willink | c27f84e | 2013-07-06 14:56:08 +0100 | [diff] [blame] | 45 | */ |
Adolfo SBH | 8acd569 | 2016-01-20 17:53:47 +0000 | [diff] [blame] | 46 | var baseProjectName = "" |
Ed Willink | c27f84e | 2013-07-06 14:56:08 +0100 | [diff] [blame] | 47 | |
| 48 | /** |
Adolfo SBH | 8acd569 | 2016-01-20 17:53:47 +0000 | [diff] [blame] | 49 | * (Optional) The project-relative genmodel file of the base project; e.g. "model/MyModel.genmodel"; default: "". |
Ed Willink | c27f84e | 2013-07-06 14:56:08 +0100 | [diff] [blame] | 50 | */ |
Adolfo SBH | 8acd569 | 2016-01-20 17:53:47 +0000 | [diff] [blame] | 51 | var baseGenModelFile = "" |
Ed Willink | c27f84e | 2013-07-06 14:56:08 +0100 | [diff] [blame] | 52 | |
| 53 | /** |
| 54 | * (Optional) The workspace-relative name of the gen model file; default: "/${projectName}/${genModelFile}" |
| 55 | */ |
| 56 | var genModel = "/${projectName}/${genModelFile}" |
| 57 | |
| 58 | /** |
Ed.Willink | f1ec73c | 2013-07-10 11:36:49 +0100 | [diff] [blame] | 59 | * Generate an Abstract Syntax Model and its visitors as used by the evaluator. |
Ed Willink | c27f84e | 2013-07-06 14:56:08 +0100 | [diff] [blame] | 60 | */ |
| 61 | Workflow { |
| 62 | component = GenerateModel { resourceSet = resourceSet skipOnErrors = true |
Ed Willink | 28c8e76 | 2018-01-10 13:05:13 +0000 | [diff] [blame] | 63 | genModel = genModel clearResourceSet = false |
Ed Willink | c27f84e | 2013-07-06 14:56:08 +0100 | [diff] [blame] | 64 | } |
Ed.Willink | f1ec73c | 2013-07-10 11:36:49 +0100 | [diff] [blame] | 65 | component = GenerateASVisitors { resourceSet = resourceSet skipOnErrors = true |
Ed Willink | c27f84e | 2013-07-06 14:56:08 +0100 | [diff] [blame] | 66 | projectName = projectName |
| 67 | genModelFile = genModelFile |
Adolfo SBH | 8acd569 | 2016-01-20 17:53:47 +0000 | [diff] [blame] | 68 | superProjectName = superProjectName |
| 69 | superGenModelFile = superGenModelFile |
| 70 | baseProjectName = baseProjectName |
| 71 | baseGenModelFile = baseGenModelFile |
Ed Willink | c27f84e | 2013-07-06 14:56:08 +0100 | [diff] [blame] | 72 | } |
| 73 | } |