Skip to content

Commit c55aa3e

Browse files
authored
high-level logs for building a project (#296)
1 parent d610089 commit c55aa3e

File tree

185 files changed

+6551
-1027
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+6551
-1027
lines changed

go.mod

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@ module github.com/bitrise-steplib/steps-xcode-archive
33
go 1.16
44

55
require (
6-
github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.1
7-
github.com/bitrise-io/go-utils v1.0.1
8-
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.2
9-
github.com/bitrise-io/go-xcode v1.0.6
10-
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.15
6+
github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.2
7+
github.com/bitrise-io/go-utils v1.0.2
8+
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.7
9+
github.com/bitrise-io/go-xcode v1.0.8
10+
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.16
1111
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
12-
github.com/stretchr/testify v1.7.0
13-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
12+
github.com/stretchr/testify v1.7.1
13+
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
14+
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
15+
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect
16+
gopkg.in/yaml.v3 v3.0.1
1417
howett.net/plist v1.0.0
1518
)

go.sum

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
11
github.com/bitrise-io/go-plist v0.0.0-20210301100253-4b1a112ccd10 h1:/2OyBFI7GjYKexBPcfTPvKFz8Ks7qYzkkz2SQ8aiJgc=
22
github.com/bitrise-io/go-plist v0.0.0-20210301100253-4b1a112ccd10/go.mod h1:pARutiL3kEuRLV3JvswidvfCj+9Y3qMZtji2BDqLFsA=
3-
github.com/bitrise-io/go-steputils v1.0.1 h1:lwPl2W1njfANrBoTCkuqOOYbTha263ZFqoWQH0fwhaY=
43
github.com/bitrise-io/go-steputils v1.0.1/go.mod h1:YIUaQnIAyK4pCvQG0hYHVkSzKNT9uL2FWmkFNW4mfNI=
5-
github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.1 h1:rRttUs9HUZkkK7u+rRsdLh436um2qGvFE5dJeiCoB+o=
6-
github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.1/go.mod h1:OC0mHpjD/bqmsHlhG+FWgTouBbcJvmyx896PDP3dRBs=
7-
github.com/bitrise-io/go-utils v1.0.1 h1:e7mepVBkVN1DXRPESNXb0djEw6bxB6B93p/Q74zzcvk=
4+
github.com/bitrise-io/go-steputils v1.0.2 h1:BEFG87r7uA/Yabk4SmuxP2yOgjjO+YGsDOYXtUH8IJ0=
5+
github.com/bitrise-io/go-steputils v1.0.2/go.mod h1:YIUaQnIAyK4pCvQG0hYHVkSzKNT9uL2FWmkFNW4mfNI=
6+
github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.2 h1:WfhgPqLyg+VPNb6istzlJqalk81kb9Wt9IcQIQTOsxE=
7+
github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.2/go.mod h1:OC0mHpjD/bqmsHlhG+FWgTouBbcJvmyx896PDP3dRBs=
88
github.com/bitrise-io/go-utils v1.0.1/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY=
9+
github.com/bitrise-io/go-utils v1.0.2 h1:w4Mz2IvrgDzrFJECuHdvsK1LHO30cdtuy9bBa7Lw2c0=
10+
github.com/bitrise-io/go-utils v1.0.2/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY=
911
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.1/go.mod h1:sy+Ir1X8P3tAAx/qU/r+hqDjHDcrMjIzDEvId1wqNc4=
10-
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.2 h1:w3fwgLLmxMOpYNa6W5aLtJZE8M8+qGE5VPOcr+st59c=
11-
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.2/go.mod h1:sy+Ir1X8P3tAAx/qU/r+hqDjHDcrMjIzDEvId1wqNc4=
12-
github.com/bitrise-io/go-xcode v1.0.6 h1:hSKwkDXUn9/gMk6HiJRUvurGWelfQEBWcO7JAvXi+y8=
12+
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.7 h1:d0XDESvQwOO+V9afZrI8QGR7bJGDkmE4Q9ezIBB4TLw=
13+
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.7/go.mod h1:6i0Gt0JRIbXpsrFDJT1YWghFfdN8qF26/fnpc/6d/88=
1314
github.com/bitrise-io/go-xcode v1.0.6/go.mod h1:Y0Wu2dXm0MilJ/4D3+gPHaNMlUcP+1DjIPoLPykq7wY=
14-
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.15 h1:swynA2yBvKWdMEPDz/GFM55ELekauWIvtDCLWKScVhU=
15-
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.15/go.mod h1:IhG2l/bM8+809Jlwt4hgRzOkRfPmhEybfWMOJdEGnEU=
15+
github.com/bitrise-io/go-xcode v1.0.8 h1:fNB5TmbfsqWRh5ibtKdFdxPEua8gaNBmDt1rPM/GDuo=
16+
github.com/bitrise-io/go-xcode v1.0.8/go.mod h1:Y0Wu2dXm0MilJ/4D3+gPHaNMlUcP+1DjIPoLPykq7wY=
17+
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.16 h1:tJGx3Ly0UclO1oDEiW1W+DYL9UQQwPJ11sgJ/Z917rw=
18+
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.16/go.mod h1:oYILBt4j8jn69avylknuqsUO/BSiRx9i+JaxcNOtWMA=
1619
github.com/bitrise-io/pkcs12 v0.0.0-20211108084543-e52728e011c8 h1:kmvU8AxrNTxXsVPKepBHD8W+eCVmeaKyTkRuUJB2K38=
1720
github.com/bitrise-io/pkcs12 v0.0.0-20211108084543-e52728e011c8/go.mod h1:UiXKNs0essbC14a2TvGlnUKo9isP9m4guPrp8KJHJpU=
1821
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1922
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
2023
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
2124
github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa h1:RDBNVkRviHZtvDvId8XSGPu3rmpmSe+wKRcEWNgsfWU=
2225
github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA=
23-
github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU=
24-
github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
26+
github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
27+
github.com/golang-jwt/jwt/v4 v4.4.1 h1:pC5DB52sCeK48Wlb9oPcdhnjkz1TKt1D/P7WKJ0kUcQ=
28+
github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
2529
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
2630
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
2731
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
@@ -32,10 +36,12 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n
3236
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
3337
github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI=
3438
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
35-
github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4=
3639
github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
37-
github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw=
40+
github.com/hashicorp/go-retryablehttp v0.7.1 h1:sUiuQAnLlbvmExtFQs72iFW/HXeUn8Z1aJLQ4LJJbTQ=
41+
github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
3842
github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
43+
github.com/hashicorp/go-version v1.5.0 h1:O293SZ2Eg+AAYijkVK3jR786Am1bhDEh2GHT0tIVE5E=
44+
github.com/hashicorp/go-version v1.5.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
3945
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
4046
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
4147
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
@@ -44,30 +50,36 @@ github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn
4450
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
4551
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
4652
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
53+
github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
4754
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
4855
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
4956
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
5057
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
5158
github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk=
5259
github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
5360
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
54-
github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As=
5561
github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
62+
github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4=
63+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
5664
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
5765
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
58-
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
5966
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
60-
golang.org/x/crypto v0.0.0-20211202192323-5770296d904e h1:MUP6MR3rJ7Gk9LEia0LP2ytiH6MuCfs7qYz+47jGdD8=
67+
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
68+
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
6169
golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
70+
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM=
71+
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
6272
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
6373
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
6474
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
6575
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
66-
golang.org/x/sys v0.0.0-20211205182925-97ca703d548d h1:FjkYO/PPp4Wi0EAUOVLxePm7qVW4r4ctbWpURyuOD0E=
6776
golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
77+
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k=
78+
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
6879
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
69-
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
7080
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
81+
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 h1:CBpWXWQpIRjzmkkA+M7q9Fqnwd2mZr3AFqexg8YTfoM=
82+
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
7183
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
7284
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
7385
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
@@ -80,7 +92,9 @@ gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa
8092
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
8193
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
8294
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
83-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
8495
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
96+
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
97+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
98+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
8599
howett.net/plist v1.0.0 h1:7CrbWYbPPO/PyNy38b2EB/+gYbjCe2DXBxgtOOZbSQM=
86100
howett.net/plist v1.0.0/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g=

main.go

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,23 @@ func findIDEDistrubutionLogsPath(output string) (string, error) {
126126
pattern := `IDEDistribution: -\[IDEDistributionLogging _createLoggingBundleAtPath:\]: Created bundle at path '(?P<log_path>.*)'`
127127
re := regexp.MustCompile(pattern)
128128

129+
logger.Printf("Locating IDE distrubution logs path")
130+
129131
scanner := bufio.NewScanner(strings.NewReader(output))
130132
for scanner.Scan() {
131133
line := scanner.Text()
132134
if match := re.FindStringSubmatch(line); len(match) == 2 {
135+
logger.Printf("Located IDE distrubution logs path")
136+
133137
return match[1], nil
134138
}
135139
}
136140
if err := scanner.Err(); err != nil {
137141
return "", err
138142
}
139143

144+
logger.Printf("IDE distrubution logs path not found")
145+
140146
return "", nil
141147
}
142148

@@ -410,7 +416,7 @@ func (s XcodeArchiveStep) EnsureDependencies(opts EnsureDependenciesOpts) error
410416
fmt.Println()
411417
logger.Infof("Checking if log formatter (xcpretty) is installed")
412418

413-
var xcpretty = xcpretty.NewXcpretty()
419+
var xcpretty = xcpretty.NewXcpretty(log.NewLogger())
414420

415421
installed, err := xcpretty.IsInstalled()
416422
if err != nil {
@@ -469,16 +475,22 @@ func (s XcodeArchiveStep) xcodeArchive(opts xcodeArchiveOpts) (xcodeArchiveOutpu
469475
out := xcodeArchiveOutput{}
470476

471477
// Open Xcode project
478+
logger.TInfof("Opening xcode project at path: %s for scheme: %s", opts.ProjectPath, opts.Scheme)
479+
472480
xcodeProj, scheme, configuration, err := utils.OpenArchivableProject(opts.ProjectPath, opts.Scheme, opts.Configuration)
473481
if err != nil {
474482
return out, fmt.Errorf("failed to open project: %s: %s", opts.ProjectPath, err)
475483
}
476484

485+
logger.TInfof("Reading xcode project")
486+
477487
platform, err := utils.BuildableTargetPlatform(xcodeProj, scheme, configuration, utils.XcodeBuild{})
478488
if err != nil {
479489
return out, fmt.Errorf("failed to read project platform: %s: %s", opts.ProjectPath, err)
480490
}
481491

492+
logger.TInfof("Reading main target")
493+
482494
mainTarget, err := exportoptionsgenerator.ArchivableApplicationTarget(xcodeProj, scheme)
483495
if err != nil {
484496
return out, fmt.Errorf("failed to read main application target: %s", err)
@@ -493,7 +505,7 @@ func (s XcodeArchiveStep) xcodeArchive(opts xcodeArchiveOpts) (xcodeArchiveOutpu
493505

494506
// Create the Archive with Xcode Command Line tools
495507
logger.Println()
496-
logger.Infof("Creating the Archive ...")
508+
logger.TInfof("Creating the Archive ...")
497509

498510
isWorkspace := false
499511
ext := filepath.Ext(opts.ProjectPath)
@@ -544,6 +556,8 @@ func (s XcodeArchiveStep) xcodeArchive(opts xcodeArchiveOpts) (xcodeArchiveOutpu
544556
}
545557
}
546558

559+
logger.Infof("Starting the Archive ...")
560+
547561
xcodebuildLog, err := runArchiveCommandWithRetry(archiveCmd, opts.LogFormatter == "xcpretty", swiftPackagesPath)
548562
out.XcodebuildArchiveLog = xcodebuildLog
549563
if err != nil || opts.LogFormatter == "xcodebuild" {
@@ -666,6 +680,8 @@ func (s XcodeArchiveStep) xcodeIPAExport(opts xcodeIPAExportOpts) (xcodeIPAExpor
666680
return out, err
667681
}
668682

683+
logger.TPrintf("Opening Xcode project at path: %s.", opts.ProjectPath)
684+
669685
xcodeProj, scheme, configuration, err := utils.OpenArchivableProject(opts.ProjectPath, opts.Scheme, opts.Configuration)
670686
if err != nil {
671687
return out, fmt.Errorf("failed to open project: %s: %s", opts.ProjectPath, err)
@@ -706,6 +722,8 @@ func (s XcodeArchiveStep) xcodeIPAExport(opts xcodeIPAExportOpts) (xcodeIPAExpor
706722
fmt.Println()
707723
logWithTimestamp(colorstring.Green, xcprettyCmd.PrintableCmd())
708724

725+
logger.Infof("Running export ipa from the archive command.")
726+
709727
xcodebuildLog, exportErr := xcprettyCmd.Run()
710728
out.XcodebuildExportArchiveLog = xcodebuildLog
711729
if exportErr != nil {
@@ -737,6 +755,8 @@ is available in the $BITRISE_IDEDISTRIBUTION_LOGS_PATH environment variable`)
737755
fmt.Println()
738756
logWithTimestamp(colorstring.Green, exportCmd.PrintableCmd())
739757

758+
logger.Infof("Running export ipa from the archive command.")
759+
740760
xcodebuildLog, exportErr := exportCmd.RunAndReturnOutput()
741761
out.XcodebuildExportArchiveLog = xcodebuildLog
742762
if exportErr != nil {
@@ -818,6 +838,7 @@ func (s XcodeArchiveStep) Run(opts RunOpts) (RunOut, error) {
818838

819839
logger.Println()
820840
if opts.XcodeMajorVersion >= 11 {
841+
logger.Infof("Running resolve Swift package dependencies")
821842
// Resolve Swift package dependencies, so running -showBuildSettings later is faster later
822843
// Specifying a scheme is required for workspaces
823844
resolveDepsCmd := xcodebuild.NewResolvePackagesCommandModel(opts.ProjectPath, opts.Scheme, opts.Configuration)
@@ -828,6 +849,8 @@ func (s XcodeArchiveStep) Run(opts RunOpts) (RunOut, error) {
828849
}
829850

830851
if opts.ArtifactName == "" {
852+
logger.Infof("Looking for artifact name as field is empty")
853+
831854
cmdModel := xcodebuild.NewShowBuildSettingsCommand(opts.ProjectPath)
832855
cmdModel.SetScheme(opts.Scheme)
833856
cmdModel.SetConfiguration(opts.Configuration)
@@ -988,27 +1011,34 @@ func (s XcodeArchiveStep) ExportOutput(opts ExportOpts) error {
9881011
}
9891012
logger.Donef("The app directory is now available in the Environment Variable: %s (value: %s)", bitriseAppDirPthEnvKey, appPath)
9901013

1014+
logger.Printf("Looking for app and framework dSYMs.")
1015+
9911016
appDSYMPaths, frameworkDSYMPaths, err := opts.Archive.FindDSYMs()
9921017
if err != nil {
9931018
return fmt.Errorf("failed to export dSYMs, error: %s", err)
9941019
}
9951020

996-
if len(appDSYMPaths) > 0 || len(frameworkDSYMPaths) > 0 {
1021+
appDSYMPathsCount := len(appDSYMPaths)
1022+
frameworkDSYMPathsCount := len(frameworkDSYMPaths)
1023+
1024+
logger.Printf("Found %s app dSYMs and framework dSYMs %s.", appDSYMPathsCount, frameworkDSYMPathsCount)
1025+
1026+
if appDSYMPathsCount > 0 || frameworkDSYMPathsCount > 0 {
9971027
fmt.Println()
9981028
dsymDir, err := v1pathutil.NormalizedOSTempDirPath("__dsyms__")
9991029
if err != nil {
10001030
return fmt.Errorf("failed to create tmp dir, error: %s", err)
10011031
}
10021032

1003-
if len(appDSYMPaths) > 0 {
1033+
if appDSYMPathsCount > 0 {
10041034
if err := exportDSYMs(dsymDir, appDSYMPaths); err != nil {
10051035
return fmt.Errorf("failed to export dSYMs: %v", err)
10061036
}
10071037
} else {
10081038
logger.Warnf("No app dSYMs found to export")
10091039
}
10101040

1011-
if opts.ExportAllDsyms && len(frameworkDSYMPaths) > 0 {
1041+
if opts.ExportAllDsyms && frameworkDSYMPathsCount > 0 {
10121042
if err := exportDSYMs(dsymDir, frameworkDSYMPaths); err != nil {
10131043
return fmt.Errorf("failed to export dSYMs: %v", err)
10141044
}

utils/export.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ import (
77

88
v1command "github.com/bitrise-io/go-utils/command"
99
"github.com/bitrise-io/go-utils/fileutil"
10+
"github.com/bitrise-io/go-utils/log"
1011
"github.com/bitrise-io/go-utils/pathutil"
1112
"github.com/bitrise-io/go-utils/v2/command"
1213
)
1314

1415
func zip(cmdFactory command.Factory, sourceDir, destinationZipPth string) error {
16+
log.TPrintf("Will zip directory path: %s", sourceDir)
17+
1518
parentDir := filepath.Dir(sourceDir)
1619
dirName := filepath.Base(sourceDir)
1720
cmd := cmdFactory.Create("/usr/bin/zip", []string{"-rTy", destinationZipPth, dirName}, &command.Opts{Dir: parentDir})
@@ -20,6 +23,8 @@ func zip(cmdFactory command.Factory, sourceDir, destinationZipPth string) error
2023
return fmt.Errorf("failed to zip dir: %s, output: %s, error: %s", sourceDir, out, err)
2124
}
2225

26+
log.TPrintf("Directory zipped.")
27+
2328
return nil
2429
}
2530

@@ -31,11 +36,15 @@ func exportEnvironmentWithEnvman(cmdFactory command.Factory, keyStr, valueStr st
3136
// ExportOutputDir ...
3237
func ExportOutputDir(cmdFactory command.Factory, sourceDirPth, destinationDirPth, envKey string) error {
3338
if sourceDirPth != destinationDirPth {
39+
fmt.Printf("Coping export output")
40+
3441
if err := v1command.CopyDir(sourceDirPth, destinationDirPth, true); err != nil {
3542
return err
3643
}
3744
}
3845

46+
fmt.Printf("Copied export output to %s", destinationDirPth)
47+
3948
return exportEnvironmentWithEnvman(cmdFactory, envKey, destinationDirPth)
4049
}
4150

@@ -61,6 +70,8 @@ func ExportOutputFileContent(cmdFactory command.Factory, content, destinationPth
6170

6271
// ExportOutputDirAsZip ...
6372
func ExportOutputDirAsZip(cmdFactory command.Factory, sourceDirPth, destinationPth, envKey string) error {
73+
log.TPrintf("Will zip directory path: %s", sourceDirPth)
74+
6475
tmpDir, err := pathutil.NormalizedOSTempDirPath("__export_tmp_dir__")
6576
if err != nil {
6677
return err
@@ -73,5 +84,7 @@ func ExportOutputDirAsZip(cmdFactory command.Factory, sourceDirPth, destinationP
7384
return err
7485
}
7586

87+
log.TPrintf("Directory zipped.")
88+
7689
return ExportOutputFile(cmdFactory, tmpZipFilePth, destinationPth, envKey)
7790
}

0 commit comments

Comments
 (0)