From 87760fb9b6efcd971f09a3c48250e23c038697e3 Mon Sep 17 00:00:00 2001 From: Krisztian Godrei Date: Mon, 24 Jul 2017 16:19:36 +0200 Subject: [PATCH] optional dsyms, godeps-update --- Godeps/Godeps.json | 14 +++--- main.go | 49 ++++++++++--------- .../kballard/go-shellquote/quote.go | 2 +- 3 files changed, 35 insertions(+), 30 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 5d4437c9..9e7e7f8a 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -8,27 +8,27 @@ "Deps": [ { "ImportPath": "github.com/bitrise-io/go-utils/colorstring", - "Rev": "9c30a7825aa1064e423a0f1dba751fec990b07be" + "Rev": "3511af718c64f2ed4e0222e463e5889da972c0a0" }, { "ImportPath": "github.com/bitrise-io/go-utils/command", - "Rev": "9c30a7825aa1064e423a0f1dba751fec990b07be" + "Rev": "3511af718c64f2ed4e0222e463e5889da972c0a0" }, { "ImportPath": "github.com/bitrise-io/go-utils/errorutil", - "Rev": "9c30a7825aa1064e423a0f1dba751fec990b07be" + "Rev": "3511af718c64f2ed4e0222e463e5889da972c0a0" }, { "ImportPath": "github.com/bitrise-io/go-utils/fileutil", - "Rev": "9c30a7825aa1064e423a0f1dba751fec990b07be" + "Rev": "3511af718c64f2ed4e0222e463e5889da972c0a0" }, { "ImportPath": "github.com/bitrise-io/go-utils/log", - "Rev": "9c30a7825aa1064e423a0f1dba751fec990b07be" + "Rev": "3511af718c64f2ed4e0222e463e5889da972c0a0" }, { "ImportPath": "github.com/bitrise-io/go-utils/pathutil", - "Rev": "9c30a7825aa1064e423a0f1dba751fec990b07be" + "Rev": "3511af718c64f2ed4e0222e463e5889da972c0a0" }, { "ImportPath": "github.com/bitrise-tools/go-xcode/exportoptions", @@ -68,7 +68,7 @@ }, { "ImportPath": "github.com/kballard/go-shellquote", - "Rev": "d8ec1a69a250a17bb0e419c386eac1f3711dc142" + "Rev": "cd60e84ee657ff3dc51de0b4f55dd299a3e136f2" }, { "ImportPath": "howett.net/plist", diff --git a/main.go b/main.go index 9410aa45..67c5854b 100644 --- a/main.go +++ b/main.go @@ -731,35 +731,40 @@ is available in the $BITRISE_IDEDISTRIBUTION_LOGS_PATH environment variable`) appDSYM, frameworkDSYMs, err := xcarchive.FindDSYMs(tmpArchivePath) if err != nil { - fail("Failed to export dsyms, error: %s", err) - } - - dsymDir, err := pathutil.NormalizedOSTempDirPath("__dsyms__") - if err != nil { - fail("Failed to create tmp dir, error: %s", err) + if err.Error() == "no dsym found" { + log.Warnf("no app nor framework dsyms found") + } else { + fail("Failed to export dsyms, error: %s", err) + } } + if err == nil { + dsymDir, err := pathutil.NormalizedOSTempDirPath("__dsyms__") + if err != nil { + fail("Failed to create tmp dir, error: %s", err) + } - if err := command.CopyDir(appDSYM, dsymDir, false); err != nil { - fail("Failed to copy (%s) -> (%s), error: %s", appDSYM, dsymDir, err) - } + if err := command.CopyDir(appDSYM, dsymDir, false); err != nil { + fail("Failed to copy (%s) -> (%s), error: %s", appDSYM, dsymDir, err) + } - if configs.ExportAllDsyms == "yes" { - for _, dsym := range frameworkDSYMs { - if err := command.CopyDir(dsym, dsymDir, false); err != nil { - fail("Failed to copy (%s) -> (%s), error: %s", dsym, dsymDir, err) + if configs.ExportAllDsyms == "yes" { + for _, dsym := range frameworkDSYMs { + if err := command.CopyDir(dsym, dsymDir, false); err != nil { + fail("Failed to copy (%s) -> (%s), error: %s", dsym, dsymDir, err) + } } } - } - if err := utils.ExportOutputDir(dsymDir, dsymDir, bitriseDSYMDirPthEnvKey); err != nil { - fail("Failed to export %s, error: %s", bitriseDSYMDirPthEnvKey, err) - } + if err := utils.ExportOutputDir(dsymDir, dsymDir, bitriseDSYMDirPthEnvKey); err != nil { + fail("Failed to export %s, error: %s", bitriseDSYMDirPthEnvKey, err) + } - log.Donef("The dSYM dir path is now available in the Environment Variable: %s (value: %s)", bitriseDSYMDirPthEnvKey, dsymDir) + log.Donef("The dSYM dir path is now available in the Environment Variable: %s (value: %s)", bitriseDSYMDirPthEnvKey, dsymDir) - if err := utils.ExportOutputDirAsZip(dsymDir, dsymZipPath, bitriseDSYMPthEnvKey); err != nil { - fail("Failed to export %s, error: %s", bitriseDSYMPthEnvKey, err) - } + if err := utils.ExportOutputDirAsZip(dsymDir, dsymZipPath, bitriseDSYMPthEnvKey); err != nil { + fail("Failed to export %s, error: %s", bitriseDSYMPthEnvKey, err) + } - log.Donef("The dSYM zip path is now available in the Environment Variable: %s (value: %s)", bitriseDSYMPthEnvKey, dsymZipPath) + log.Donef("The dSYM zip path is now available in the Environment Variable: %s (value: %s)", bitriseDSYMPthEnvKey, dsymZipPath) + } } diff --git a/vendor/github.com/kballard/go-shellquote/quote.go b/vendor/github.com/kballard/go-shellquote/quote.go index 9842d5ed..72a8cb38 100644 --- a/vendor/github.com/kballard/go-shellquote/quote.go +++ b/vendor/github.com/kballard/go-shellquote/quote.go @@ -84,8 +84,8 @@ quote: inQuote = true } buf.WriteString(word[0:i]) - word = word[i+1:] } + word = word[i+1:] if inQuote { buf.WriteByte('\'') inQuote = false