Skip to content

Commit

Permalink
feat(plc4go/tools): add plc4xlicenser to add ASF headers
Browse files Browse the repository at this point in the history
+ This is used in combination of generators which don't support custom file headers e.g. https://pkg.go.dev/golang.org/x/tools/cmd/stringer
- removed github.com/elastic/go-licenser@latest
  • Loading branch information
sruehl committed Jun 19, 2023
1 parent 747e2ee commit 26aee4f
Show file tree
Hide file tree
Showing 10 changed files with 207 additions and 155 deletions.
1 change: 1 addition & 0 deletions plc4go/internal/cbus/TagHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
type TagType uint8

//go:generate stringer -type TagType
//go:generate go run ../../tools/plc4xlicenser/gen.go -type=TagType
const (
STATUS TagType = iota
CAL_RESET /* TODO: implement me*/
Expand Down
35 changes: 18 additions & 17 deletions plc4go/internal/cbus/tagtype_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions plc4go/internal/modbus/TagHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
type TagType uint8

//go:generate stringer -type TagType
//go:generate go run ../../tools/plc4xlicenser/gen.go -type=TagType
const (
Coil TagType = 0x00
DiscreteInput TagType = 0x01
Expand Down
35 changes: 18 additions & 17 deletions plc4go/internal/modbus/tagtype_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions plc4go/internal/s7/TagHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
type TagType uint8

//go:generate stringer -type TagType
//go:generate go run ../../tools/plc4xlicenser/gen.go -type=TagType
const (
S7Tag TagType = 0x00
S7StringTag TagType = 0x01
Expand Down
35 changes: 18 additions & 17 deletions plc4go/internal/s7/tagtype_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

87 changes: 0 additions & 87 deletions plc4go/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -364,18 +364,6 @@
</packages>
</configuration>
</execution>
<execution>
<id>get-licenser</id>
<phase>initialize</phase>
<goals>
<goal>install</goal>
</goals>
<configuration>
<packages>
<package>github.com/elastic/go-licenser@latest</package>
</packages>
</configuration>
</execution>
<execution>
<id>get-go-junit-report</id>
<phase>initialize</phase>
Expand Down Expand Up @@ -429,81 +417,6 @@
</configuration>
</execution>

<!-- Add the apache license header to stuff generated by the stringer -->
<!--
NOTE: Don't try merging the following 4 executions ...
It doesn't work by merging the "packages" sections
TODO: The licenser adds a version of the Apache Header with http url
-->
<execution>
<id>add-license-modbus</id>
<phase>process-sources</phase>
<goals>
<goal>custom</goal>
</goals>
<configuration>
<exec>go-licenser</exec>
<customCommand>-licensor</customCommand>
<buildFlags>
<flag>Apache Software Foundation (ASF)</flag>
</buildFlags>
<packages>
<package>internal/modbus/tagtype_string.go</package>
</packages>
</configuration>
</execution>
<execution>
<id>add-license-cbus</id>
<phase>process-sources</phase>
<goals>
<goal>custom</goal>
</goals>
<configuration>
<exec>go-licenser</exec>
<customCommand>-licensor</customCommand>
<buildFlags>
<flag>Apache Software Foundation (ASF)</flag>
</buildFlags>
<packages>
<package>internal/cbus/tagtype_string.go</package>
</packages>
</configuration>
</execution>
<execution>
<id>add-license-s7</id>
<phase>process-sources</phase>
<goals>
<goal>custom</goal>
</goals>
<configuration>
<exec>go-licenser</exec>
<customCommand>-licensor</customCommand>
<buildFlags>
<flag>Apache Software Foundation (ASF)</flag>
</buildFlags>
<packages>
<package>internal/s7/tagtype_string.go</package>
</packages>
</configuration>
</execution>
<execution>
<id>add-license-spi-testutils</id>
<phase>process-sources</phase>
<goals>
<goal>custom</goal>
</goals>
<configuration>
<exec>go-licenser</exec>
<customCommand>-licensor</customCommand>
<buildFlags>
<flag>Apache Software Foundation (ASF)</flag>
</buildFlags>
<packages>
<package>spi/testutils/steptype_string.go</package>
</packages>
</configuration>
</execution>

<!-- Generate mocks-->
<execution>
<id>generate-mocks</id>
Expand Down
1 change: 1 addition & 0 deletions plc4go/spi/testutils/DriverTestRunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ type DriverTestStep struct {
type StepType uint8

//go:generate stringer -type StepType
//go:generate go run ../../tools/plc4xlicenser/gen.go -type=StepType
const (
StepTypeOutgoingPlcMessage StepType = 0x01
StepTypeOutgoingPlcBytes StepType = 0x02
Expand Down
35 changes: 18 additions & 17 deletions plc4go/spi/testutils/steptype_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 26aee4f

Please sign in to comment.