From ab4b14a227a9230a8164fafef22f31d8a8d7b08e Mon Sep 17 00:00:00 2001 From: lpusok <7979773+lpusok@users.noreply.github.com> Date: Tue, 1 Aug 2023 13:23:47 +0200 Subject: [PATCH] Update to latest go-xcode, use xcodeversion package (#230) Check for iOS Simulator <-> Xcode compatibility when using latest device for destination. --- go.mod | 16 +-- go.sum | 116 +++--------------- main.go | 12 +- step/mocks/Manager.go | 27 ++-- step/mocks/Reader.go | 28 +++-- step/step.go | 57 +++++---- step/step_test.go | 46 ++++--- step/utils.go | 1 - .../bitrise-io/bitrise/models/models.go | 3 +- .../bitrise-io/bitrise/version/build.go | 2 +- .../go-utils/log/internal_logger.go | 2 +- .../go-xcode/v2/destination/device_finder.go | 5 +- .../go-xcode/v2/destination/parse.go | 16 +-- .../v2/destination/xcode_runtime_support.go | 45 +++++++ .../go-xcode/v2/simulator/simulator.go | 12 +- .../go-xcode/v2/xcodeversion/utility.go | 59 +++++++++ .../go-xcode/v2/xcodeversion/xcodeversion.go | 42 +++++++ vendor/modules.txt | 19 +-- xcodebuild/xcodebuild.go | 1 - xcodebuild/xcodebuild_test.go | 1 - xcodeversion/xcodeversion.go | 23 ---- 21 files changed, 298 insertions(+), 235 deletions(-) create mode 100644 vendor/github.com/bitrise-io/go-xcode/v2/destination/xcode_runtime_support.go create mode 100644 vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/utility.go create mode 100644 vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/xcodeversion.go delete mode 100644 xcodeversion/xcodeversion.go diff --git a/go.mod b/go.mod index 396dc2f6..a58c516b 100644 --- a/go.mod +++ b/go.mod @@ -1,30 +1,30 @@ module github.com/bitrise-steplib/steps-xcode-test -go 1.17 +go 1.18 require ( - github.com/bitrise-io/bitrise v0.0.0-20230704133514-4c3c1429a139 + github.com/bitrise-io/bitrise v0.0.0-20230707121919-a5b9e2d27ea9 github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.18 - github.com/bitrise-io/go-utils v1.0.8 + github.com/bitrise-io/go-utils v1.0.9 github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.19 - github.com/bitrise-io/go-xcode v1.0.11 - github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.27 + github.com/bitrise-io/go-xcode v1.0.13 + github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.29 github.com/hashicorp/go-version v1.6.0 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/stretchr/testify v1.8.4 ) require ( - github.com/bitrise-io/envman v0.0.0-20230330151556-11e5bde91b36 // indirect + github.com/bitrise-io/envman v0.0.0-20230721122944-6b164ed0c2f8 // indirect github.com/bitrise-io/go-steputils v1.0.5 // indirect - github.com/bitrise-io/stepman v0.0.0-20221010110437-a88e9a915b58 // indirect + github.com/bitrise-io/stepman v0.0.0-20230728094915-939f0fe5c19a // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-retryablehttp v0.7.4 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect github.com/stretchr/objx v0.5.0 // indirect - golang.org/x/crypto v0.10.0 // indirect + golang.org/x/crypto v0.11.0 // indirect golang.org/x/sys v0.10.0 // indirect golang.org/x/term v0.10.0 // indirect golang.org/x/text v0.11.0 // indirect diff --git a/go.sum b/go.sum index 93fb46e5..93820be6 100644 --- a/go.sum +++ b/go.sum @@ -1,10 +1,7 @@ -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/bitrise-io/bitrise v0.0.0-20230704133514-4c3c1429a139 h1:m1vnguvngK8sE3mOhynTJBvViObI/9yZeXQ4I976bbc= -github.com/bitrise-io/bitrise v0.0.0-20230704133514-4c3c1429a139/go.mod h1:WcWeEnuP6x54mUVw9L9pGUmllo67aqtXGr+pBIWv+4A= -github.com/bitrise-io/colorstring v0.0.0-20180614154802-a8cd70115192/go.mod h1:CIHVcxZUvsG99XUJV6JlR7okNsMMGY81jMvPC20W+O0= -github.com/bitrise-io/envman v0.0.0-20221010094751-a03ce30a5316/go.mod h1:L4WQyg88d87Z4dxNwrYEa0Cwd9/W0gSfXsibw30r8Vw= -github.com/bitrise-io/envman v0.0.0-20230330151556-11e5bde91b36 h1:z0HMRjRmY+4uw42N9Pb+OE1lK7FHnZVji2etM0dJ0Lw= -github.com/bitrise-io/envman v0.0.0-20230330151556-11e5bde91b36/go.mod h1:L4WQyg88d87Z4dxNwrYEa0Cwd9/W0gSfXsibw30r8Vw= +github.com/bitrise-io/bitrise v0.0.0-20230707121919-a5b9e2d27ea9 h1:WMaMm6qwwEoAGTrp0yAVk5tE8CMu0pkL9aD6XatVeFw= +github.com/bitrise-io/bitrise v0.0.0-20230707121919-a5b9e2d27ea9/go.mod h1:WcWeEnuP6x54mUVw9L9pGUmllo67aqtXGr+pBIWv+4A= +github.com/bitrise-io/envman v0.0.0-20230721122944-6b164ed0c2f8 h1:tBhRcS1lxkFrPpnYHbeeQE3DzEVEbs8CMs2y2ppVPB0= +github.com/bitrise-io/envman v0.0.0-20230721122944-6b164ed0c2f8/go.mod h1:eZDEXpkF4BguvTERmhij3Vwf7Y2qvnJBBW/61hQRip4= github.com/bitrise-io/go-plist v0.0.0-20210301100253-4b1a112ccd10/go.mod h1:pARutiL3kEuRLV3JvswidvfCj+9Y3qMZtji2BDqLFsA= github.com/bitrise-io/go-steputils v1.0.1/go.mod h1:YIUaQnIAyK4pCvQG0hYHVkSzKNT9uL2FWmkFNW4mfNI= github.com/bitrise-io/go-steputils v1.0.2/go.mod h1:YIUaQnIAyK4pCvQG0hYHVkSzKNT9uL2FWmkFNW4mfNI= @@ -13,44 +10,31 @@ github.com/bitrise-io/go-steputils v1.0.5/go.mod h1:YIUaQnIAyK4pCvQG0hYHVkSzKNT9 github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.2/go.mod h1:OC0mHpjD/bqmsHlhG+FWgTouBbcJvmyx896PDP3dRBs= github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.18 h1:43cs5DGgfTWEcaod3hZ7eqOQjhVnOL1QiY6TN3xDhhw= github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.18/go.mod h1:/ueNOKnsjcUrlt8Ck75WRNspL7E6nAAylvl9oGJtYio= -github.com/bitrise-io/go-utils v0.0.0-20200224122728-e212188d99b4/go.mod h1:tTEsKvbz1LbzuN/KpVFHXnLtcAPdEgIdM41s0lL407s= -github.com/bitrise-io/go-utils v0.0.0-20210505121718-07411d72e36e/go.mod h1:nhdaDQFvaMny1CugVV6KjK92/q97ENo0RuKSW5I4fbA= github.com/bitrise-io/go-utils v1.0.1/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY= github.com/bitrise-io/go-utils v1.0.2/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY= -github.com/bitrise-io/go-utils v1.0.3/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY= -github.com/bitrise-io/go-utils v1.0.8 h1:ekXH6FK5V8UxkyHm2FsQL8yk9Wqd5fjg1NGlD7jK2kc= -github.com/bitrise-io/go-utils v1.0.8/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY= +github.com/bitrise-io/go-utils v1.0.9 h1:wy7FewUpseNSTZr41BbGH0csfFqzptFt4zy2pOAEOg0= +github.com/bitrise-io/go-utils v1.0.9/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY= github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.1/go.mod h1:sy+Ir1X8P3tAAx/qU/r+hqDjHDcrMjIzDEvId1wqNc4= github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.11/go.mod h1:SJqGxzwjIAx2LVQxNGS4taN7X//eDPJLrFxJ1MpOuyA= -github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.13/go.mod h1:gZWtM7PLn1VOroa4gN1La/24aRVc0jg5R701jTsPaO8= -github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.16/go.mod h1:Laih4ji980SQkRgdnMCH0g4u2GZI/5nnbqmYT9UfKFQ= github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.19 h1:55as5Iv0N4btuRP3YwRzN+BCMtKO210MnJ8mpxmeI7o= github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.19/go.mod h1:Laih4ji980SQkRgdnMCH0g4u2GZI/5nnbqmYT9UfKFQ= github.com/bitrise-io/go-xcode v1.0.9/go.mod h1:Y0Wu2dXm0MilJ/4D3+gPHaNMlUcP+1DjIPoLPykq7wY= -github.com/bitrise-io/go-xcode v1.0.11 h1:Ac3TDAzL+1+XhBSWCOLnpT+VTzrIuGXjNhUvM0Q9plA= -github.com/bitrise-io/go-xcode v1.0.11/go.mod h1:Y0Wu2dXm0MilJ/4D3+gPHaNMlUcP+1DjIPoLPykq7wY= -github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.27 h1:msDl1IUyxhNvGt1zaI38HEs4Ed74UhBVKkjaU6I2D3g= -github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.27/go.mod h1:8WBcRgrVXY8tzR7NcjE4fw6WguOIfB3YcC7ZTcQYUEY= -github.com/bitrise-io/goinp v0.0.0-20210504152833-8559b0680ab1/go.mod h1:iRbd8zAXLeNy+0gic0eqNCxXvDGe8ZEY/uYX2CCeAoo= -github.com/bitrise-io/goinp v0.0.0-20211005113137-305e91b481f4/go.mod h1:iRbd8zAXLeNy+0gic0eqNCxXvDGe8ZEY/uYX2CCeAoo= -github.com/bitrise-io/gows v0.0.0-20211005113107-14f65e686b88/go.mod h1:3Cp9ceJ8wHl1Av6oEE2ff1iWaYLliQuD+oaNdyM0NWQ= +github.com/bitrise-io/go-xcode v1.0.13 h1:XBJqZnDswCIVtpFKxJKG2cAQ3ETpOMHBrlKLQSJp6GI= +github.com/bitrise-io/go-xcode v1.0.13/go.mod h1:Y0Wu2dXm0MilJ/4D3+gPHaNMlUcP+1DjIPoLPykq7wY= +github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.29 h1:2zkc0zoCyAczFX/zkmrEgF+KVpsytANZpy2o4MAQnas= +github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.29/go.mod h1:8WBcRgrVXY8tzR7NcjE4fw6WguOIfB3YcC7ZTcQYUEY= github.com/bitrise-io/pkcs12 v0.0.0-20211108084543-e52728e011c8/go.mod h1:UiXKNs0essbC14a2TvGlnUKo9isP9m4guPrp8KJHJpU= -github.com/bitrise-io/stepman v0.0.0-20221010110437-a88e9a915b58 h1:xrEcHh9p9ZD/tEJLxv3dc/x4gS+GUsr/c1rVnkW8A6w= -github.com/bitrise-io/stepman v0.0.0-20221010110437-a88e9a915b58/go.mod h1:4BBUXFxB5UlF/tZHXrNFjAy9yNvjZ7Lf/TeIpMwjsow= -github.com/bmatcuk/doublestar/v4 v4.2.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= -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.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/bitrise-io/stepman v0.0.0-20230728094915-939f0fe5c19a h1:XM2PrNSUjpI4pIOZ1TcZdD4kh7KYN2D+yC6WYy22hoo= +github.com/bitrise-io/stepman v0.0.0-20230728094915-939f0fe5c19a/go.mod h1:Z46oQnRMHlbuiV0mCJBigT2bWO5j3TPQncKaL3jCwsk= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.3.1+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= @@ -62,34 +46,23 @@ github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA= github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.5.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -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/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -97,95 +70,36 @@ github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/urfave/cli v1.21.0/go.mod h1:lxDj6qX9Q6lWQxIrbrT0nwecwUtRnhVZAJjJZrVUZZQ= -github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/whilp/git-urls v1.0.0/go.mod h1:J16SAmobsqc3Qcy98brfl5f5+e0clUvg1krgwk/qCfE= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -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-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= -golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/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-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220712014510-0a85c31ab51e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= golang.org/x/sys v0.10.0/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/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= -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/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200220224806-8a925fa4c0df/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/viktorbenei/cobra.v0 v0.0.0-20160704194906-5513220bc3d9/go.mod h1:ES58JZUprnB7l7btSIgwT2KtWLFz7nleq84TF6wsCjg= gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/main.go b/main.go index b2ce1b72..f9a0e937 100644 --- a/main.go +++ b/main.go @@ -18,12 +18,12 @@ import ( "github.com/bitrise-io/go-xcode/v2/simulator" "github.com/bitrise-io/go-xcode/v2/xcconfig" cache "github.com/bitrise-io/go-xcode/v2/xcodecache" + "github.com/bitrise-io/go-xcode/v2/xcodeversion" "github.com/bitrise-steplib/steps-xcode-test/output" "github.com/bitrise-steplib/steps-xcode-test/step" "github.com/bitrise-steplib/steps-xcode-test/testaddon" "github.com/bitrise-steplib/steps-xcode-test/xcodebuild" "github.com/bitrise-steplib/steps-xcode-test/xcodecommand" - "github.com/bitrise-steplib/steps-xcode-test/xcodeversion" ) func main() { @@ -71,12 +71,16 @@ func createConfigParser(logger log.Logger) step.XcodeTestConfigParser { envRepository := env.NewRepository() commandFactory := command.NewFactory(envRepository) inputParser := stepconf.NewInputParser(envRepository) - xcodeVersionReader := xcodeversion.NewXcodeVersionReader() + xcodeVersionProvider := xcodeversion.NewXcodeVersionProvider(commandFactory) + xcodeVersion, err := xcodeVersionProvider.GetVersion() + if err != nil { // Not a fatal error, continuing with empty version + logger.Errorf("failed to read Xcode version: %w", err) + } pathModifier := pathutil.NewPathModifier() - deviceFinder := destination.NewDeviceFinder(logger, commandFactory) + deviceFinder := destination.NewDeviceFinder(logger, commandFactory, xcodeVersion) utils := step.NewUtils(logger) - return step.NewXcodeTestConfigParser(inputParser, logger, xcodeVersionReader, deviceFinder, pathModifier, utils) + return step.NewXcodeTestConfigParser(inputParser, logger, xcodeVersion, deviceFinder, pathModifier, utils) } func createStep(logger log.Logger, logFormatter string) (step.XcodeTestRunner, error) { diff --git a/step/mocks/Manager.go b/step/mocks/Manager.go index bb9759a0..4d25b925 100644 --- a/step/mocks/Manager.go +++ b/step/mocks/Manager.go @@ -1,8 +1,9 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package mocks import ( + destination "github.com/bitrise-io/go-xcode/v2/destination" mock "github.com/stretchr/testify/mock" time "time" @@ -13,13 +14,13 @@ type SimulatorManager struct { mock.Mock } -// Boot provides a mock function with given fields: id -func (_m *SimulatorManager) Boot(id string) error { - ret := _m.Called(id) +// Boot provides a mock function with given fields: device +func (_m *SimulatorManager) Boot(device destination.Device) error { + ret := _m.Called(device) var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(id) + if rf, ok := ret.Get(0).(func(destination.Device) error); ok { + r0 = rf(device) } else { r0 = ret.Error(0) } @@ -32,13 +33,16 @@ func (_m *SimulatorManager) CollectDiagnostics() (string, error) { ret := _m.Called() var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -132,13 +136,12 @@ func (_m *SimulatorManager) WaitForBootFinished(id string, timeout time.Duration return r0 } -type mockConstructorTestingTNewSimulatorManager interface { +// NewSimulatorManager creates a new instance of SimulatorManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewSimulatorManager(t interface { mock.TestingT Cleanup(func()) -} - -// NewSimulatorManager creates a new instance of SimulatorManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewSimulatorManager(t mockConstructorTestingTNewSimulatorManager) *SimulatorManager { +}) *SimulatorManager { mock := &SimulatorManager{} mock.Mock.Test(t) diff --git a/step/mocks/Reader.go b/step/mocks/Reader.go index 788d0750..a358f281 100644 --- a/step/mocks/Reader.go +++ b/step/mocks/Reader.go @@ -1,29 +1,32 @@ -// Code generated by mockery v2.13.1. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package mocks import ( - xcodeversion "github.com/bitrise-steplib/steps-xcode-test/xcodeversion" + xcodeversion "github.com/bitrise-io/go-xcode/v2/xcodeversion" mock "github.com/stretchr/testify/mock" ) -// XcodeVersionReader is an autogenerated mock type for the Reader type -type XcodeVersionReader struct { +// XcodeVersionProvider is an autogenerated mock type for the Reader type +type XcodeVersionProvider struct { mock.Mock } -// Version provides a mock function with given fields: -func (_m *XcodeVersionReader) Version() (xcodeversion.Version, error) { +// GetVersion provides a mock function with given fields: +func (_m *XcodeVersionProvider) GetVersion() (xcodeversion.Version, error) { ret := _m.Called() var r0 xcodeversion.Version + var r1 error + if rf, ok := ret.Get(0).(func() (xcodeversion.Version, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() xcodeversion.Version); ok { r0 = rf() } else { r0 = ret.Get(0).(xcodeversion.Version) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -33,14 +36,13 @@ func (_m *XcodeVersionReader) Version() (xcodeversion.Version, error) { return r0, r1 } -type mockConstructorTestingTNewXcodeVersionReader interface { +// NewXcodeVersionProvider creates a new instance of XcodeVersionProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewXcodeVersionProvider(t interface { mock.TestingT Cleanup(func()) -} - -// NewXcodeVersionReader creates a new instance of XcodeVersionReader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewXcodeVersionReader(t mockConstructorTestingTNewXcodeVersionReader) *XcodeVersionReader { - mock := &XcodeVersionReader{} +}) *XcodeVersionProvider { + mock := &XcodeVersionProvider{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) diff --git a/step/step.go b/step/step.go index fe3d3191..83eb3b9e 100644 --- a/step/step.go +++ b/step/step.go @@ -16,10 +16,10 @@ import ( "github.com/bitrise-io/go-xcode/v2/destination" "github.com/bitrise-io/go-xcode/v2/simulator" cache "github.com/bitrise-io/go-xcode/v2/xcodecache" + "github.com/bitrise-io/go-xcode/v2/xcodeversion" "github.com/bitrise-steplib/steps-xcode-test/output" "github.com/bitrise-steplib/steps-xcode-test/xcodebuild" "github.com/bitrise-steplib/steps-xcode-test/xcodecommand" - "github.com/bitrise-steplib/steps-xcode-test/xcodeversion" "github.com/kballard/go-shellquote" ) @@ -110,22 +110,22 @@ type Config struct { } type XcodeTestConfigParser struct { - logger log.Logger - inputParser stepconf.InputParser - xcodeVersionReader xcodeversion.Reader - deviceFinder destination.DeviceFinder - pathModifier pathutil.PathModifier - utils Utils + logger log.Logger + inputParser stepconf.InputParser + xcodeVersion xcodeversion.Version + deviceFinder destination.DeviceFinder + pathModifier pathutil.PathModifier + utils Utils } -func NewXcodeTestConfigParser(inputParser stepconf.InputParser, logger log.Logger, xcodeVersionReader xcodeversion.Reader, deviceFinder destination.DeviceFinder, pathModifier pathutil.PathModifier, utils Utils) XcodeTestConfigParser { +func NewXcodeTestConfigParser(inputParser stepconf.InputParser, logger log.Logger, xcodeVersion xcodeversion.Version, deviceFinder destination.DeviceFinder, pathModifier pathutil.PathModifier, utils Utils) XcodeTestConfigParser { return XcodeTestConfigParser{ - logger: logger, - inputParser: inputParser, - xcodeVersionReader: xcodeVersionReader, - deviceFinder: deviceFinder, - pathModifier: pathModifier, - utils: utils, + logger: logger, + inputParser: inputParser, + xcodeVersion: xcodeVersion, + deviceFinder: deviceFinder, + pathModifier: pathModifier, + utils: utils, } } @@ -170,14 +170,8 @@ func (s XcodeTestConfigParser) ProcessConfig() (Config, error) { s.logger.EnableDebugLog(input.VerboseLog) - // validate Xcode version - xcodebuildVersion, err := s.xcodeVersionReader.Version() - if err != nil { - return Config{}, fmt.Errorf("failed to determine Xcode version: %w", err) - } - s.logger.Printf("- xcodebuildVersion: %s (%s)", xcodebuildVersion.Version, xcodebuildVersion.BuildVersion) - - if err := s.validateXcodeVersion(&input, int(xcodebuildVersion.MajorVersion)); err != nil { + s.logger.Printf("- xcodebuild_version: %s (%s)", s.xcodeVersion.Version, s.xcodeVersion.BuildVersion) + if err := s.validateXcodeVersion(&input, int(s.xcodeVersion.MajorVersion)); err != nil { return Config{}, err } @@ -223,7 +217,7 @@ func (s XcodeTestConfigParser) ProcessConfig() (Config, error) { return Config{}, fmt.Errorf("`-xcconfig` option found in 'Additional options for the xcodebuild command' (xcodebuild_options), please clear 'Build settings (xcconfig)' (`xcconfig_content`) input as only one can be set") } - return s.utils.CreateConfig(input, projectPath, int(xcodebuildVersion.MajorVersion), sim, additionalOptions, additionalLogFormatterOptions), nil + return s.utils.CreateConfig(input, projectPath, int(s.xcodeVersion.MajorVersion), sim, additionalOptions, additionalLogFormatterOptions), nil } // InstallDeps ... @@ -257,7 +251,7 @@ type Result struct { func (s XcodeTestRunner) Run(cfg Config) (Result, error) { enableSimulatorVerboseLog := cfg.CollectSimulatorDiagnostics != never launchSimulator := !cfg.IsSimulatorBooted && !cfg.HeadlessMode - if err := s.prepareSimulator(enableSimulatorVerboseLog, cfg.Simulator.ID, launchSimulator); err != nil { + if err := s.prepareSimulator(enableSimulatorVerboseLog, cfg.Simulator, launchSimulator); err != nil { return Result{}, err } @@ -354,6 +348,11 @@ func (s XcodeTestConfigParser) parseAdditionalLogFormatterOptions(logFormatter, } func (s XcodeTestConfigParser) validateXcodeVersion(input *Input, xcodeMajorVersion int) error { + if xcodeMajorVersion == 0 { + s.logger.Printf("Skipping Xcode major version check as it is not available.") + return nil + } + if xcodeMajorVersion < minSupportedXcodeMajorVersion { return fmt.Errorf("invalid Xcode major version (%d), should not be less then min supported: %d", xcodeMajorVersion, minSupportedXcodeMajorVersion) } @@ -389,7 +388,7 @@ func (s XcodeTestConfigParser) getSimulatorForDestination(destinationSpecifier s return device, nil } -func (s XcodeTestRunner) prepareSimulator(enableSimulatorVerboseLog bool, simulatorID string, launchSimulator bool) error { +func (s XcodeTestRunner) prepareSimulator(enableSimulatorVerboseLog bool, simulator destination.Device, launchSimulator bool) error { err := s.simulatorManager.ResetLaunchServices() if err != nil { s.logger.Warnf("Failed to apply simulator boot workaround: %s", err) @@ -399,10 +398,10 @@ func (s XcodeTestRunner) prepareSimulator(enableSimulatorVerboseLog bool, simula if enableSimulatorVerboseLog { s.logger.Infof("Enabling Simulator verbose log for better diagnostics") // Boot the simulator now, so verbose logging can be enabled, and it is kept booted after running tests. - if err := s.simulatorManager.Boot(simulatorID); err != nil { + if err := s.simulatorManager.Boot(simulator); err != nil { return fmt.Errorf("%v", err) } - if err := s.simulatorManager.EnableVerboseLog(simulatorID); err != nil { + if err := s.simulatorManager.EnableVerboseLog(simulator.ID); err != nil { return fmt.Errorf("%v", err) } @@ -410,9 +409,9 @@ func (s XcodeTestRunner) prepareSimulator(enableSimulatorVerboseLog bool, simula } if launchSimulator { - s.logger.Infof("Booting simulator (%s)...", simulatorID) + s.logger.Infof("Booting simulator (%s)...", simulator.ID) - if err := s.simulatorManager.LaunchWithGUI(simulatorID); err != nil { + if err := s.simulatorManager.LaunchWithGUI(simulator.ID); err != nil { return fmt.Errorf("failed to boot simulator: %w", err) } diff --git a/step/step_test.go b/step/step_test.go index b4b39130..e587b57e 100644 --- a/step/step_test.go +++ b/step/step_test.go @@ -9,8 +9,8 @@ import ( "github.com/bitrise-io/go-steputils/v2/stepconf" "github.com/bitrise-io/go-utils/v2/log" "github.com/bitrise-io/go-xcode/v2/destination" + "github.com/bitrise-io/go-xcode/v2/xcodeversion" "github.com/bitrise-steplib/steps-xcode-test/step/mocks" - "github.com/bitrise-steplib/steps-xcode-test/xcodeversion" "github.com/hashicorp/go-version" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -18,7 +18,6 @@ import ( ) type configParserMocks struct { - xcodeVersion *mocks.XcodeVersionReader deviceFinder *mocks.DeviceFinder pathModifier *mocks.PathModifier } @@ -72,15 +71,30 @@ func Test_GivenStep_WhenRuns_ThenXcodebuildGetsCalled(t *testing.T) { mocks.xcodebuilder.AssertCalled(t, "RunTest", mock.Anything) } +func Test_GivenStep_WhenXcodeVersionUnreadable_ThenSuccess(t *testing.T) { + // Given + envValues := defaultEnvValues() + + xcodeVersion := xcodeversion.Version{} + configParser, mocks := createConfigParser(t, envValues, xcodeVersion) + path := strings.TrimPrefix(envValues["project_path"], ".") + mocks.pathModifier.On("AbsPath", mock.Anything).Return(path, nil) + mocks.deviceFinder.On("FindDevice", mock.Anything, mock.Anything).Return(defaultSimulator(), nil) + + // When + _, err := configParser.ProcessConfig() + + // Then + require.NoError(t, err) +} + func Test_GivenXcode13OrNewer_WhenShouldRetryTestOnFailIsSet_ThenFails(t *testing.T) { // Given envValues := defaultEnvValues() envValues["should_retry_test_on_fail"] = "yes" - configParser, mocks := createConfigParser(t, envValues) - - ver := newVersion(13) - mocks.xcodeVersion.On("Version").Return(ver, nil) + xcodeVersion := newVersion(13) + configParser, _ := createConfigParser(t, envValues, xcodeVersion) // When _, err := configParser.ProcessConfig() @@ -94,10 +108,8 @@ func Test_GivenXcode12OrOlder_WhenTestRepetitionModeIsSet_ThenFails(t *testing.T envValues := defaultEnvValues() envValues["test_repetition_mode"] = "retry_on_failure" - configParser, mocks := createConfigParser(t, envValues) - ver := newVersion(12) - mocks.xcodeVersion.On("Version").Return(ver, nil) + configParser, _ := createConfigParser(t, envValues, ver) // When _, err := configParser.ProcessConfig() @@ -111,10 +123,8 @@ func Test_GivenTestRepetitionModeIsNone_WhenRelaunchTestsForEachRepetitionIsSet_ envValues := defaultEnvValues() envValues["relaunch_tests_for_each_repetition"] = "yes" - configParser, mocks := createConfigParser(t, envValues) - - ver := newVersion(12) - mocks.xcodeVersion.On("Version").Return(ver, nil) + xcodeVersion := newVersion(12) + configParser, mocks := createConfigParser(t, envValues, xcodeVersion) path := strings.TrimPrefix(envValues["project_path"], ".") mocks.pathModifier.On("AbsPath", mock.Anything).Return(path, nil) @@ -151,9 +161,9 @@ func Test_GivenLogFormatterIsXcbeautify_WhenParsesConfig_ThenAdditionalOptionsWo envValues["log_formatter"] = "xcbeautify" envValues["xcbeautify_options"] = "'--is-ci' '-q'" - configParser, mocks := createConfigParser(t, envValues) + xcodeVersion := newVersion(13) + configParser, mocks := createConfigParser(t, envValues, xcodeVersion) - mocks.xcodeVersion.On("Version").Return(newVersion(13), nil) path := strings.TrimPrefix(envValues["project_path"], ".") mocks.pathModifier.On("AbsPath", mock.Anything).Return(path, nil) device := defaultSimulator() @@ -293,7 +303,7 @@ func defaultResult() Result { } } -func createConfigParser(t *testing.T, envValues map[string]string) (XcodeTestConfigParser, configParserMocks) { +func createConfigParser(t *testing.T, envValues map[string]string, xcodeVersion xcodeversion.Version) (XcodeTestConfigParser, configParserMocks) { envRepository := mocks.NewRepository(t) if envValues != nil { @@ -307,14 +317,12 @@ func createConfigParser(t *testing.T, envValues map[string]string) (XcodeTestCon logger := log.NewLogger() inputParser := stepconf.NewInputParser(envRepository) - xcodeVersionReader := mocks.NewXcodeVersionReader(t) deviceFinder := mocks.NewDeviceFinder(t) pathModifier := mocks.NewPathModifier(t) utils := NewUtils(logger) - configParser := NewXcodeTestConfigParser(inputParser, logger, xcodeVersionReader, deviceFinder, pathModifier, utils) + configParser := NewXcodeTestConfigParser(inputParser, logger, xcodeVersion, deviceFinder, pathModifier, utils) mocks := configParserMocks{ - xcodeVersion: xcodeVersionReader, deviceFinder: deviceFinder, pathModifier: pathModifier, } diff --git a/step/utils.go b/step/utils.go index 28f7d552..1476ccb9 100644 --- a/step/utils.go +++ b/step/utils.go @@ -108,6 +108,5 @@ func (u utils) CreateTestParams(cfg Config, xcresultPath, swiftPackagesPath stri RetryOnTestRunnerError: true, RetryOnSwiftPackageResolutionError: true, SwiftPackagesPath: swiftPackagesPath, - XcodeMajorVersion: cfg.XcodeMajorVersion, } } diff --git a/vendor/github.com/bitrise-io/bitrise/models/models.go b/vendor/github.com/bitrise-io/bitrise/models/models.go index 06e372f4..b5e5497a 100644 --- a/vendor/github.com/bitrise-io/bitrise/models/models.go +++ b/vendor/github.com/bitrise-io/bitrise/models/models.go @@ -11,7 +11,7 @@ import ( const ( // FormatVersion ... - FormatVersion = "12" + FormatVersion = "13" ) // StepListItemModel ... @@ -113,6 +113,7 @@ type BitriseDataModel struct { // StepIDData ... // structured representation of a composite-step-id +// // a composite step id is: step-lib-source::step-id@1.0.0 type StepIDData struct { // SteplibSource : steplib source uri, or in case of local path just "path", and in case of direct git url just "git" diff --git a/vendor/github.com/bitrise-io/bitrise/version/build.go b/vendor/github.com/bitrise-io/bitrise/version/build.go index 6577e1a2..3f73c07e 100644 --- a/vendor/github.com/bitrise-io/bitrise/version/build.go +++ b/vendor/github.com/bitrise-io/bitrise/version/build.go @@ -1,7 +1,7 @@ package version // VERSION is the main CLI version number. It's defined at build time using -ldflags -var VERSION = "2.2.7" +var VERSION = "2.3.0" // BuildNumber is the CI build number that creates the release. It's defined at build time using -ldflags var BuildNumber = "" diff --git a/vendor/github.com/bitrise-io/go-utils/log/internal_logger.go b/vendor/github.com/bitrise-io/go-utils/log/internal_logger.go index 245f9954..ff9ac667 100644 --- a/vendor/github.com/bitrise-io/go-utils/log/internal_logger.go +++ b/vendor/github.com/bitrise-io/go-utils/log/internal_logger.go @@ -10,7 +10,7 @@ import ( ) var ( - analyticsServerURL = "https://bitrise-step-analytics.herokuapp.com" + analyticsServerURL = "https://step-analytics.bitrise.io" httpClient = http.Client{ Timeout: time.Second * 5, } diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/destination/device_finder.go b/vendor/github.com/bitrise-io/go-xcode/v2/destination/device_finder.go index 79de75ba..fdf0516e 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/destination/device_finder.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/destination/device_finder.go @@ -7,6 +7,7 @@ import ( "github.com/bitrise-io/go-utils/v2/command" "github.com/bitrise-io/go-utils/v2/log" + "github.com/bitrise-io/go-xcode/v2/xcodeversion" ) // Keep it in sync with https://github.com/bitrise-io/image-build-utils/blob/master/roles/simulators/defaults/main.yml#L14 @@ -31,15 +32,17 @@ type DeviceFinder interface { type deviceFinder struct { logger log.Logger commandFactory command.Factory + xcodeVersion xcodeversion.Version list *deviceList } // NewDeviceFinder retruns the default implementation of DeviceFinder -func NewDeviceFinder(log log.Logger, commandFactory command.Factory) DeviceFinder { +func NewDeviceFinder(log log.Logger, commandFactory command.Factory, xcodeVersion xcodeversion.Version) DeviceFinder { return &deviceFinder{ logger: log, commandFactory: commandFactory, + xcodeVersion: xcodeVersion, } } diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/destination/parse.go b/vendor/github.com/bitrise-io/go-xcode/v2/destination/parse.go index da193042..57f5738a 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/destination/parse.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/destination/parse.go @@ -8,7 +8,6 @@ import ( "time" "github.com/bitrise-io/go-utils/errorutil" - "github.com/bitrise-io/go-utils/log" "github.com/bitrise-io/go-utils/retry" "github.com/bitrise-io/go-utils/v2/command" "github.com/hashicorp/go-version" @@ -275,7 +274,6 @@ func (d deviceFinder) filterRuntime(wanted Simulator) (deviceRuntime, error) { var allVersions []deviceRuntime for _, runtime := range d.list.Runtimes { - if !runtime.IsAvailable { continue } @@ -313,13 +311,17 @@ func (d deviceFinder) filterRuntime(wanted Simulator) (deviceRuntime, error) { ) for _, runtime := range allVersions { - version, err := version.NewVersion(runtime.Version) + runtimeVersion, err := version.NewVersion(runtime.Version) if err != nil { - return deviceRuntime{}, fmt.Errorf("failed to parse Simulator version (%s): %w", version, err) + return deviceRuntime{}, fmt.Errorf("failed to parse Simulator version (%s): %w", runtimeVersion, err) + } + + if wanted.Platform == string(IOS) && !isRuntimeSupportedByXcode(wanted.Platform, runtimeVersion, d.xcodeVersion) { + continue } - if latestVersion == nil || version.GreaterThan(latestVersion) { - latestVersion = version + if latestVersion == nil || runtimeVersion.GreaterThan(latestVersion) { + latestVersion = runtimeVersion latestRuntime = runtime } } @@ -340,7 +342,7 @@ func (d deviceFinder) filterRuntime(wanted Simulator) (deviceRuntime, error) { runtimeSegments := runtimeVersion.Segments() if len(runtimeSegments) < 2 { - log.Warnf("no minor version found in Simulator version (%s)", runtime.Version) + d.logger.Warnf("no minor version found in Simulator version (%s)", runtime.Version) continue } diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/destination/xcode_runtime_support.go b/vendor/github.com/bitrise-io/go-xcode/v2/destination/xcode_runtime_support.go new file mode 100644 index 00000000..7a1f4e10 --- /dev/null +++ b/vendor/github.com/bitrise-io/go-xcode/v2/destination/xcode_runtime_support.go @@ -0,0 +1,45 @@ +package destination + +import ( + "github.com/bitrise-io/go-xcode/v2/xcodeversion" + "github.com/hashicorp/go-version" +) + +func isRuntimeSupportedByXcode(runtimePlatform string, runtimeVersion *version.Version, xcodeVersion xcodeversion.Version) bool { + // Very simplified version of https://developer.apple.com/support/xcode/ + // Only considering major versions for simplicity + var xcodeVersionToSupportedRuntimes = map[int64]map[string]int64{ + 15: { + string(IOS): 17, + string(TvOS): 17, + string(WatchOS): 10, + }, + 14: { + string(IOS): 16, + string(TvOS): 16, + string(WatchOS): 9, + }, + 13: { + string(IOS): 15, + string(TvOS): 15, + string(WatchOS): 8, + }, + } + + if len(runtimeVersion.Segments64()) == 0 || xcodeVersion.MajorVersion == 0 { + return true + } + runtimeMajorVersion := runtimeVersion.Segments64()[0] + + platformToLatestSupportedVersion, ok := xcodeVersionToSupportedRuntimes[xcodeVersion.MajorVersion] + if !ok { + return true + } + + latestSupportedMajorVersion, ok := platformToLatestSupportedVersion[runtimePlatform] + if !ok { + return true + } + + return latestSupportedMajorVersion >= runtimeMajorVersion +} diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/simulator/simulator.go b/vendor/github.com/bitrise-io/go-xcode/v2/simulator/simulator.go index cdb03990..379fe631 100644 --- a/vendor/github.com/bitrise-io/go-xcode/v2/simulator/simulator.go +++ b/vendor/github.com/bitrise-io/go-xcode/v2/simulator/simulator.go @@ -12,6 +12,7 @@ import ( "github.com/bitrise-io/go-utils/errorutil" "github.com/bitrise-io/go-utils/v2/command" "github.com/bitrise-io/go-utils/v2/log" + "github.com/bitrise-io/go-xcode/v2/destination" ) const ( @@ -22,7 +23,7 @@ const ( type Manager interface { LaunchWithGUI(simulatorID string) error ResetLaunchServices() error - Boot(id string) error + Boot(device destination.Device) error WaitForBootFinished(id string, timeout time.Duration) error EnableVerboseLog(id string) error CollectDiagnostics() (string, error) @@ -105,8 +106,13 @@ func (m manager) ResetLaunchServices() error { } // Boot boots Simulator in headless mode -func (m manager) Boot(id string) error { - cmd := m.commandFactory.Create("xcrun", []string{"simctl", "boot", id}, &command.Opts{ +func (m manager) Boot(device destination.Device) error { + args := []string{"simctl", "boot", device.ID} + if device.Arch != "" { + args = append(args, fmt.Sprintf("--arch=%s", device.Arch)) + } + + cmd := m.commandFactory.Create("xcrun", args, &command.Opts{ Stdout: os.Stdout, Stderr: os.Stderr, }) diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/utility.go b/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/utility.go new file mode 100644 index 00000000..bcd2b50b --- /dev/null +++ b/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/utility.go @@ -0,0 +1,59 @@ +package xcodeversion + +import ( + "fmt" + "strconv" + "strings" +) + +func getXcodeVersionFromXcodebuildOutput(outStr string) (Version, error) { + split := strings.Split(outStr, "\n") + if len(split) == 0 { + return Version{}, fmt.Errorf("failed to parse xcodebuild version output (%s)", outStr) + } + + filteredOutput, err := filterXcodeWarnings(split) + if err != nil { + return Version{}, err + } + + xcodebuildVersion := filteredOutput[0] + buildVersion := filteredOutput[1] + + split = strings.Split(xcodebuildVersion, " ") + if len(split) != 2 { + return Version{}, fmt.Errorf("failed to parse xcodebuild version output (%s)", outStr) + } + + version := split[1] + + split = strings.Split(version, ".") + majorVersionStr := split[0] + + majorVersion, err := strconv.ParseInt(majorVersionStr, 10, 32) + if err != nil { + return Version{}, fmt.Errorf("failed to parse xcodebuild version output (%s), error: %s", outStr, err) + } + + return Version{ + Version: xcodebuildVersion, + BuildVersion: buildVersion, + MajorVersion: majorVersion, + }, nil +} + +func filterXcodeWarnings(cmdOutputLines []string) ([]string, error) { + firstLineIndex := -1 + for i, line := range cmdOutputLines { + if strings.HasPrefix(line, "Xcode ") { + firstLineIndex = i + break + } + } + + if firstLineIndex < 0 { + return []string{}, fmt.Errorf("couldn't find Xcode version in output: %s", cmdOutputLines) + } + + return cmdOutputLines[firstLineIndex:], nil +} diff --git a/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/xcodeversion.go b/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/xcodeversion.go new file mode 100644 index 00000000..acb7f755 --- /dev/null +++ b/vendor/github.com/bitrise-io/go-xcode/v2/xcodeversion/xcodeversion.go @@ -0,0 +1,42 @@ +package xcodeversion + +import ( + "fmt" + + "github.com/bitrise-io/go-utils/v2/command" +) + +// Version ... +type Version struct { + Version string + BuildVersion string + MajorVersion int64 +} + +// Reader ... +type Reader interface { + GetVersion() (Version, error) +} + +type reader struct { + commandFactory command.Factory +} + +// NewXcodeVersionProvider ... +func NewXcodeVersionProvider(commandFactory command.Factory) Reader { + return &reader{ + commandFactory: commandFactory, + } +} + +// GetVersion ... +func (b *reader) GetVersion() (Version, error) { + cmd := b.commandFactory.Create("xcodebuild", []string{"-version"}, &command.Opts{}) + + outStr, err := cmd.RunAndReturnTrimmedCombinedOutput() + if err != nil { + return Version{}, fmt.Errorf("xcodebuild -version failed: %s, output: %s", err, outStr) + } + + return getXcodeVersionFromXcodebuildOutput(outStr) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index ada53ec0..4d6e61e7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# github.com/bitrise-io/bitrise v0.0.0-20230704133514-4c3c1429a139 +# github.com/bitrise-io/bitrise v0.0.0-20230707121919-a5b9e2d27ea9 ## explicit; go 1.17 github.com/bitrise-io/bitrise/configs github.com/bitrise-io/bitrise/exitcode @@ -7,8 +7,8 @@ github.com/bitrise-io/bitrise/log/corelog github.com/bitrise-io/bitrise/models github.com/bitrise-io/bitrise/utils github.com/bitrise-io/bitrise/version -# github.com/bitrise-io/envman v0.0.0-20230330151556-11e5bde91b36 -## explicit; go 1.16 +# github.com/bitrise-io/envman v0.0.0-20230721122944-6b164ed0c2f8 +## explicit; go 1.18 github.com/bitrise-io/envman/models # github.com/bitrise-io/go-steputils v1.0.5 ## explicit; go 1.15 @@ -20,7 +20,7 @@ github.com/bitrise-io/go-steputils/v2/export github.com/bitrise-io/go-steputils/v2/ruby github.com/bitrise-io/go-steputils/v2/stepconf github.com/bitrise-io/go-steputils/v2/stepenv -# github.com/bitrise-io/go-utils v1.0.8 +# github.com/bitrise-io/go-utils v1.0.9 ## explicit; go 1.13 github.com/bitrise-io/go-utils/colorstring github.com/bitrise-io/go-utils/command @@ -44,19 +44,20 @@ github.com/bitrise-io/go-utils/v2/fileutil github.com/bitrise-io/go-utils/v2/log github.com/bitrise-io/go-utils/v2/log/colorstring github.com/bitrise-io/go-utils/v2/pathutil -# github.com/bitrise-io/go-xcode v1.0.11 +# github.com/bitrise-io/go-xcode v1.0.13 ## explicit; go 1.15 github.com/bitrise-io/go-xcode/models github.com/bitrise-io/go-xcode/utility -# github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.27 +# github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.29 ## explicit; go 1.16 github.com/bitrise-io/go-xcode/v2/destination github.com/bitrise-io/go-xcode/v2/errorfinder github.com/bitrise-io/go-xcode/v2/simulator github.com/bitrise-io/go-xcode/v2/xcconfig github.com/bitrise-io/go-xcode/v2/xcodecache -# github.com/bitrise-io/stepman v0.0.0-20221010110437-a88e9a915b58 -## explicit; go 1.16 +github.com/bitrise-io/go-xcode/v2/xcodeversion +# github.com/bitrise-io/stepman v0.0.0-20230728094915-939f0fe5c19a +## explicit; go 1.18 github.com/bitrise-io/stepman/models # github.com/davecgh/go-spew v1.1.1 ## explicit @@ -87,7 +88,7 @@ github.com/stretchr/objx github.com/stretchr/testify/assert github.com/stretchr/testify/mock github.com/stretchr/testify/require -# golang.org/x/crypto v0.10.0 +# golang.org/x/crypto v0.11.0 ## explicit; go 1.17 golang.org/x/crypto/ssh/terminal # golang.org/x/sys v0.10.0 diff --git a/xcodebuild/xcodebuild.go b/xcodebuild/xcodebuild.go index 7c0ca666..5b91480e 100644 --- a/xcodebuild/xcodebuild.go +++ b/xcodebuild/xcodebuild.go @@ -44,7 +44,6 @@ type TestRunParams struct { RetryOnTestRunnerError bool RetryOnSwiftPackageResolutionError bool SwiftPackagesPath string - XcodeMajorVersion int } // RunTest ... diff --git a/xcodebuild/xcodebuild_test.go b/xcodebuild/xcodebuild_test.go index 6bc71dd1..7e52d544 100644 --- a/xcodebuild/xcodebuild_test.go +++ b/xcodebuild/xcodebuild_test.go @@ -271,7 +271,6 @@ func runParameters() TestRunParams { RetryOnTestRunnerError: true, RetryOnSwiftPackageResolutionError: true, SwiftPackagesPath: "SwiftPackagesPath", - XcodeMajorVersion: 13, } } diff --git a/xcodeversion/xcodeversion.go b/xcodeversion/xcodeversion.go deleted file mode 100644 index 8097a0ae..00000000 --- a/xcodeversion/xcodeversion.go +++ /dev/null @@ -1,23 +0,0 @@ -package xcodeversion - -import ( - "github.com/bitrise-io/go-xcode/models" - "github.com/bitrise-io/go-xcode/utility" -) - -type Version models.XcodebuildVersionModel - -type Reader interface { - Version() (Version, error) -} - -type reader struct{} - -func NewXcodeVersionReader() Reader { - return &reader{} -} - -func (b *reader) Version() (Version, error) { - version, err := utility.GetXcodeVersion() - return Version(version), err -}