Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 78f93ac176c1516cf24363acc60c11e105a7c03f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*******************************************************************************
 * Copyright (c) 2010 protos software gmbh (http://www.protos.de).
 * 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:
 * 		Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
 * 
 *******************************************************************************/

module workflow.RoomGenerator_CPP

import org.eclipse.emf.mwe.utils.*

var sourceDir = ""
var targetDir = ""
var fileEncoding = "Cp1252"

Workflow {
	
	component = org.eclipse.xtext.mwe.Reader {
		// lookup all resources on the classpath
		// useJavaClassPath = true
		
		// or define search scope explicitly
		path = sourceDir
		useJavaClassPath=true
		
		// this class will be generated by the xtext generator 
		register = org.eclipse.etrice.core.RoomStandaloneSetup {}
		load = {
			slot = "model"
			
			// HOWTO: feed top level object into generator
			// Sven Efftinge in news://news.eclipse.org:119/hlh0ju$if8$1@build.eclipse.org: 
			// "The new reader is based on EObjectDescriptions, which are by default only available and created for elements, which have a name."
			// ==> Therefore we introduced a name for the model in Room.xtext
			type = "RoomModel"
		}
	}

	// HOWTO: call a custom workflow component
	component = org.eclipse.etrice.generator.workflow.GeneratorModelCreator {
		inSlot = "model"
		outSlot = "instance_model"
		debug = true			// debug flag for verbose output
		save = true				// save intermediate model for debugging purposes
		uri = "src-gen/tmp.rim"	// name of intermediate model file
	}

	component = org.eclipse.xpand2.Generator {
		metaModel = org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel {}
		expand = "templates_CPP::Main::main FOREACH instance_model"
		outlet = {
			path = targetDir
			//postprocessor = org.eclipse.xpand2.output.JavaBeautifier {}
		}
		fileEncoding = fileEncoding
	}
}

Back to the top