Skip to content

Commit bb9c49c

Browse files
committed
feat: Added an initial version of an improved UMAS mspec.
chore: Fixed some rat-plugin related warnings.
1 parent a6e9e7f commit bb9c49c

File tree

10 files changed

+811
-69
lines changed

10 files changed

+811
-69
lines changed

plc4c/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,10 @@
273273
<groupId>org.apache.rat</groupId>
274274
<artifactId>apache-rat-plugin</artifactId>
275275
<configuration>
276-
<excludes combine.children="append">
277-
<exclude>cmake-*/**</exclude>
278-
<exclude>.cmake/**</exclude>
279-
</excludes>
276+
<inputExcludes combine.children="append">
277+
<inputExclude>cmake-*/**</inputExclude>
278+
<inputExclude>.cmake/**</inputExclude>
279+
</inputExcludes>
280280
</configuration>
281281
</plugin>
282282
</plugins>

plc4py/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@
286286
</goals>
287287
<configuration>
288288
<protocolName>umas</protocolName>
289+
<protocolVersion>0</protocolVersion>
289290
<languageName>python</languageName>
290291
<outputFlavor>read-write</outputFlavor>
291292
<outputDir>${project.basedir}/plc4py/protocols</outputDir>

pom.xml

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -665,125 +665,125 @@
665665
</executions>
666666
<configuration>
667667
<useMavenDefaultExcludes>true</useMavenDefaultExcludes>
668-
<excludes>
668+
<inputExcludes>
669669
<!-- Git related files -->
670-
<exclude>**/.git/**</exclude>
671-
<exclude>**/.gitignore</exclude>
672-
<exclude>**/cmake-*/**</exclude>
673-
<exclude>**/.lock/**</exclude>
670+
<inputExclude>**/.git/**</inputExclude>
671+
<inputExclude>**/.gitignore</inputExclude>
672+
<inputExclude>**/cmake-*/**</inputExclude>
673+
<inputExclude>**/.lock/**</inputExclude>
674674
675675
<!-- License Files for other licenses -->
676-
<exclude>**/UNLICENSE</exclude>
677-
<exclude>**/CHANGELOG.md</exclude>
678-
<exclude>**/EPL-2.0</exclude>
676+
<inputExclude>**/UNLICENSE</inputExclude>
677+
<inputExclude>**/CHANGELOG.md</inputExclude>
678+
<inputExclude>**/EPL-2.0</inputExclude>
679679
680680
<!--
681681
Files licensed under other compatible licenses.
682682
-->
683-
<exclude>**/Expression.g4</exclude>
683+
<excinputExcludelude>**/Expression.g4</excinputExcludelude>
684684
685685
<!-- Maven related files -->
686-
<exclude>**/target/**</exclude>
687-
<exclude>target/**</exclude>
688-
<exclude>out/**</exclude>
686+
<inputExclude>**/target/**</inputExclude>
687+
<inputExclude>target/**</inputExclude>
688+
<inputExclude>out/**</inputExclude>
689689
690690
<!-- Python related files -->
691-
<exclude>**/.pytest_cache/**</exclude>
692-
<exclude>**/.mypy_cache/**</exclude>
693-
<exclude>**/Pipfile</exclude>
694-
<exclude>**/Pipfile.lock</exclude>
691+
<inputExclude>**/.pytest_cache/**</inputExclude>
692+
<inputExclude>**/.mypy_cache/**</inputExclude>
693+
<inputExclude>**/Pipfile</inputExclude>
694+
<inputExclude>**/Pipfile.lock</inputExclude>
695695
696696
<!-- Eclipse related files -->
697-
<exclude>**/.project</exclude>
698-
<exclude>**/.settings/**</exclude>
699-
<exclude>**/.classpath</exclude>
700-
<exclude>**/.factorypath</exclude>
697+
<inputExclude>**/.project</inputExclude>
698+
<inputExclude>**/.settings/**</inputExclude>
699+
<inputExclude>**/.classpath</inputExclude>
700+
<inputExclude>**/.factorypath</inputExclude>
701701
702702
<!-- IntelliJ related files -->
703-
<exclude>**/.idea/**</exclude>
704-
<exclude>**/*.iml</exclude>
705-
<exclude>**/.attach_pid*</exclude>
703+
<inputExclude>**/.idea/**</inputExclude>
704+
<inputExclude>**/*.iml</inputExclude>
705+
<inputExclude>**/.attach_pid*</inputExclude>
706706
707707
<!-- Wireshark Captures -->
708-
<exclude>**/*.pcap</exclude>
709-
<exclude>**/*.pcapng</exclude>
708+
<inputExclude>**/*.pcap</inputExclude>
709+
<inputExclude>**/*.pcapng</inputExclude>
710710
711711
<!-- JEVN local version files -->
712-
<exclude>**/.java-version</exclude>
712+
<inputExclude>**/.java-version</inputExclude>
713713
714714
<!-- ASCIIdoctor generated files -->
715-
<exclude>**/.asciidoctor/**</exclude>
715+
<inputExclude>**/.asciidoctor/**</inputExclude>
716716
717717
<!-- Jenkins build and docker-compose related files -->
718-
<exclude>.repository/**</exclude>
719-
<exclude>local-snapshots-dir/**</exclude>
720-
<exclude>.local-snapshots-dir/**</exclude>
718+
<inputExclude>.repository/**</inputExclude>
719+
<inputExclude>local-snapshots-dir/**</inputExclude>
720+
<inputExclude>.local-snapshots-dir/**</inputExclude>
721721
722722
<!-- Data files created by examples running an embedded elasticsearch -->
723-
<exclude>elasticsearch-data/**</exclude>
723+
<inputExclude>elasticsearch-data/**</inputExclude>
724724
725725
<!-- JSON doesn't like comments -->
726-
<exclude>**/*.json</exclude>
727-
<exclude>**/*.avsc</exclude>
726+
<inputExclude>**/*.json</inputExclude>
727+
<inputExclude>**/*.avsc</inputExclude>
728728
729729
<!-- comments are trouble some for CSVs which are static -->
730-
<exclude>**/*.csv</exclude>
730+
<inputExclude>**/*.csv</inputExclude>
731731
732732
<!-- Output of the profiler maven extension -->
733-
<exclude>**/.profiler/**</exclude>
733+
<inputExclude>**/.profiler/**</inputExclude>
734734
735735
<!-- CLion stuff (C++ IDE) -->
736-
<exclude>**/cmake-build-debug/**</exclude>
737-
<exclude>**/*.make</exclude>
738-
<exclude>**/*.cmake</exclude>
739-
<exclude>**/*.internal</exclude>
740-
<exclude>**/link.txt</exclude>
736+
<inputExclude>**/cmake-build-debug/**</inputExclude>
737+
<inputExclude>**/*.make</inputExclude>
738+
<inputExclude>**/*.cmake</inputExclude>
739+
<inputExclude>**/*.internal</inputExclude>
740+
<inputExclude>**/link.txt</inputExclude>
741741
<!-- Not sure why I can't exclude all Makefile's from just the plc4c directory -->
742742
<!-- exclude>**/Makefile</exclude -->
743-
<exclude>**/Makefile</exclude>
744-
<exclude>**/*.includecache</exclude>
745-
<exclude>**/CMakeFiles/**</exclude>
746-
<exclude>**/CMakeCache.txt</exclude>
747-
<exclude>**/DartConfiguration.tcl</exclude>
743+
<inputExclude>**/Makefile</inputExclude>
744+
<inputExclude>**/*.includecache</inputExclude>
745+
<inputExclude>**/CMakeFiles/**</inputExclude>
746+
<inputExclude>**/CMakeCache.txt</inputExclude>
747+
<inputExclude>**/DartConfiguration.tcl</inputExclude>
748748
749749
<!-- .Net stuff -->
750-
<exclude>plc4net/plc4net.sln.DotSettings.user</exclude>
750+
<inputExclude>plc4net/plc4net.sln.DotSettings.user</inputExclude>
751751
752752
<!-- Stuff created during a plc4net build -->
753-
<exclude>**/obj/**</exclude>
753+
<inputExclude>**/obj/**</inputExclude>
754754
755755
<!-- Temporarily exclude generated code from thrift in python modules -->
756756
<!--exclude>generated/**</exclude-->
757757
<!-- Temporary Python files -->
758-
<exclude>**/.eggs/**</exclude>
759-
<exclude>**/plc4py.egg-info/**</exclude>
758+
<inputExclude>**/.eggs/**</inputExclude>
759+
<inputExclude>**/plc4py.egg-info/**</inputExclude>
760760
761761
<!-- Temporary Python virtualenv files-->
762-
<exclude>**/venv/**</exclude>
762+
<inputExclude>**/venv/**</inputExclude>
763763
764764
<!-- Temporary pytest and mypy folders -->
765-
<exclude>**/.mypy_cache/**</exclude>
766-
<exclude>**/.pytest_cache/**</exclude>
765+
<inputExclude>**/.mypy_cache/**</inputExclude>
766+
<inputExclude>**/.pytest_cache/**</inputExclude>
767767
768768
<!-- Exclude a temp file needed by Docker -->
769-
<exclude>project_version</exclude>
769+
<inputExclude>project_version</inputExclude>
770770
771771
<!-- Exclude files generated by the go build system -->
772-
<exclude>**/go.sum</exclude>
772+
<inputExclude>**/go.sum</inputExclude>
773773
774774
<!-- Exclude Node related files -->
775-
<exclude>ui/frontend/project/dist/**</exclude>
776-
<exclude>ui/frontend/project/node/**</exclude>
777-
<exclude>ui/frontend/project/node_modules/**</exclude>
775+
<inputExclude>ui/frontend/project/dist/**</inputExclude>
776+
<inputExclude>ui/frontend/project/node/**</inputExclude>
777+
<inputExclude>ui/frontend/project/node_modules/**</inputExclude>
778778
779-
<exclude>website/node_modules/**</exclude>
779+
<inputExclude>website/node_modules/**</inputExclude>
780780
781-
<exclude>.mvn/**</exclude>
781+
<inputExclude>.mvn/**</inputExclude>
782782
783783
<!-- Exclude core dumps-->
784-
<exclude>**/hs_err_pid*</exclude>
785-
<exclude>**/replay_pid*</exclude>
786-
</excludes>
784+
<inputExclude>**/hs_err_pid*</inputExclude>
785+
<inputExclude>**/replay_pid*</inputExclude>
786+
</inputExcludes>
787787
</configuration>
788788
</plugin>
789789

protocols/umas/src/main/java/org/apache/plc4x/protocol/umas/UmasProtocol.java renamed to protocols/umas/src/main/java/org/apache/plc4x/protocol/umas/v0/UmasProtocol.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package org.apache.plc4x.protocol.umas;
19+
package org.apache.plc4x.protocol.umas.v0;
2020

2121
import org.apache.plc4x.plugins.codegenerator.language.mspec.parser.MessageFormatParser;
2222
import org.apache.plc4x.plugins.codegenerator.language.mspec.protocol.ProtocolHelpers;
@@ -25,13 +25,20 @@
2525
import org.apache.plc4x.plugins.codegenerator.protocol.TypeContext;
2626
import org.apache.plc4x.plugins.codegenerator.types.exceptions.GenerationException;
2727

28+
import java.util.Optional;
29+
2830
public class UmasProtocol implements Protocol, ProtocolHelpers {
2931

3032
@Override
3133
public String getName() {
3234
return "umas";
3335
}
3436

37+
@Override
38+
public Optional<String> getVersion() {
39+
return Optional.of("0");
40+
}
41+
3542
@Override
3643
public TypeContext getTypeContext() throws GenerationException {
3744
ValidatableTypeContext typeContext = new MessageFormatParser().parse(getMspecStream());
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* https://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.apache.plc4x.protocol.umas.v1;
20+
21+
import org.apache.plc4x.plugins.codegenerator.language.mspec.parser.MessageFormatParser;
22+
import org.apache.plc4x.plugins.codegenerator.language.mspec.protocol.ProtocolHelpers;
23+
import org.apache.plc4x.plugins.codegenerator.language.mspec.protocol.ValidatableTypeContext;
24+
import org.apache.plc4x.plugins.codegenerator.protocol.Protocol;
25+
import org.apache.plc4x.plugins.codegenerator.protocol.TypeContext;
26+
import org.apache.plc4x.plugins.codegenerator.types.exceptions.GenerationException;
27+
28+
import java.util.Optional;
29+
30+
public class UmasProtocol implements Protocol, ProtocolHelpers {
31+
32+
@Override
33+
public String getName() {
34+
return "umas";
35+
}
36+
37+
@Override
38+
public Optional<String> getVersion() {
39+
return Optional.of("1");
40+
}
41+
42+
@Override
43+
public TypeContext getTypeContext() throws GenerationException {
44+
ValidatableTypeContext typeContext = new MessageFormatParser().parse(getMspecStream());
45+
typeContext.validate();
46+
return typeContext;
47+
}
48+
49+
}

protocols/umas/src/main/resources/META-INF/services/org.apache.plc4x.plugins.codegenerator.protocol.Protocol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
#
19-
org.apache.plc4x.protocol.umas.UmasProtocol
19+
org.apache.plc4x.protocol.umas.v0.UmasProtocol
20+
org.apache.plc4x.protocol.umas.v1.UmasProtocol

protocols/umas/src/main/resources/protocols/umas/umas.mspec renamed to protocols/umas/src/main/resources/protocols/umas/v0/umas.mspec

File renamed without changes.

0 commit comments

Comments
 (0)