Skip to content

Commit f85b5f8

Browse files
Reorganize project structure
1 parent 236ab8b commit f85b5f8

31 files changed

+121
-86
lines changed

Taskfile.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,21 @@ tasks:
6565
vars:
6666
VERSION: "{{.VERSION }}"
6767
cmds:
68-
- cmd: go build -ldflags "-X main.Version={{.VERSION}}" -v -o ./build/arduino-flasher-cli .
68+
- cmd: go build -ldflags "-X main.Version={{.VERSION}}" -v -o ./build/arduino-flasher-cli ./cmd/arduino-flasher-cli/
6969
platforms: [linux, darwin]
70-
- cmd: go build -ldflags "-X main.Version={{.VERSION}}" -v -o ./build/arduino-flasher-cli.exe .
70+
- cmd: go build -ldflags "-X main.Version={{.VERSION}}" -v -o ./build/arduino-flasher-cli.exe ./cmd/arduino-flasher-cli/
7171
platforms: [windows]
7272

7373
build:artifacts:
7474
desc: Prepare the arduino-flasher-cli artifacts
7575
internal: true
7676
status:
77-
- test -f ./updater/artifacts/resources_darwin_amd64/qdl
78-
- test -f ./updater/artifacts/resources_darwin_arm64/qdl
79-
- test -f ./updater/artifacts/resources_linux_amd64/qdl
80-
- test -f ./updater/artifacts/resources_linux_arm64/qdl
81-
- test -f ./updater/artifacts/resources_windows_amd64/qdl.exe
82-
cmd: sh ./updater/artifacts/download_resources.sh
77+
- test -f ./internal/updater/artifacts/resources_darwin_amd64/qdl
78+
- test -f ./internal/updater/artifacts/resources_darwin_arm64/qdl
79+
- test -f ./internal/updater/artifacts/resources_linux_amd64/qdl
80+
- test -f ./internal/updater/artifacts/resources_linux_arm64/qdl
81+
- test -f ./internal/updater/artifacts/resources_windows_amd64/qdl.exe
82+
cmd: sh ./internal/updater/artifacts/download_resources.sh
8383

8484
release:
8585
desc: Create a tag on the current commit and push it to the remote to create the release

download.go renamed to cmd/arduino-flasher-cli/download/download.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// Arduino software without disclosing the source code of your own applications.
1414
// To purchase a commercial license, send an email to license@arduino.cc.
1515

16-
package main
16+
package download
1717

1818
import (
1919
"context"
@@ -22,12 +22,12 @@ import (
2222
"github.com/arduino/go-paths-helper"
2323
"github.com/spf13/cobra"
2424

25-
"github.com/arduino/arduino-flasher-cli/feedback"
26-
"github.com/arduino/arduino-flasher-cli/i18n"
27-
"github.com/arduino/arduino-flasher-cli/updater"
25+
"github.com/arduino/arduino-flasher-cli/cmd/feedback"
26+
"github.com/arduino/arduino-flasher-cli/cmd/i18n"
27+
"github.com/arduino/arduino-flasher-cli/internal/updater"
2828
)
2929

30-
func newDownloadCmd() *cobra.Command {
30+
func NewDownloadCmd() *cobra.Command {
3131
var destDir string
3232
cmd := &cobra.Command{
3333
Use: "download",

drivers.go renamed to cmd/arduino-flasher-cli/drivers/drivers.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
// Arduino software without disclosing the source code of your own applications.
1414
// To purchase a commercial license, send an email to license@arduino.cc.
1515

16-
package main
16+
package drivers
1717

1818
import (
1919
"github.com/spf13/cobra"
2020

21-
"github.com/arduino/arduino-flasher-cli/feedback"
22-
"github.com/arduino/arduino-flasher-cli/i18n"
21+
"github.com/arduino/arduino-flasher-cli/cmd/feedback"
22+
"github.com/arduino/arduino-flasher-cli/cmd/i18n"
2323
)
2424

25-
func newInstallDriversCmd() *cobra.Command {
25+
func NewInstallDriversCmd() *cobra.Command {
2626
cmd := &cobra.Command{
2727
Use: "install-drivers",
2828
Hidden: true,

drivers_others.go renamed to cmd/arduino-flasher-cli/drivers/drivers_others.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
//go:build !windows
1717

18-
package main
18+
package drivers
1919

2020
// installDrivers is a no-op on non-Windows platforms
2121
func installDrivers() error {

drivers_windows.go renamed to cmd/arduino-flasher-cli/drivers/drivers_windows.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// Arduino software without disclosing the source code of your own applications.
1414
// To purchase a commercial license, send an email to license@arduino.cc.
1515

16-
package main
16+
package drivers
1717

1818
import (
1919
"embed"
@@ -23,7 +23,7 @@ import (
2323
"github.com/arduino/go-paths-helper"
2424
)
2525

26-
//go:embed drivers
26+
//go:embed src
2727
var drivers embed.FS
2828

2929
// installDrivers installs the Windows driver using dpinst.exe. This requires
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

flash.go renamed to cmd/arduino-flasher-cli/flash/flash.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// Arduino software without disclosing the source code of your own applications.
1414
// To purchase a commercial license, send an email to license@arduino.cc.
1515

16-
package main
16+
package flash
1717

1818
import (
1919
"context"
@@ -26,12 +26,12 @@ import (
2626
runas "github.com/arduino/go-windows-runas"
2727
"github.com/spf13/cobra"
2828

29-
"github.com/arduino/arduino-flasher-cli/feedback"
30-
"github.com/arduino/arduino-flasher-cli/i18n"
31-
"github.com/arduino/arduino-flasher-cli/updater"
29+
"github.com/arduino/arduino-flasher-cli/cmd/feedback"
30+
"github.com/arduino/arduino-flasher-cli/cmd/i18n"
31+
"github.com/arduino/arduino-flasher-cli/internal/updater"
3232
)
3333

34-
func newFlashCmd() *cobra.Command {
34+
func NewFlashCmd() *cobra.Command {
3535
var forceYes bool
3636
var tempDir string
3737
appCmd := &cobra.Command{

0 commit comments

Comments
 (0)