You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2023/05/17 10:09:13 UTC

[plc4x] branch develop updated (2d95306984 -> 320c7095c1)

This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git


    from 2d95306984 build(deps): bump jackson.version from 2.15.0 to 2.15.1 (#951)
     new 262cbc1d9a refactor(plc4go/spi): removed unsued type
     new 320c7095c1 build(plc4x): output command error in case of missing version [skip ci]

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 plc4go/spi/model/DefaultPlcBrowseRequestResult.go  |  45 ---------
 .../DefaultPlcBrowseRequestResult_plc4xgen.go      | 101 ---------------------
 .../spi/model/DefaultPlcUnsubscriptionRequest.go   |   7 +-
 ...=> DefaultPlcUnsubscriptionRequest_plc4xgen.go} |  18 ++--
 .../spi/model/DefaultPlcUnsubscriptionResponse.go  |   4 +-
 ...> DefaultPlcUnsubscriptionResponse_plc4xgen.go} |  18 ++--
 plc4go/spi/model/render_test.go                    |   5 +-
 src/main/script/prerequisiteCheck.groovy           |  36 ++++++--
 8 files changed, 47 insertions(+), 187 deletions(-)
 delete mode 100644 plc4go/spi/model/DefaultPlcBrowseRequestResult.go
 delete mode 100644 plc4go/spi/model/DefaultPlcBrowseRequestResult_plc4xgen.go
 copy plc4go/spi/model/{DefaultArrayInfo_plc4xgen.go => DefaultPlcUnsubscriptionRequest_plc4xgen.go} (69%)
 copy plc4go/spi/model/{DefaultArrayInfo_plc4xgen.go => DefaultPlcUnsubscriptionResponse_plc4xgen.go} (69%)


[plc4x] 01/02: refactor(plc4go/spi): removed unsued type

Posted by sr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 262cbc1d9a4332048732ab7159dfb0fe7930801c
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Wed May 17 11:35:10 2023 +0200

    refactor(plc4go/spi): removed unsued type
---
 plc4go/spi/model/DefaultPlcBrowseRequestResult.go  |  45 ---------
 .../DefaultPlcBrowseRequestResult_plc4xgen.go      | 101 ---------------------
 .../spi/model/DefaultPlcUnsubscriptionRequest.go   |   7 +-
 .../DefaultPlcUnsubscriptionRequest_plc4xgen.go    |  61 +++++++++++++
 .../spi/model/DefaultPlcUnsubscriptionResponse.go  |   4 +-
 .../DefaultPlcUnsubscriptionResponse_plc4xgen.go   |  61 +++++++++++++
 plc4go/spi/model/render_test.go                    |   5 +-
 7 files changed, 129 insertions(+), 155 deletions(-)

diff --git a/plc4go/spi/model/DefaultPlcBrowseRequestResult.go b/plc4go/spi/model/DefaultPlcBrowseRequestResult.go
deleted file mode 100644
index e1f6a39188..0000000000
--- a/plc4go/spi/model/DefaultPlcBrowseRequestResult.go
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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
- *
- *   https://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 model
-
-import apiModel "github.com/apache/plc4x/plc4go/pkg/api/model"
-
-//go:generate go run ../../tools/plc4xgenerator/gen.go -type=DefaultPlcBrowseRequestResult
-type DefaultPlcBrowseRequestResult struct {
-	Request  apiModel.PlcBrowseRequest
-	Response apiModel.PlcBrowseResponse
-	Err      error
-}
-
-func NewDefaultPlcBrowseRequestResult(Request apiModel.PlcBrowseRequest, Response apiModel.PlcBrowseResponse, Err error) apiModel.PlcBrowseRequestResult {
-	return &DefaultPlcBrowseRequestResult{Request, Response, Err}
-}
-
-func (d *DefaultPlcBrowseRequestResult) GetRequest() apiModel.PlcBrowseRequest {
-	return d.Request
-}
-
-func (d *DefaultPlcBrowseRequestResult) GetResponse() apiModel.PlcBrowseResponse {
-	return d.Response
-}
-
-func (d *DefaultPlcBrowseRequestResult) GetErr() error {
-	return d.Err
-}
diff --git a/plc4go/spi/model/DefaultPlcBrowseRequestResult_plc4xgen.go b/plc4go/spi/model/DefaultPlcBrowseRequestResult_plc4xgen.go
deleted file mode 100644
index 8f6b1f3154..0000000000
--- a/plc4go/spi/model/DefaultPlcBrowseRequestResult_plc4xgen.go
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * 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
- *
- *   https://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.
- */
-
-// Code generated by "plc4xgenerator -type=DefaultPlcBrowseRequestResult"; DO NOT EDIT.
-
-package model
-
-import (
-	"context"
-	"encoding/binary"
-	"fmt"
-	"github.com/apache/plc4x/plc4go/spi/utils"
-)
-
-var _ = fmt.Printf
-
-func (d *DefaultPlcBrowseRequestResult) Serialize() ([]byte, error) {
-	wb := utils.NewWriteBufferByteBased(utils.WithByteOrderForByteBasedBuffer(binary.BigEndian))
-	if err := d.SerializeWithWriteBuffer(context.Background(), wb); err != nil {
-		return nil, err
-	}
-	return wb.GetBytes(), nil
-}
-
-func (d *DefaultPlcBrowseRequestResult) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error {
-	if err := writeBuffer.PushContext("PlcBrowseRequestResult"); err != nil {
-		return err
-	}
-
-	if d.Request != nil {
-		if serializableField, ok := d.Request.(utils.Serializable); ok {
-			if err := writeBuffer.PushContext("request"); err != nil {
-				return err
-			}
-			if err := serializableField.SerializeWithWriteBuffer(ctx, writeBuffer); err != nil {
-				return err
-			}
-			if err := writeBuffer.PopContext("request"); err != nil {
-				return err
-			}
-		} else {
-			stringValue := fmt.Sprintf("%v", d.Request)
-			if err := writeBuffer.WriteString("request", uint32(len(stringValue)*8), "UTF-8", stringValue); err != nil {
-				return err
-			}
-		}
-	}
-
-	if d.Response != nil {
-		if serializableField, ok := d.Response.(utils.Serializable); ok {
-			if err := writeBuffer.PushContext("response"); err != nil {
-				return err
-			}
-			if err := serializableField.SerializeWithWriteBuffer(ctx, writeBuffer); err != nil {
-				return err
-			}
-			if err := writeBuffer.PopContext("response"); err != nil {
-				return err
-			}
-		} else {
-			stringValue := fmt.Sprintf("%v", d.Response)
-			if err := writeBuffer.WriteString("response", uint32(len(stringValue)*8), "UTF-8", stringValue); err != nil {
-				return err
-			}
-		}
-	}
-
-	if d.Err != nil {
-		if err := writeBuffer.WriteString("err", uint32(len(d.Err.Error())*8), "UTF-8", d.Err.Error()); err != nil {
-			return err
-		}
-	}
-	if err := writeBuffer.PopContext("PlcBrowseRequestResult"); err != nil {
-		return err
-	}
-	return nil
-}
-
-func (d *DefaultPlcBrowseRequestResult) String() string {
-	writeBuffer := utils.NewWriteBufferBoxBasedWithOptions(true, true)
-	if err := writeBuffer.WriteSerializable(context.Background(), d); err != nil {
-		return err.Error()
-	}
-	return writeBuffer.GetBox().String()
-}
diff --git a/plc4go/spi/model/DefaultPlcUnsubscriptionRequest.go b/plc4go/spi/model/DefaultPlcUnsubscriptionRequest.go
index 16b9f3bdac..56407bc022 100644
--- a/plc4go/spi/model/DefaultPlcUnsubscriptionRequest.go
+++ b/plc4go/spi/model/DefaultPlcUnsubscriptionRequest.go
@@ -25,8 +25,10 @@ import (
 	apiModel "github.com/apache/plc4x/plc4go/pkg/api/model"
 )
 
+//go:generate go run ../../tools/plc4xgenerator/gen.go -type=DefaultPlcUnsubscriptionRequest
 type DefaultPlcUnsubscriptionRequest struct {
 	// TODO: implement
+	implementMe string
 }
 
 func NewDefaultPlcUnsubscriptionRequest() *DefaultPlcUnsubscriptionRequest {
@@ -43,11 +45,6 @@ func (d DefaultPlcUnsubscriptionRequest) ExecuteWithContext(ctx context.Context)
 	panic("implement me")
 }
 
-func (d DefaultPlcUnsubscriptionRequest) String() string {
-	//TODO implement me
-	panic("implement me")
-}
-
 func (d DefaultPlcUnsubscriptionRequest) IsAPlcMessage() bool {
 	return true
 }
diff --git a/plc4go/spi/model/DefaultPlcUnsubscriptionRequest_plc4xgen.go b/plc4go/spi/model/DefaultPlcUnsubscriptionRequest_plc4xgen.go
new file mode 100644
index 0000000000..f11f2de3ca
--- /dev/null
+++ b/plc4go/spi/model/DefaultPlcUnsubscriptionRequest_plc4xgen.go
@@ -0,0 +1,61 @@
+/*
+ * 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
+ *
+ *   https://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.
+ */
+
+// Code generated by "plc4xgenerator -type=DefaultPlcUnsubscriptionRequest"; DO NOT EDIT.
+
+package model
+
+import (
+	"context"
+	"encoding/binary"
+	"fmt"
+	"github.com/apache/plc4x/plc4go/spi/utils"
+)
+
+var _ = fmt.Printf
+
+func (d *DefaultPlcUnsubscriptionRequest) Serialize() ([]byte, error) {
+	wb := utils.NewWriteBufferByteBased(utils.WithByteOrderForByteBasedBuffer(binary.BigEndian))
+	if err := d.SerializeWithWriteBuffer(context.Background(), wb); err != nil {
+		return nil, err
+	}
+	return wb.GetBytes(), nil
+}
+
+func (d *DefaultPlcUnsubscriptionRequest) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error {
+	if err := writeBuffer.PushContext("PlcUnsubscriptionRequest"); err != nil {
+		return err
+	}
+
+	if err := writeBuffer.WriteString("implementMe", uint32(len(d.implementMe)*8), "UTF-8", d.implementMe); err != nil {
+		return err
+	}
+	if err := writeBuffer.PopContext("PlcUnsubscriptionRequest"); err != nil {
+		return err
+	}
+	return nil
+}
+
+func (d *DefaultPlcUnsubscriptionRequest) String() string {
+	writeBuffer := utils.NewWriteBufferBoxBasedWithOptions(true, true)
+	if err := writeBuffer.WriteSerializable(context.Background(), d); err != nil {
+		return err.Error()
+	}
+	return writeBuffer.GetBox().String()
+}
diff --git a/plc4go/spi/model/DefaultPlcUnsubscriptionResponse.go b/plc4go/spi/model/DefaultPlcUnsubscriptionResponse.go
index b14d574b5c..0c0240a62b 100644
--- a/plc4go/spi/model/DefaultPlcUnsubscriptionResponse.go
+++ b/plc4go/spi/model/DefaultPlcUnsubscriptionResponse.go
@@ -19,8 +19,10 @@
 
 package model
 
+//go:generate go run ../../tools/plc4xgenerator/gen.go -type=DefaultPlcUnsubscriptionResponse
 type DefaultPlcUnsubscriptionResponse struct {
-	// TODO: implement me
+	// TODO: implement
+	implementMe string
 }
 
 func NewDefaultPlcUnsubscriptionResponse() *DefaultPlcUnsubscriptionResponse {
diff --git a/plc4go/spi/model/DefaultPlcUnsubscriptionResponse_plc4xgen.go b/plc4go/spi/model/DefaultPlcUnsubscriptionResponse_plc4xgen.go
new file mode 100644
index 0000000000..ddb8dc6798
--- /dev/null
+++ b/plc4go/spi/model/DefaultPlcUnsubscriptionResponse_plc4xgen.go
@@ -0,0 +1,61 @@
+/*
+ * 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
+ *
+ *   https://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.
+ */
+
+// Code generated by "plc4xgenerator -type=DefaultPlcUnsubscriptionResponse"; DO NOT EDIT.
+
+package model
+
+import (
+	"context"
+	"encoding/binary"
+	"fmt"
+	"github.com/apache/plc4x/plc4go/spi/utils"
+)
+
+var _ = fmt.Printf
+
+func (d *DefaultPlcUnsubscriptionResponse) Serialize() ([]byte, error) {
+	wb := utils.NewWriteBufferByteBased(utils.WithByteOrderForByteBasedBuffer(binary.BigEndian))
+	if err := d.SerializeWithWriteBuffer(context.Background(), wb); err != nil {
+		return nil, err
+	}
+	return wb.GetBytes(), nil
+}
+
+func (d *DefaultPlcUnsubscriptionResponse) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error {
+	if err := writeBuffer.PushContext("PlcUnsubscriptionResponse"); err != nil {
+		return err
+	}
+
+	if err := writeBuffer.WriteString("implementMe", uint32(len(d.implementMe)*8), "UTF-8", d.implementMe); err != nil {
+		return err
+	}
+	if err := writeBuffer.PopContext("PlcUnsubscriptionResponse"); err != nil {
+		return err
+	}
+	return nil
+}
+
+func (d *DefaultPlcUnsubscriptionResponse) String() string {
+	writeBuffer := utils.NewWriteBufferBoxBasedWithOptions(true, true)
+	if err := writeBuffer.WriteSerializable(context.Background(), d); err != nil {
+		return err.Error()
+	}
+	return writeBuffer.GetBox().String()
+}
diff --git a/plc4go/spi/model/render_test.go b/plc4go/spi/model/render_test.go
index e721112ecf..1608cac319 100644
--- a/plc4go/spi/model/render_test.go
+++ b/plc4go/spi/model/render_test.go
@@ -44,7 +44,6 @@ func TestRenderTest(t *testing.T) {
 		&DefaultPlcBrowseItem{},
 		&DefaultPlcBrowseRequest{},
 		&DefaultPlcBrowseRequestBuilder{},
-		&DefaultPlcBrowseRequestResult{},
 		&DefaultPlcBrowseResponse{},
 		&DefaultPlcBrowseResponseItem{},
 		&DefaultPlcConsumerRegistration{},
@@ -60,9 +59,9 @@ func TestRenderTest(t *testing.T) {
 		&DefaultPlcSubscriptionResponse{},
 		&DefaultPlcSubscriptionResponseItem{},
 		&DefaultPlcTagRequest{},
-		//&DefaultPlcUnsubscriptionRequest{}, //TODO: empty file
+		&DefaultPlcUnsubscriptionRequest{},
 		&DefaultPlcUnsubscriptionRequestResult{},
-		//&DefaultPlcUnsubscriptionResponse{}, //TODO: empty file
+		&DefaultPlcUnsubscriptionResponse{},
 		&DefaultPlcWriteRequest{DefaultPlcTagRequest: NewDefaultPlcTagRequest(nil, nil)},
 		&DefaultPlcWriteRequestResult{},
 		&DefaultPlcWriteResponse{},


[plc4x] 02/02: build(plc4x): output command error in case of missing version [skip ci]

Posted by sr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 320c7095c180c90e2c17caf033d124273d9b3846
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Wed May 17 12:09:06 2023 +0200

    build(plc4x): output command error in case of missing version [skip ci]
---
 src/main/script/prerequisiteCheck.groovy | 36 +++++++++++++++++++++++---------
 1 file changed, 26 insertions(+), 10 deletions(-)

diff --git a/src/main/script/prerequisiteCheck.groovy b/src/main/script/prerequisiteCheck.groovy
index f8bb664896..b93af0a567 100644
--- a/src/main/script/prerequisiteCheck.groovy
+++ b/src/main/script/prerequisiteCheck.groovy
@@ -77,11 +77,14 @@ def checkVersionAtMost(String current, String maximum) {
 
 def checkDotnet() {
     print "Detecting Dotnet version:  "
-    def output
+    def output = new StringBuffer()
+    def errOutput = new StringBuffer()
     try {
-        output = "dotnet --version".execute().text
-    } catch (IOException ignored) {
+        def proc = "dotnet --version".execute()
+        proc.waitForProcessOutput(output, errOutput)
+    } catch (IOException e) {
         output = ""
+        errOutput.append(e)
     }
     Matcher matcher = extractVersion(output)
     if (matcher.size() > 0) {
@@ -94,6 +97,7 @@ def checkDotnet() {
         println "missing"
         println "--- output of version `dotnet --version` command ---"
         println output
+        println errOutput
         println "----------------------------------------------------"
         allConditionsMet = false
     }
@@ -141,11 +145,14 @@ def checkMavenVersion(String minVersion, String maxVersion) {
 def checkGcc() {
     print "Detecting Gcc version:     "
     // TODO: For windows, check that mingw32-make is on the PATH
-    def output
+    def output = new StringBuffer()
+    def errOutput = new StringBuffer()
     try {
-        output = "gcc --version".execute().text
+        def proc = "gcc --version".execute()
+        proc.waitForProcessOutput(output, errOutput)
     } catch (IOException ignored) {
         output = ""
+        errOutput.append(e)
     }
     Matcher matcher = extractVersion(output)
     if (matcher.size() > 0) {
@@ -158,6 +165,7 @@ def checkGcc() {
         println "missing"
         println "--- output of version `gcc --version` command ---"
         println output
+        println errOutput
         println "-------------------------------------------------"
         allConditionsMet = false
     }
@@ -165,11 +173,14 @@ def checkGcc() {
 
 def checkGit() {
     print "Detecting Git version:     "
-    def output
+    def output = new StringBuffer()
+    def errOutput = new StringBuffer()
     try {
-        output = "git --version".execute().text
+        def proc = "git --version".execute()
+        proc.waitForProcessOutput(output, errOutput)
     } catch (IOException ignored) {
         output = ""
+        errOutput.append(e)
     }
     Matcher matcher = extractVersion(output)
     if (matcher.size() > 0) {
@@ -182,6 +193,7 @@ def checkGit() {
         println "missing"
         println "--- output of version `git --version` command ---"
         println output
+        println errOutput
         println "-------------------------------------------------"
         allConditionsMet = false
     }
@@ -253,11 +265,14 @@ def checkPythonVenv() {
 // Not only should the docker executable be available, but also should the docker daemon be running.
 def checkDocker() {
     print "Detecting Docker version:  "
-    def output
+    def output = new StringBuilder()
+    def errOutput = new StringBuilder()
     try {
-        output = "docker info".execute().text
-    } catch (IOException ignored) {
+        def proc = "docker info".execute()
+        proc.waitForProcessOutput(output, errOutput)
+    } catch (IOException e) {
         output = ""
+        errOutput.append(e)
     }
     // Check if Docker is installed at all
     def matcher1 = output =~ /Server:/
@@ -278,6 +293,7 @@ def checkDocker() {
         println "missing"
         println "--- output of version `docker info` command ---"
         println output
+        println errOutput
         println "-----------------------------------------------"
         allConditionsMet = false
     }