From 6dbff9f7ba01aca459db2f46dee8816657f589a7 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 28 Nov 2024 11:12:32 +0100 Subject: [PATCH] Made 'version' package internal (#2767) --- Taskfile.yml | 2 +- commands/internal/instances/instances.go | 2 +- commands/service.go | 2 +- commands/service_check_for_updates.go | 2 +- internal/arduino/monitor/monitor.go | 2 +- internal/cli/cli.go | 2 +- internal/cli/compile/compile.go | 2 +- internal/cli/configuration/network.go | 2 +- internal/cli/lib/install.go | 2 +- internal/cli/updater/updater.go | 2 +- internal/cli/upload/upload.go | 2 +- internal/cli/version/version.go | 2 +- {version => internal/version}/version.go | 0 {version => internal/version}/version_test.go | 0 14 files changed, 12 insertions(+), 12 deletions(-) rename {version => internal/version}/version.go (100%) rename {version => internal/version}/version_test.go (100%) diff --git a/Taskfile.yml b/Taskfile.yml index 095cae2dd87..93a1304ce37 100755 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -371,7 +371,7 @@ vars: TAG: sh: echo "$(git tag --points-at=HEAD 2> /dev/null | head -n1 | sed 's/^v//')" VERSION: "{{if .NIGHTLY}}nightly-{{.TIMESTAMP_SHORT}}{{else if .TAG}}{{.TAG}}{{else}}{{.PACKAGE_NAME_PREFIX}}git-snapshot{{end}}" - CONFIGURATION_PACKAGE: "github.com/arduino/arduino-cli/version" + CONFIGURATION_PACKAGE: "github.com/arduino/arduino-cli/internal/version" LDFLAGS: >- -ldflags ' diff --git a/commands/internal/instances/instances.go b/commands/internal/instances/instances.go index 272eaaaafdb..b327bbc1d88 100644 --- a/commands/internal/instances/instances.go +++ b/commands/internal/instances/instances.go @@ -22,8 +22,8 @@ import ( "github.com/arduino/arduino-cli/internal/arduino/cores/packagemanager" "github.com/arduino/arduino-cli/internal/arduino/libraries/librariesindex" "github.com/arduino/arduino-cli/internal/arduino/libraries/librariesmanager" + "github.com/arduino/arduino-cli/internal/version" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" - "github.com/arduino/arduino-cli/version" "github.com/arduino/go-paths-helper" "go.bug.st/downloader/v2" ) diff --git a/commands/service.go b/commands/service.go index 20ffda4de2a..fb226be6035 100644 --- a/commands/service.go +++ b/commands/service.go @@ -19,8 +19,8 @@ import ( "context" "github.com/arduino/arduino-cli/internal/cli/configuration" + "github.com/arduino/arduino-cli/internal/version" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" - "github.com/arduino/arduino-cli/version" ) // NewArduinoCoreServer returns an implementation of the ArduinoCoreService gRPC service diff --git a/commands/service_check_for_updates.go b/commands/service_check_for_updates.go index 15221905d56..2b5c7a51b4e 100644 --- a/commands/service_check_for_updates.go +++ b/commands/service_check_for_updates.go @@ -22,8 +22,8 @@ import ( "github.com/arduino/arduino-cli/internal/cli/feedback" "github.com/arduino/arduino-cli/internal/inventory" + "github.com/arduino/arduino-cli/internal/version" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" - "github.com/arduino/arduino-cli/version" semver "go.bug.st/relaxed-semver" ) diff --git a/internal/arduino/monitor/monitor.go b/internal/arduino/monitor/monitor.go index b4603f0b6c2..1e820ef5d81 100644 --- a/internal/arduino/monitor/monitor.go +++ b/internal/arduino/monitor/monitor.go @@ -28,7 +28,7 @@ import ( "time" "github.com/arduino/arduino-cli/internal/i18n" - "github.com/arduino/arduino-cli/version" + "github.com/arduino/arduino-cli/internal/version" "github.com/arduino/go-paths-helper" "github.com/sirupsen/logrus" ) diff --git a/internal/cli/cli.go b/internal/cli/cli.go index 0bc445b3632..eb5c381abf5 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -44,8 +44,8 @@ import ( "github.com/arduino/arduino-cli/internal/cli/version" "github.com/arduino/arduino-cli/internal/i18n" "github.com/arduino/arduino-cli/internal/inventory" + versioninfo "github.com/arduino/arduino-cli/internal/version" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" - versioninfo "github.com/arduino/arduino-cli/version" "github.com/fatih/color" "github.com/mattn/go-colorable" "github.com/rifflock/lfshook" diff --git a/internal/cli/compile/compile.go b/internal/cli/compile/compile.go index 0fda0ec3dc6..5cccf62ad46 100644 --- a/internal/cli/compile/compile.go +++ b/internal/cli/compile/compile.go @@ -31,8 +31,8 @@ import ( "github.com/arduino/arduino-cli/internal/cli/feedback/table" "github.com/arduino/arduino-cli/internal/cli/instance" "github.com/arduino/arduino-cli/internal/i18n" + "github.com/arduino/arduino-cli/internal/version" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" - "github.com/arduino/arduino-cli/version" "github.com/arduino/go-paths-helper" "github.com/fatih/color" "github.com/sirupsen/logrus" diff --git a/internal/cli/configuration/network.go b/internal/cli/configuration/network.go index 9ffcdf8bd25..2c8a8047ce5 100644 --- a/internal/cli/configuration/network.go +++ b/internal/cli/configuration/network.go @@ -25,7 +25,7 @@ import ( "github.com/arduino/arduino-cli/commands/cmderrors" "github.com/arduino/arduino-cli/internal/i18n" - "github.com/arduino/arduino-cli/version" + "github.com/arduino/arduino-cli/internal/version" "go.bug.st/downloader/v2" ) diff --git a/internal/cli/lib/install.go b/internal/cli/lib/install.go index 29ae88ccdcd..9440a7bdf1e 100644 --- a/internal/cli/lib/install.go +++ b/internal/cli/lib/install.go @@ -26,8 +26,8 @@ import ( "github.com/arduino/arduino-cli/internal/cli/feedback" "github.com/arduino/arduino-cli/internal/cli/instance" "github.com/arduino/arduino-cli/internal/i18n" + "github.com/arduino/arduino-cli/internal/version" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" - "github.com/arduino/arduino-cli/version" "github.com/arduino/go-paths-helper" "github.com/sirupsen/logrus" "github.com/spf13/cobra" diff --git a/internal/cli/updater/updater.go b/internal/cli/updater/updater.go index 0ba9498ab11..aed7c969c4e 100644 --- a/internal/cli/updater/updater.go +++ b/internal/cli/updater/updater.go @@ -20,7 +20,7 @@ import ( "github.com/arduino/arduino-cli/internal/cli/feedback" "github.com/arduino/arduino-cli/internal/i18n" - "github.com/arduino/arduino-cli/version" + "github.com/arduino/arduino-cli/internal/version" "github.com/fatih/color" ) diff --git a/internal/cli/upload/upload.go b/internal/cli/upload/upload.go index 61994d61826..951db75f84a 100644 --- a/internal/cli/upload/upload.go +++ b/internal/cli/upload/upload.go @@ -29,8 +29,8 @@ import ( "github.com/arduino/arduino-cli/internal/cli/feedback/result" "github.com/arduino/arduino-cli/internal/cli/instance" "github.com/arduino/arduino-cli/internal/i18n" + "github.com/arduino/arduino-cli/internal/version" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" - "github.com/arduino/arduino-cli/version" "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) diff --git a/internal/cli/version/version.go b/internal/cli/version/version.go index 5748ded3a64..78ed2dbcffe 100644 --- a/internal/cli/version/version.go +++ b/internal/cli/version/version.go @@ -23,8 +23,8 @@ import ( "github.com/arduino/arduino-cli/internal/cli/feedback" "github.com/arduino/arduino-cli/internal/cli/updater" "github.com/arduino/arduino-cli/internal/i18n" + "github.com/arduino/arduino-cli/internal/version" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" - "github.com/arduino/arduino-cli/version" "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) diff --git a/version/version.go b/internal/version/version.go similarity index 100% rename from version/version.go rename to internal/version/version.go diff --git a/version/version_test.go b/internal/version/version_test.go similarity index 100% rename from version/version_test.go rename to internal/version/version_test.go