Skip to content

Commit

Permalink
New 'swift-config' command (#2747)
Browse files Browse the repository at this point in the history
  • Loading branch information
barv-jfrog authored Nov 10, 2024
1 parent f3a9402 commit e70669f
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions artifactory/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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),
Expand Down
7 changes: 7 additions & 0 deletions docs/artifactory/swiftconfig/help.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package swiftconfig

var Usage = []string{"rt swift-config [command options]"}

func GetDescription() string {
return "Generate swift build configuration."
}
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
4 changes: 4 additions & 0 deletions utils/cliutils/commandsflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const (
Mvn = "mvn"
MvnConfig = "mvn-config"
CocoapodsConfig = "cocoapods-config"
SwiftConfig = "swift-config"
Gradle = "gradle"
GradleConfig = "gradle-config"
DockerPromote = "docker-promote"
Expand Down Expand Up @@ -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,
},
Expand Down

0 comments on commit e70669f

Please sign in to comment.