Skip to content

Commit e70669f

Browse files
authored
New 'swift-config' command (#2747)
1 parent f3a9402 commit e70669f

File tree

5 files changed

+28
-0
lines changed

5 files changed

+28
-0
lines changed

artifactory/cli.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"errors"
55
"fmt"
66
"github.com/jfrog/jfrog-cli/docs/artifactory/cocoapodsconfig"
7+
"github.com/jfrog/jfrog-cli/docs/artifactory/swiftconfig"
78
"os"
89
"strconv"
910
"strings"
@@ -420,6 +421,19 @@ func GetCommands() []cli.Command {
420421
return cliutils.RunConfigCmdWithDeprecationWarning("cocoapodsc", "rt", project.Cocoapods, c, cliutils.CreateConfigCmd)
421422
},
422423
},
424+
{
425+
Name: "swift-config",
426+
Hidden: true,
427+
Aliases: []string{"swiftc"},
428+
Flags: cliutils.GetCommandFlags(cliutils.SwiftConfig),
429+
Usage: gradleconfig.GetDescription(),
430+
HelpName: corecommon.CreateUsage("rt swift-config", swiftconfig.GetDescription(), swiftconfig.Usage),
431+
ArgsUsage: common.CreateEnvVars(),
432+
BashComplete: corecommon.CreateBashCompletionFunc(),
433+
Action: func(c *cli.Context) error {
434+
return cliutils.RunConfigCmdWithDeprecationWarning("swiftc", "rt", project.Swift, c, cliutils.CreateConfigCmd)
435+
},
436+
},
423437
{
424438
Name: "docker-promote",
425439
Flags: cliutils.GetCommandFlags(cliutils.DockerPromote),
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package swiftconfig
2+
3+
var Usage = []string{"rt swift-config [command options]"}
4+
5+
func GetDescription() string {
6+
return "Generate swift build configuration."
7+
}

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ require (
167167
gopkg.in/yaml.v3 v3.0.1 // indirect
168168
)
169169

170+
170171
replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20241107130834-59ac9764f8b9
171172

172173
replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.12.5-0.20241107141149-42cf964808a1

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig
3030
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE=
3131
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
3232
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
33+
github.com/barv-jfrog/jfrog-cli-core/v2 v2.0.0-20241107120828-8102dd2efed2 h1:oIPhhUvggGCUlMZxX/VtUIudfK10YDiAKLFbK7p5BJc=
34+
github.com/barv-jfrog/jfrog-cli-core/v2 v2.0.0-20241107120828-8102dd2efed2/go.mod h1:XlN2hMNiNFeNM9aR8H29RZkenI39lDe+LE+BTm1dM6k=
3335
github.com/beevik/etree v1.4.0 h1:oz1UedHRepuY3p4N5OjE0nK1WLCqtzHf25bxplKOHLs=
3436
github.com/beevik/etree v1.4.0/go.mod h1:cyWiXwGoasx60gHvtnEh5x8+uIjUVnjWqBvEnhnqKDA=
3537
github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M=

utils/cliutils/commandsflags.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const (
3838
Mvn = "mvn"
3939
MvnConfig = "mvn-config"
4040
CocoapodsConfig = "cocoapods-config"
41+
SwiftConfig = "swift-config"
4142
Gradle = "gradle"
4243
GradleConfig = "gradle-config"
4344
DockerPromote = "docker-promote"
@@ -1819,6 +1820,9 @@ var commandFlags = map[string][]string{
18191820
CocoapodsConfig: {
18201821
global, serverIdResolve, repoResolve,
18211822
},
1823+
SwiftConfig: {
1824+
global, serverIdResolve, repoResolve,
1825+
},
18221826
MvnConfig: {
18231827
global, serverIdResolve, serverIdDeploy, repoResolveReleases, repoResolveSnapshots, repoDeployReleases, repoDeploySnapshots, includePatterns, excludePatterns, UseWrapper,
18241828
},

0 commit comments

Comments
 (0)