Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Belle2017-09-12 11:52:53 +0000
committerJan Belle2017-09-12 11:52:53 +0000
commit9e42fbde145d3de9dabbb4ee88d100ce6d5efcb7 (patch)
tree2c20e0cb780a19c2cda75cb746e332a5c27c81d6 /runtime
parent9c159513eea9d2ac0588ffb0b93c51aaeff22f21 (diff)
downloadorg.eclipse.etrice-9e42fbde145d3de9dabbb4ee88d100ce6d5efcb7.tar.gz
org.eclipse.etrice-9e42fbde145d3de9dabbb4ee88d100ce6d5efcb7.tar.xz
org.eclipse.etrice-9e42fbde145d3de9dabbb4ee88d100ce6d5efcb7.zip
[generator.common.tests] gradle build for common generator tests
Diffstat (limited to 'runtime')
-rw-r--r--runtime/org.eclipse.etrice.modellib.c/build.gradle40
-rw-r--r--runtime/org.eclipse.etrice.modellib.cpp/build.gradle39
-rw-r--r--runtime/org.eclipse.etrice.modellib.java/build.gradle32
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/build.gradle23
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/build.gradle24
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/build.gradle11
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src-gen/org/eclipse/etrice/runtime/java/modelbase/RTSystemServicesProtocol.java75
7 files changed, 219 insertions, 25 deletions
diff --git a/runtime/org.eclipse.etrice.modellib.c/build.gradle b/runtime/org.eclipse.etrice.modellib.c/build.gradle
new file mode 100644
index 000000000..23ad8e2b0
--- /dev/null
+++ b/runtime/org.eclipse.etrice.modellib.c/build.gradle
@@ -0,0 +1,40 @@
+plugins {
+ id 'c'
+}
+
+def generator = ':plugins:org.eclipse.etrice.generator.c'
+
+task generate(type: JavaExec, group: 'build', dependsOn: "$generator:classes") {
+ main = project(generator).mainClassName
+ classpath = project(generator).classpath
+ inputs.dir 'model'
+ outputs.dir 'src-gen'
+ args '-lib', '-msc_instr', '-genDir', 'src-gen',
+ 'model/PInterrupt.room',
+ 'model/TcpService.room',
+ 'model/TimingService.room'
+}
+
+model {
+ components {
+ etrice_modellib_c(NativeLibrarySpec) {
+ sources.c {
+ builtBy generate
+ source {
+ srcDirs = ['src-gen']
+ include '**/*.c'
+ }
+ exportedHeaders {
+ srcDirs = ['src-gen']
+ }
+ lib project: ':runtime:org.eclipse.etrice.runtime.c', library: 'etrice_runtime_c', linkage: 'api'
+ }
+ binaries {
+ withType(SharedLibraryBinarySpec) { buildable = false }
+ all { cCompiler.args '-g3' }
+ }
+ }
+ }
+}
+
+clean.delete 'src-gen' \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.modellib.cpp/build.gradle b/runtime/org.eclipse.etrice.modellib.cpp/build.gradle
new file mode 100644
index 000000000..3299defba
--- /dev/null
+++ b/runtime/org.eclipse.etrice.modellib.cpp/build.gradle
@@ -0,0 +1,39 @@
+plugins {
+ id 'cpp'
+}
+
+def generator = ':plugins:org.eclipse.etrice.generator.cpp'
+
+task generate(type: JavaExec, group: 'build', dependsOn: "$generator:classes") {
+ main = project(generator).mainClassName
+ classpath = project(generator).classpath
+ inputs.dir 'model'
+ outputs.dir 'src-gen'
+ args '-lib', '-msc_instr', '-genDir', 'src-gen',
+ 'model/TimingService.room'
+}
+
+model {
+ components {
+ etrice_modellib_cpp(NativeLibrarySpec) {
+ sources.cpp {
+ builtBy generate
+ source {
+ srcDirs = ['src-gen']
+ include '**/*.cpp'
+ }
+ exportedHeaders {
+ srcDirs = ['src-gen']
+ }
+ lib project: ':runtime:org.eclipse.etrice.runtime.c', library: 'etrice_runtime_c', linkage: 'api'
+ lib project: ':runtime:org.eclipse.etrice.runtime.cpp', library: 'etrice_runtime_cpp', linkage: 'api'
+ }
+ binaries {
+ withType(SharedLibraryBinarySpec) { buildable = false }
+ all { cppCompiler.args '-g3' }
+ }
+ }
+ }
+}
+
+clean.delete 'src-gen' \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.modellib.java/build.gradle b/runtime/org.eclipse.etrice.modellib.java/build.gradle
new file mode 100644
index 000000000..f27641e6f
--- /dev/null
+++ b/runtime/org.eclipse.etrice.modellib.java/build.gradle
@@ -0,0 +1,32 @@
+plugins {
+ id 'java'
+}
+
+def generator = ':plugins:org.eclipse.etrice.generator.java'
+
+task generate(type: JavaExec, group: 'build', dependsOn: "$generator:classes") {
+ main = project(generator).mainClassName
+ classpath = project(generator).classpath
+ inputs.dir 'model'
+ outputs.dir 'src-gen'
+ args '-lib', '-msc_instr', '-genDir', 'src-gen',
+ 'model/ALogService.room',
+ 'model/TcpService.room',
+ 'model/TimingService.room'
+}
+
+dependencies {
+ compile project(':runtime:org.eclipse.etrice.runtime.java')
+}
+
+sourceSets {
+ main {
+ java {
+ srcDirs = ['src-gen']
+ }
+ }
+}
+
+compileJava.dependsOn generate
+
+clean.delete 'src-gen' \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.runtime.c/build.gradle b/runtime/org.eclipse.etrice.runtime.c/build.gradle
new file mode 100644
index 000000000..ce88e15c8
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/build.gradle
@@ -0,0 +1,23 @@
+plugins {
+ id 'c'
+}
+
+model {
+ components {
+ etrice_runtime_c(NativeLibrarySpec) {
+ sources.c {
+ source {
+ srcDirs = ['src/common', 'src/config', 'src/platforms/MT_WIN_MinGW', 'src/util']
+ include '**/*.c'
+ }
+ exportedHeaders {
+ srcDirs = ['src/common', 'src/config', 'src/platforms/MT_WIN_MinGW', 'src/util']
+ }
+ }
+ binaries {
+ withType(SharedLibraryBinarySpec) { buildable = false }
+ all { cCompiler.args '-g3' }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/build.gradle b/runtime/org.eclipse.etrice.runtime.cpp/build.gradle
new file mode 100644
index 000000000..63e95beac
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/build.gradle
@@ -0,0 +1,24 @@
+plugins {
+ id 'cpp'
+}
+
+model {
+ components {
+ etrice_runtime_cpp(NativeLibrarySpec) {
+ sources.cpp {
+ source {
+ srcDirs = ['src', 'src-gen']
+ include '**/*.cpp'
+ }
+ exportedHeaders {
+ srcDirs = ['src', 'src-gen']
+ }
+ lib project: ':runtime:org.eclipse.etrice.runtime.c', library: 'etrice_runtime_c', linkage: 'api'
+ }
+ binaries {
+ withType(SharedLibraryBinarySpec) { buildable = false }
+ all { cppCompiler.args '-g3' }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.runtime.java/build.gradle b/runtime/org.eclipse.etrice.runtime.java/build.gradle
new file mode 100644
index 000000000..a38c8a95f
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.java/build.gradle
@@ -0,0 +1,11 @@
+plugins {
+ id 'java'
+}
+
+sourceSets {
+ main {
+ java {
+ srcDirs = ['src', 'src-gen']
+ }
+ }
+} \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.runtime.java/src-gen/org/eclipse/etrice/runtime/java/modelbase/RTSystemServicesProtocol.java b/runtime/org.eclipse.etrice.runtime.java/src-gen/org/eclipse/etrice/runtime/java/modelbase/RTSystemServicesProtocol.java
index 113008b8b..aee9ab308 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src-gen/org/eclipse/etrice/runtime/java/modelbase/RTSystemServicesProtocol.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src-gen/org/eclipse/etrice/runtime/java/modelbase/RTSystemServicesProtocol.java
@@ -1,6 +1,14 @@
package org.eclipse.etrice.runtime.java.modelbase;
import org.eclipse.etrice.runtime.java.messaging.Message;
+import org.eclipse.etrice.runtime.java.modelbase.EventMessage;
+import org.eclipse.etrice.runtime.java.modelbase.EventWithDataMessage;
+import org.eclipse.etrice.runtime.java.modelbase.IInterfaceItemOwner;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
+import org.eclipse.etrice.runtime.java.modelbase.PortBase;
+import org.eclipse.etrice.runtime.java.modelbase.ReplicatedPortBase;
+import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
+import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -34,6 +42,12 @@ public class RTSystemServicesProtocol {
}
public RTSystemServicesProtocolPort(IInterfaceItemOwner actor, String name, int localId, int idx) {
super(actor, name, localId, idx);
+ DebuggingService.getInstance().addPortInstance(this);
+ }
+
+ public void destroy() {
+ DebuggingService.getInstance().removePortInstance(this);
+ super.destroy();
}
@Override
@@ -42,14 +56,15 @@ public class RTSystemServicesProtocol {
return;
EventMessage msg = (EventMessage) m;
if (0 < msg.getEvtId() && msg.getEvtId() < MSG_MAX) {
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
-
+
// sent messages
}
@@ -59,23 +74,23 @@ public class RTSystemServicesProtocol {
public RTSystemServicesProtocolReplPort(IInterfaceItemOwner actor, String name, int localId) {
super(actor, name, localId);
}
-
+
public int getReplication() {
return getNInterfaceItems();
}
-
+
public int getIndexOf(InterfaceItemBase ifitem){
return ifitem.getIdx();
- }
-
+ }
+
public RTSystemServicesProtocolPort get(int idx) {
return (RTSystemServicesProtocolPort) getInterfaceItem(idx);
}
-
+
protected InterfaceItemBase createInterfaceItem(IInterfaceItemOwner rcv, String name, int lid, int idx) {
return new RTSystemServicesProtocolPort(rcv, name, lid, idx);
}
-
+
// outgoing messages
}
@@ -88,6 +103,12 @@ public class RTSystemServicesProtocol {
}
public RTSystemServicesProtocolConjPort(IInterfaceItemOwner actor, String name, int localId, int idx) {
super(actor, name, localId, idx);
+ DebuggingService.getInstance().addPortInstance(this);
+ }
+
+ public void destroy() {
+ DebuggingService.getInstance().removePortInstance(this);
+ super.destroy();
}
@Override
@@ -96,27 +117,31 @@ public class RTSystemServicesProtocol {
return;
EventMessage msg = (EventMessage) m;
if (0 < msg.getEvtId() && msg.getEvtId() < MSG_MAX) {
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
-
+
// sent messages
public void executeInitialTransition() {
+ DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_executeInitialTransition]);
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), IN_executeInitialTransition));
- }
+ }
public void startDebugging() {
+ DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_startDebugging]);
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), IN_startDebugging));
- }
+ }
public void stopDebugging() {
+ DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_stopDebugging]);
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), IN_stopDebugging));
- }
+ }
}
// replicated port class
@@ -125,23 +150,23 @@ public class RTSystemServicesProtocol {
public RTSystemServicesProtocolConjReplPort(IInterfaceItemOwner actor, String name, int localId) {
super(actor, name, localId);
}
-
+
public int getReplication() {
return getNInterfaceItems();
}
-
+
public int getIndexOf(InterfaceItemBase ifitem){
return ifitem.getIdx();
- }
-
+ }
+
public RTSystemServicesProtocolConjPort get(int idx) {
return (RTSystemServicesProtocolConjPort) getInterfaceItem(idx);
}
-
+
protected InterfaceItemBase createInterfaceItem(IInterfaceItemOwner rcv, String name, int lid, int idx) {
return new RTSystemServicesProtocolConjPort(rcv, name, lid, idx);
}
-
+
// incoming messages
public void executeInitialTransition(){
for (InterfaceItemBase item : getItems()) {

Back to the top