Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Belle2018-09-07 12:35:29 +0000
committerJan Belle2018-09-07 12:35:29 +0000
commit1666772afdd130805a7b8bed005b197e541a9f5c (patch)
treed9fb305e3e9783785731a71fef11c59cad72a3c9 /plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c
parent12589012c83db9f2e5a3e995e4717025b17b549f (diff)
downloadorg.eclipse.etrice-1666772afdd130805a7b8bed005b197e541a9f5c.tar.gz
org.eclipse.etrice-1666772afdd130805a7b8bed005b197e541a9f5c.tar.xz
org.eclipse.etrice-1666772afdd130805a7b8bed005b197e541a9f5c.zip
[generator] Use single output directory for generated files
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c')
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend13
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/DataClassGen.xtend9
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/EnumerationTypeGen.xtend7
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/MainGen.xtend3
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend11
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeRunnerGen.xtend9
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.xtend9
7 files changed, 27 insertions, 34 deletions
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend
index 0544eb7f1..dee7b704e 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend
@@ -29,7 +29,6 @@ import org.eclipse.etrice.generator.c.Main
import org.eclipse.etrice.generator.generic.GenericActorClassGenerator
import org.eclipse.etrice.generator.generic.ILanguageExtension
import org.eclipse.etrice.generator.generic.ProcedureHelpers
-import org.eclipse.etrice.generator.generic.RoomExtensions
import org.eclipse.etrice.generator.base.io.IGeneratorFileIO
import org.eclipse.etrice.generator.c.setup.GeneratorOptionsHelper
import org.eclipse.etrice.generator.base.logging.ILogger
@@ -37,7 +36,6 @@ import org.eclipse.etrice.generator.base.logging.ILogger
@Singleton
class ActorClassGen extends GenericActorClassGenerator {
- @Inject protected extension RoomExtensions
@Inject protected extension CExtensions
@Inject protected extension ProcedureHelpers
@Inject protected extension StateMachineGen
@@ -49,24 +47,23 @@ class ActorClassGen extends GenericActorClassGenerator {
def doGenerate(Root root) {
for (xpac: root.actorClasses.map[root.getExpandedActorClass(it)]) {
- val path = xpac.actorClass.generationTargetPath+xpac.actorClass.getPath
- val infopath = xpac.actorClass.generationInfoPath+xpac.actorClass.getPath
+ val path = xpac.actorClass.getPath
var file = xpac.actorClass.getCHeaderFileName
// header file
- fileIO.generateFile("generating ActorClass header", path, infopath, file, root.generateHeaderFile(xpac))
+ fileIO.generateFile("generating ActorClass header", path + file, root.generateHeaderFile(xpac))
// utils file
file = xpac.actorClass.getCUtilsFileName
- fileIO.generateFile("generating ActorClass utils", path, infopath, file, root.generateUtilsFile(xpac))
+ fileIO.generateFile("generating ActorClass utils", path + file, root.generateUtilsFile(xpac))
// source file
if (xpac.actorClass.isBehaviorAnnotationPresent("BehaviorManual")) {
- logger.logInfo("omitting ActorClass source for '"+xpac.actorClass.name+"' since @BehaviorManual is specified")
+ logger.logInfo("omitting ActorClass source for '" + xpac.actorClass.name + "' since @BehaviorManual is specified")
}
else {
file = xpac.actorClass.getCSourceFileName
- fileIO.generateFile("generating ActorClass source", path, infopath, file, root.generateSourceFile(xpac))
+ fileIO.generateFile("generating ActorClass source", path + file, root.generateSourceFile(xpac))
}
}
}
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/DataClassGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/DataClassGen.xtend
index f484c1e8e..46ceea2f9 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/DataClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/DataClassGen.xtend
@@ -39,20 +39,19 @@ class DataClassGen {
def doGenerate(Root root) {
for (dc: root.dataClasses) {
- val path = dc.generationTargetPath+dc.getPath
- val infopath = dc.generationInfoPath+dc.getPath
+ val path = dc.getPath
var file = dc.getCHeaderFileName
// header file
- fileIO.generateFile("generating DataClass header", path, infopath, file, root.generateHeaderFile(dc))
+ fileIO.generateFile("generating DataClass header", path + file, root.generateHeaderFile(dc))
// utils file
file = dc.getCUtilsFileName
- fileIO.generateFile("generating ProtocolClass utils", path, infopath, file, root.generateUtilsFile(dc))
+ fileIO.generateFile("generating ProtocolClass utils", path + file, root.generateUtilsFile(dc))
// source file
file = dc.getCSourceFileName
- fileIO.generateFile("generating DataClass source", path, infopath, file, root.generateSourceFile(dc))
+ fileIO.generateFile("generating DataClass source", path + file, root.generateSourceFile(dc))
}
}
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/EnumerationTypeGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/EnumerationTypeGen.xtend
index 8b5a23aa3..a8f88af50 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/EnumerationTypeGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/EnumerationTypeGen.xtend
@@ -34,16 +34,15 @@ class EnumerationTypeGen {
def doGenerate(Root root) {
for (et: root.enumClasses) {
- val path = et.generationTargetPath+et.getPath
- val infopath = et.generationInfoPath+et.getPath
+ val path = et.getPath
var file = et.getCHeaderFileName
// header file
- fileIO.generateFile("generating Enumeration header", path, infopath, file, root.generateHeaderFile(et))
+ fileIO.generateFile("generating Enumeration header", path + file, root.generateHeaderFile(et))
// header file
file = et.getCSourceFileName
- fileIO.generateFile("generating Enumeration source", path, infopath, file, root.generateSourceFile(et))
+ fileIO.generateFile("generating Enumeration source", path + file, root.generateSourceFile(et))
}
}
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/MainGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/MainGen.xtend
index d0bc921fe..428b3071c 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/MainGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/MainGen.xtend
@@ -33,8 +33,7 @@ class MainGen {
@Inject PrepareFileSystem prepFS
def void doGenerate(Resource resource) {
- prepFS.prepareCodeTargetPaths(resource)
- prepFS.prepareInfoTargetPaths(resource)
+ prepFS.prepare
for (e: resource.contents){
if (e instanceof Root) {
doGenerate(e as Root)
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend
index 1bb434da0..a1aadf370 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend
@@ -68,24 +68,23 @@ class NodeGen {
for (instpath : ETMapUtil::getSubSystemInstancePaths(nr)) {
val ssi = root.getInstance(instpath) as SubSystemInstance
if (ssi!==null) {
- val filepath = ssi.subSystemClass.generationTargetPath+ssi.subSystemClass.getPath
- val infopath = ssi.subSystemClass.generationInfoPath+ssi.subSystemClass.getPath
+ val filepath = ssi.subSystemClass.getPath
var file = nr.getCHeaderFileName(ssi)
checkDataPorts(ssi)
val usedThreads = ETMapUtil::getUsedThreads(nr, ssi)
- fileIO.generateFile("generating Node declaration", filepath, infopath, file, root.generateHeaderFile(ssi))
+ fileIO.generateFile("generating Node declaration", filepath + file, root.generateHeaderFile(ssi))
file = nr.getCSourceFileName(ssi)
- fileIO.generateFile("generating Node implementation", filepath, infopath, file, root.generateSourceFile(ssi, usedThreads))
+ fileIO.generateFile("generating Node implementation", filepath + file, root.generateSourceFile(ssi, usedThreads))
file = nr.getInstSourceFileName(ssi)
- fileIO.generateFile("generating Node instance file", filepath, infopath, file, root.generateInstanceFile(ssi, usedThreads))
+ fileIO.generateFile("generating Node instance file", filepath + file, root.generateInstanceFile(ssi, usedThreads))
file = nr.getDispSourceFileName(ssi)
- fileIO.generateFile("generating Node dispatcher file", filepath, infopath, file, root.generateDispatcherFile(ssi, usedThreads))
+ fileIO.generateFile("generating Node dispatcher file", filepath + file, root.generateDispatcherFile(ssi, usedThreads))
}
}
}
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeRunnerGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeRunnerGen.xtend
index 3cc0f697b..9279f22a7 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeRunnerGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeRunnerGen.xtend
@@ -19,18 +19,18 @@ import com.google.inject.Inject
import com.google.inject.Singleton
import org.eclipse.etrice.core.genmodel.etricegen.Root
import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance
-import org.eclipse.xtext.generator.JavaIoFileSystemAccess
import org.eclipse.etrice.generator.generic.RoomExtensions
import org.eclipse.etrice.core.etmap.util.ETMapUtil
import org.eclipse.etrice.core.common.base.util.BaseHelpers
import org.eclipse.etrice.generator.c.Main
import org.eclipse.etrice.generator.c.setup.GeneratorOptionsHelper
+import org.eclipse.etrice.generator.base.io.IGeneratorFileIO
@Singleton
class NodeRunnerGen {
@Inject extension BaseHelpers
- @Inject extension JavaIoFileSystemAccess fileAccess
+ @Inject extension IGeneratorFileIO fileIO
@Inject extension CExtensions
@Inject extension RoomExtensions
@Inject protected extension GeneratorOptionsHelper
@@ -42,8 +42,9 @@ class NodeRunnerGen {
val ssi = root.getInstance(instpath) as SubSystemInstance
if (ssi!==null) {
val clsname = nr.name+"_"+ssi.name
- fileAccess.setOutputPath(ssi.subSystemClass.generationTargetPath+ssi.subSystemClass.getPath)
- fileAccess.generateFile( clsname+"_Runner.c", root.generateSourceFile(ssi, first))
+ val path = ssi.subSystemClass.getPath
+ val file = clsname + "_Runner.c"
+ fileIO.generateFile(path + file, root.generateSourceFile(ssi, first))
first = false
}
}
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.xtend
index c455aa4f2..09516bec3 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.xtend
@@ -45,20 +45,19 @@ class ProtocolClassGen extends GenericProtocolClassGenerator {
def doGenerate(Root root) {
for (pc: root.protocolClasses) {
- val path = pc.generationTargetPath+pc.getPath
- val infopath = pc.generationInfoPath+pc.getPath
+ val path = pc.getPath
var file = pc.getCHeaderFileName
// header file
- fileIO.generateFile("generating ProtocolClass header", path, infopath, file, root.generateHeaderFile(pc))
+ fileIO.generateFile("generating ProtocolClass header", path + file, root.generateHeaderFile(pc))
// utils file
file = pc.getCUtilsFileName
- fileIO.generateFile("generating ProtocolClass utils", path, infopath, file, root.generateUtilsFile(pc))
+ fileIO.generateFile("generating ProtocolClass utils", path + file, root.generateUtilsFile(pc))
// source file
file = pc.getCSourceFileName
- fileIO.generateFile("generating ProtocolClass source", path, infopath, file, root.generateSourceFile(pc))
+ fileIO.generateFile("generating ProtocolClass source", path + file, root.generateSourceFile(pc))
}
}

Back to the top