Skip to content

Commit 6c6626d

Browse files
committed
Deprecated --build-cache-path option in compile
1 parent 85019b5 commit 6c6626d

File tree

4 files changed

+164
-157
lines changed

4 files changed

+164
-157
lines changed

commands/service_compile.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func (s *arduinoCoreServerImpl) Compile(req *rpc.CompileRequest, stream rpc.Ardu
178178
var extraCoreBuildCachePaths paths.PathList
179179
if buildPath == nil {
180180
var buildCachePath *paths.Path
181-
if p := req.GetBuildCachePath(); p != "" {
181+
if p := req.GetBuildCachePath(); p != "" { //nolint:staticcheck
182182
buildCachePath = paths.New(p)
183183
} else {
184184
buildCachePath = s.settings.GetBuildCachePath()

internal/cli/compile/compile.go

+4
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ func NewCommand(srv rpc.ArduinoCoreServiceServer, settings *rpc.Configuration) *
8686
" " + os.Args[0] + ` compile -b arduino:avr:uno --build-property build.extra_flags=-DPIN=2 --build-property "compiler.cpp.extra_flags=\"-DSSID=\"hello world\"\"" /home/user/Arduino/MySketch` + "\n",
8787
Args: cobra.MaximumNArgs(1),
8888
Run: func(cmd *cobra.Command, args []string) {
89+
if cmd.Flag("build-cache-path").Changed {
90+
feedback.Warning(i18n.Tr("The flag --build-cache-path has been deprecated. Please use just --build-path alone or configure the build cache path in the Arduino CLI settings."))
91+
}
8992
runCompileCommand(cmd, args, srv)
9093
},
9194
}
@@ -96,6 +99,7 @@ func NewCommand(srv rpc.ArduinoCoreServiceServer, settings *rpc.Configuration) *
9699
showPropertiesArg.AddToCommand(compileCommand)
97100
compileCommand.Flags().BoolVar(&preprocess, "preprocess", false, i18n.Tr("Print preprocessed code to stdout instead of compiling."))
98101
compileCommand.Flags().StringVar(&buildCachePath, "build-cache-path", "", i18n.Tr("Builds of cores and sketches are saved into this path to be cached and reused."))
102+
compileCommand.Flag("build-cache-path").Hidden = true // deprecated
99103
compileCommand.Flags().StringVar(&exportDir, "output-dir", "", i18n.Tr("Save build artifacts in this directory."))
100104
compileCommand.Flags().StringVar(&buildPath, "build-path", "",
101105
i18n.Tr("Path where to save compiled files. If omitted, a directory will be created in the default temporary path of your OS."))

0 commit comments

Comments
 (0)