From e70669fb552fde0b513156f42e8a6bca2c611eaf Mon Sep 17 00:00:00 2001 From: Bar Vered <161704690+barv-jfrog@users.noreply.github.com> Date: Sun, 10 Nov 2024 22:34:20 +0200 Subject: [PATCH] New 'swift-config' command (#2747) --- artifactory/cli.go | 14 ++++++++++++++ docs/artifactory/swiftconfig/help.go | 7 +++++++ go.mod | 1 + go.sum | 2 ++ utils/cliutils/commandsflags.go | 4 ++++ 5 files changed, 28 insertions(+) create mode 100644 docs/artifactory/swiftconfig/help.go diff --git a/artifactory/cli.go b/artifactory/cli.go index fb9c2423d..89a8aab0c 100644 --- a/artifactory/cli.go +++ b/artifactory/cli.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "github.com/jfrog/jfrog-cli/docs/artifactory/cocoapodsconfig" + "github.com/jfrog/jfrog-cli/docs/artifactory/swiftconfig" "os" "strconv" "strings" @@ -420,6 +421,19 @@ func GetCommands() []cli.Command { return cliutils.RunConfigCmdWithDeprecationWarning("cocoapodsc", "rt", project.Cocoapods, c, cliutils.CreateConfigCmd) }, }, + { + Name: "swift-config", + Hidden: true, + Aliases: []string{"swiftc"}, + Flags: cliutils.GetCommandFlags(cliutils.SwiftConfig), + Usage: gradleconfig.GetDescription(), + HelpName: corecommon.CreateUsage("rt swift-config", swiftconfig.GetDescription(), swiftconfig.Usage), + ArgsUsage: common.CreateEnvVars(), + BashComplete: corecommon.CreateBashCompletionFunc(), + Action: func(c *cli.Context) error { + return cliutils.RunConfigCmdWithDeprecationWarning("swiftc", "rt", project.Swift, c, cliutils.CreateConfigCmd) + }, + }, { Name: "docker-promote", Flags: cliutils.GetCommandFlags(cliutils.DockerPromote), diff --git a/docs/artifactory/swiftconfig/help.go b/docs/artifactory/swiftconfig/help.go new file mode 100644 index 000000000..2a6581948 --- /dev/null +++ b/docs/artifactory/swiftconfig/help.go @@ -0,0 +1,7 @@ +package swiftconfig + +var Usage = []string{"rt swift-config [command options]"} + +func GetDescription() string { + return "Generate swift build configuration." +} diff --git a/go.mod b/go.mod index f41a75d4e..09f23b1f1 100644 --- a/go.mod +++ b/go.mod @@ -167,6 +167,7 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) + replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20241107130834-59ac9764f8b9 replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.12.5-0.20241107141149-42cf964808a1 diff --git a/go.sum b/go.sum index cac6140ab..c732ce200 100644 --- a/go.sum +++ b/go.sum @@ -30,6 +30,8 @@ github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/barv-jfrog/jfrog-cli-core/v2 v2.0.0-20241107120828-8102dd2efed2 h1:oIPhhUvggGCUlMZxX/VtUIudfK10YDiAKLFbK7p5BJc= +github.com/barv-jfrog/jfrog-cli-core/v2 v2.0.0-20241107120828-8102dd2efed2/go.mod h1:XlN2hMNiNFeNM9aR8H29RZkenI39lDe+LE+BTm1dM6k= github.com/beevik/etree v1.4.0 h1:oz1UedHRepuY3p4N5OjE0nK1WLCqtzHf25bxplKOHLs= github.com/beevik/etree v1.4.0/go.mod h1:cyWiXwGoasx60gHvtnEh5x8+uIjUVnjWqBvEnhnqKDA= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= diff --git a/utils/cliutils/commandsflags.go b/utils/cliutils/commandsflags.go index 0274ad6c0..ed38ec66c 100644 --- a/utils/cliutils/commandsflags.go +++ b/utils/cliutils/commandsflags.go @@ -38,6 +38,7 @@ const ( Mvn = "mvn" MvnConfig = "mvn-config" CocoapodsConfig = "cocoapods-config" + SwiftConfig = "swift-config" Gradle = "gradle" GradleConfig = "gradle-config" DockerPromote = "docker-promote" @@ -1819,6 +1820,9 @@ var commandFlags = map[string][]string{ CocoapodsConfig: { global, serverIdResolve, repoResolve, }, + SwiftConfig: { + global, serverIdResolve, repoResolve, + }, MvnConfig: { global, serverIdResolve, serverIdDeploy, repoResolveReleases, repoResolveSnapshots, repoDeployReleases, repoDeploySnapshots, includePatterns, excludePatterns, UseWrapper, },