Skip to content

Commit

Permalink
Step 1212 ideal step refactor (#181)
Browse files Browse the repository at this point in the history
* Ideal Step project structure.

* Migrate from ExportEnvironmentWithEnvman to stepenv.Set migrate to logger, typo fixes.

* Create xcodebuild package.

* Create simulator package.

* Create testaddon and testartifact packages.

* Move Version func to xcodebuild package.

* Create output package.

* Create xcpretty package.

* Create cache package.

* Break AbsPath dependency.

* Cleanup and unit test for Step.run.

* Fix lint issues.

* Cleanup.

* Test xcodebuild package.

* Update go-utils and go-xcode packages.

* Go dependencies update and cleanup.

* Move testsummaries package to testartifact.

* Cache interface renamed to SwiftPackageCache.

* Migrate to fileutils.FileRemover and introduce createStep.

* simulator.InfoModel renamed to simulator.Info.

* simulator.New renamed to simulator.NewSimulator.

* Make simulator value receiver.

* simulator renamed to defaultSimulator.

* Merge consts in step.go.

* Update test function name.

* Make testartifact.Exporter value receiver.

* Move test repetition and output tool related consts to xcodebuild.

* Reorder xcodebuild's consts and vars.

* Separate prepareSimulator func.

* Merge Result and ExportOpts structs.

* Break Step.Run into smaller functions.

* Break ProcessConfig into smaller functions.

* Fix lint and test issues.

* Restore previous error handling for output export.

* Rename simulator.Simulator to simulator.Manager.

* Rename simulator.Info struct to simulator.Simulator and regenerate simulator package mocks.

* Introduce createConfig and reorganise step.go.

* Introduce createBuildParams and createTestParams.

* Break ioutil.TempDir dependency.

* Merge createTestParams and createTestRunParams.

* Make sure clean is called once.

* Rename simulator manager receiver.
  • Loading branch information
godrei authored Sep 7, 2021
1 parent e60d488 commit 825db06
Show file tree
Hide file tree
Showing 176 changed files with 12,864 additions and 2,693 deletions.
27 changes: 27 additions & 0 deletions cache/cache.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package cache

import (
xcodecache "github.com/bitrise-io/go-xcode/xcodecache"
)

// SwiftPackageCache ...
type SwiftPackageCache interface {
SwiftPackagesPath(projectPth string) (string, error)
CollectSwiftPackages(projectPath string) error
}

type cache struct {
}

// NewSwiftPackageCache ...
func NewSwiftPackageCache() SwiftPackageCache {
return &cache{}
}

func (c cache) SwiftPackagesPath(projectPth string) (string, error) {
return xcodecache.SwiftPackagesPath(projectPth)
}

func (c cache) CollectSwiftPackages(projectPath string) error {
return xcodecache.CollectSwiftPackages(projectPath)
}
45 changes: 45 additions & 0 deletions cache/mocks/Cache.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

94 changes: 0 additions & 94 deletions command/command.go

This file was deleted.

45 changes: 0 additions & 45 deletions command/command_test.go

This file was deleted.

11 changes: 4 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ module github.com/bitrise-steplib/steps-xcode-test
go 1.16

require (
github.com/bitrise-io/bitrise v0.0.0-20210519130014-380842fb41c1
github.com/bitrise-io/go-steputils v0.0.0-20210527075147-910ce7a105a1
github.com/bitrise-io/go-utils v0.0.0-20210520073355-367fa34178f5
github.com/bitrise-io/go-xcode v0.0.0-20210521101355-fb6a1eb6e05b
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.0 // indirect
github.com/bitrise-io/bitrise v0.0.0-20210830100501-97b6f7d7905b
github.com/bitrise-io/go-steputils v0.0.0-20210831050118-9a8de76b2f19
github.com/bitrise-io/go-utils v0.0.0-20210903060322-ecae303f0264
github.com/bitrise-io/go-xcode v0.0.0-20210901135441-4de33870e9ae
github.com/hashicorp/go-version v1.3.0
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
github.com/stretchr/testify v1.7.0
golang.org/x/sys v0.0.0-20210531080801-fdfd190a6549 // indirect
)
36 changes: 22 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/bitrise-io/bitrise v0.0.0-20210519130014-380842fb41c1 h1:PERqeGZZkMrGYSSN/Stk+YkhErgdk37aVqc5UgnIEoo=
github.com/bitrise-io/bitrise v0.0.0-20210519130014-380842fb41c1/go.mod h1:Jqf2PLwOKL1bYdbQIhVkNd55YyYKJBXyY0EtlRg5uw4=
github.com/bitrise-io/bitrise v0.0.0-20210830100501-97b6f7d7905b h1:F0CtuNChYcAbyr9EfA6tKwZ/19ucz6jWEf0TGtYRARA=
github.com/bitrise-io/bitrise v0.0.0-20210830100501-97b6f7d7905b/go.mod h1:jqk9VdrvlRpRfIqA2DZHVNEMvPycmlpBfpiKxk89R6w=
github.com/bitrise-io/colorstring v0.0.0-20180614154802-a8cd70115192/go.mod h1:CIHVcxZUvsG99XUJV6JlR7okNsMMGY81jMvPC20W+O0=
github.com/bitrise-io/envman v0.0.0-20200512105748-919e33f391ee/go.mod h1:m8pTp1o3Sw9uzDxb1WRm5IBRnMau2iOvPMSnRCAhQNI=
github.com/bitrise-io/envman v0.0.0-20210517135508-b2b4fe89eac5/go.mod h1:m8pTp1o3Sw9uzDxb1WRm5IBRnMau2iOvPMSnRCAhQNI=
github.com/bitrise-io/go-plist v0.0.0-20210301100253-4b1a112ccd10/go.mod h1:pARutiL3kEuRLV3JvswidvfCj+9Y3qMZtji2BDqLFsA=
github.com/bitrise-io/go-steputils v0.0.0-20210514150206-5b6261447e77/go.mod h1:H0iZjgsAR5NA6pnlD/zKB6AbxEsskq55pwJ9klVmP8w=
github.com/bitrise-io/go-steputils v0.0.0-20210527075147-910ce7a105a1 h1:gi29hTdxGXAGQvZckPZ9V8BAEfP3eK/tiZgTC5s6h1c=
github.com/bitrise-io/go-steputils v0.0.0-20210527075147-910ce7a105a1/go.mod h1:H0iZjgsAR5NA6pnlD/zKB6AbxEsskq55pwJ9klVmP8w=
github.com/bitrise-io/go-steputils v0.0.0-20210831050118-9a8de76b2f19 h1:ZLuZ7EqpV2mgxEZTZrWxFjDo8t0F576QQLyschuuJRE=
github.com/bitrise-io/go-steputils v0.0.0-20210831050118-9a8de76b2f19/go.mod h1:deuDfnw5Hot7Uajr7gsM5hNKAlKS3iIAPpZgfZSDNOk=
github.com/bitrise-io/go-utils v0.0.0-20210505091801-98b7dc39ee61/go.mod h1:nhdaDQFvaMny1CugVV6KjK92/q97ENo0RuKSW5I4fbA=
github.com/bitrise-io/go-utils v0.0.0-20210505121718-07411d72e36e/go.mod h1:nhdaDQFvaMny1CugVV6KjK92/q97ENo0RuKSW5I4fbA=
github.com/bitrise-io/go-utils v0.0.0-20210507100250-37de47dfa6ce/go.mod h1:15EZZf02noI5nWFqXMZEoyb1CyqYRXTMz5Fyu4CWFzI=
github.com/bitrise-io/go-utils v0.0.0-20210520073355-367fa34178f5 h1:kclxBfygfNK6kWUB+9xcsfPLBen8Us9gubhitfL/Z6c=
github.com/bitrise-io/go-utils v0.0.0-20210520073355-367fa34178f5/go.mod h1:DRx7oFuAqk0dbKpAKCqWl0TgrowfJUb/MqYPRscxJOQ=
github.com/bitrise-io/go-xcode v0.0.0-20210521101355-fb6a1eb6e05b h1:JyTlzvdOBOxtYZ7aZVCog2dZUv8LgA8UftT+TpVWtZY=
github.com/bitrise-io/go-xcode v0.0.0-20210521101355-fb6a1eb6e05b/go.mod h1:6Nv5RAsAVS745xN5IihUExVmCA9n9f7s/DSVow4hXrI=
github.com/bitrise-io/go-utils v0.0.0-20210830144330-49d11743a4fd/go.mod h1:Vi4MHnaZVL3PVoPPA/Yp6g2pzntkDH8LGiRSY7qw6KQ=
github.com/bitrise-io/go-utils v0.0.0-20210901122528-80582f68ed74 h1:zEcuic3XCiW16aDX/EII17WNljqA+Yg0Y3szG6ctAw0=
github.com/bitrise-io/go-utils v0.0.0-20210901122528-80582f68ed74/go.mod h1:Vi4MHnaZVL3PVoPPA/Yp6g2pzntkDH8LGiRSY7qw6KQ=
github.com/bitrise-io/go-utils v0.0.0-20210903060322-ecae303f0264 h1:luzJPS5Aww2ckMNQP7nCGDc7WfTLpzmWBqWr7SQyXJg=
github.com/bitrise-io/go-utils v0.0.0-20210903060322-ecae303f0264/go.mod h1:Vi4MHnaZVL3PVoPPA/Yp6g2pzntkDH8LGiRSY7qw6KQ=
github.com/bitrise-io/go-xcode v0.0.0-20210901135441-4de33870e9ae h1:FFdNRw1T7RXgAFVEIfqGBEqA6h0IiLYP8YM2qG9F6yA=
github.com/bitrise-io/go-xcode v0.0.0-20210901135441-4de33870e9ae/go.mod h1:NlngqvT+c6BKwNGTc9eYZIter9EPSHmAxP7vvxLjUOs=
github.com/bitrise-io/goinp v0.0.0-20210504152833-8559b0680ab1/go.mod h1:iRbd8zAXLeNy+0gic0eqNCxXvDGe8ZEY/uYX2CCeAoo=
github.com/bitrise-io/gows v0.0.0-20210505125306-dd92ff463938/go.mod h1:3Cp9ceJ8wHl1Av6oEE2ff1iWaYLliQuD+oaNdyM0NWQ=
github.com/bitrise-io/pkcs12 v0.0.0-20210430063833-0da06eb56630/go.mod h1:UiXKNs0essbC14a2TvGlnUKo9isP9m4guPrp8KJHJpU=
github.com/bitrise-io/stepman v0.0.0-20210505110307-5c2296bcc558/go.mod h1:WLh58JYBgbD1Z/yyw1AkFz/90F6oBL0HS/luBpUW9dI=
github.com/bitrise-io/stepman v0.0.0-20210517135458-203f7a48d37a/go.mod h1:WLh58JYBgbD1Z/yyw1AkFz/90F6oBL0HS/luBpUW9dI=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -56,6 +59,7 @@ github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As=
github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
Expand All @@ -67,8 +71,10 @@ github.com/whilp/git-urls v1.0.0/go.mod h1:J16SAmobsqc3Qcy98brfl5f5+e0clUvg1krgw
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210503195802-e9a32991a82e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc=
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ=
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand All @@ -78,11 +84,13 @@ golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210531080801-fdfd190a6549 h1:OL5GcZ2XPkte3dpfuFQ9o884vrE3BZQhajdntNMruv4=
golang.org/x/sys v0.0.0-20210531080801-fdfd190a6549/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210503060354-a79de5458b56 h1:b8jxX3zqjpqb2LklXPzKSGJhzyxCOZSz8ncv8Nv+y7w=
golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY=
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE=
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
Expand Down
23 changes: 0 additions & 23 deletions inputs.go

This file was deleted.

Loading

0 comments on commit 825db06

Please sign in to comment.