This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch feature/plc4rs-2
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/feature/plc4rs-2 by this push:
new d9ee394ad5 chore(plc4rust): Minor tweaking of the templates (Added
missing file headers in the "server" module)
d9ee394ad5 is described below
commit d9ee394ad5ac552fba73bc8614983f67b01764e9
Author: cdutz <[email protected]>
AuthorDate: Thu Jun 9 09:55:26 2022 +0200
chore(plc4rust): Minor tweaking of the templates (Added missing file
headers in the "server" module)
---
.../src/main/resources/templates/rust/lib.rs.ftlh | 36 ++++++++++++----------
plc4rust/Cargo.toml | 3 +-
plc4rust/generated-sources/modbus/src/lib.rs | 34 ++++++++++----------
plc4rust/server/Cargo.toml | 17 ++++++++++
plc4rust/server/src/client.rs | 18 +++++++++++
plc4rust/server/src/main.rs | 18 +++++++++++
6 files changed, 92 insertions(+), 34 deletions(-)
diff --git
a/code-generation/language-rust/src/main/resources/templates/rust/lib.rs.ftlh
b/code-generation/language-rust/src/main/resources/templates/rust/lib.rs.ftlh
index b8712100fd..e8fd8e923f 100644
---
a/code-generation/language-rust/src/main/resources/templates/rust/lib.rs.ftlh
+++
b/code-generation/language-rust/src/main/resources/templates/rust/lib.rs.ftlh
@@ -27,22 +27,24 @@
<#-- @ftlvariable name="type"
type="org.apache.plc4x.plugins.codegenerator.types.definitions.ComplexTypeDefinition"
-->
<#-- Declare the name and type of variables declared locally inside the
template -->
src/lib.rs
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
<#list helper.getTypeDefinitions()?keys as typeDefinitionName>
mod ${typeDefinitionName};
@@ -53,7 +55,7 @@ mod test {
#[test]
fn test() {
-println!("Hello world! Hurz!");
+println!("Hello world!");
}
}
</#outputformat>
\ No newline at end of file
diff --git a/plc4rust/Cargo.toml b/plc4rust/Cargo.toml
index 189b44614c..7902b1f091 100644
--- a/plc4rust/Cargo.toml
+++ b/plc4rust/Cargo.toml
@@ -37,5 +37,6 @@ codegen-units = 1
# Also build the driver modules ...
[workspace]
members = [
- "generated-sources/modbus"
+ "generated-sources/modbus",
+ "server"
]
\ No newline at end of file
diff --git a/plc4rust/generated-sources/modbus/src/lib.rs
b/plc4rust/generated-sources/modbus/src/lib.rs
index 686bc539be..8fa12a2648 100644
--- a/plc4rust/generated-sources/modbus/src/lib.rs
+++ b/plc4rust/generated-sources/modbus/src/lib.rs
@@ -1,19 +1,21 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
mod ModbusPDUGetComEventCounterResponse;
mod ModbusPDUWriteFileRecordRequestItem;
diff --git a/plc4rust/server/Cargo.toml b/plc4rust/server/Cargo.toml
index 057a00a025..dc3b87b14c 100644
--- a/plc4rust/server/Cargo.toml
+++ b/plc4rust/server/Cargo.toml
@@ -1,3 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
[package]
name = "plc4rust-modbus-server"
version = "0.10.0"
diff --git a/plc4rust/server/src/client.rs b/plc4rust/server/src/client.rs
index 22c14fb3c4..41c4c0a5a0 100644
--- a/plc4rust/server/src/client.rs
+++ b/plc4rust/server/src/client.rs
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
use std::iter;
use tokio::net::{TcpListener, TcpSocket, TcpStream};
use tokio::io::{AsyncReadExt, AsyncWriteExt};
diff --git a/plc4rust/server/src/main.rs b/plc4rust/server/src/main.rs
index 28fb99bdb7..aa7e265daa 100644
--- a/plc4rust/server/src/main.rs
+++ b/plc4rust/server/src/main.rs
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
use tokio::net::{TcpListener, TcpStream};
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use plc4rust::Endianess::BigEndian;