Skip to content

Commit

Permalink
Corrected output variable and filename of raw output log (#313)
Browse files Browse the repository at this point in the history
* Updated messaging to indicate correct output variable and filename of raw output log

* Make sure to use variable everywhere

* Update export ipa path

* Fix discrepancies between archive log and ipa export log
  • Loading branch information
vshah23 committed Dec 19, 2022
1 parent 9f4ef18 commit 2b0843e
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions step/step.go
Expand Up @@ -50,6 +50,8 @@ const (
xcodebuildArchiveLogPathEnvKey = "BITRISE_XCODEBUILD_ARCHIVE_LOG_PATH"
xcodebuildExportArchiveLogPathEnvKey = "BITRISE_XCODEBUILD_EXPORT_ARCHIVE_LOG_PATH"
bitriseIDEDistributionLogsPthEnvKey = "BITRISE_IDEDISTRIBUTION_LOGS_PATH"
xcodebuildArchiveLogFilename = "xcodebuild-archive.log"
xcodebuildExportArchiveLogFilename = "xcodebuild-export-archive.log"

// Env Outputs
bitriseAppDirPthEnvKey = "BITRISE_APP_DIR_PATH"
Expand Down Expand Up @@ -642,7 +644,7 @@ func (s XcodebuildArchiver) ExportOutput(opts ExportOpts) error {
}

if opts.XcodebuildArchiveLog != "" {
xcodebuildArchiveLogPath := filepath.Join(opts.OutputDir, "xcodebuild-archive.log")
xcodebuildArchiveLogPath := filepath.Join(opts.OutputDir, xcodebuildArchiveLogFilename)
if err := cleanup(xcodebuildArchiveLogPath); err != nil {
return err
}
Expand All @@ -655,13 +657,13 @@ func (s XcodebuildArchiver) ExportOutput(opts ExportOpts) error {
}

if opts.XcodebuildExportArchiveLog != "" {
xcodebuildExportArchiveLogPath := filepath.Join(opts.OutputDir, "xcodebuild-export-archive.log")
xcodebuildExportArchiveLogPath := filepath.Join(opts.OutputDir, xcodebuildExportArchiveLogFilename)
if err := cleanup(xcodebuildExportArchiveLogPath); err != nil {
return err
}

if err := ExportOutputFileContent(s.cmdFactory, opts.XcodebuildExportArchiveLog, xcodebuildExportArchiveLogPath, xcodebuildExportArchiveLogPathEnvKey); err != nil {
s.logger.Warnf("Failed to export %s, error: %s", xcodebuildArchiveLogPathEnvKey, err)
s.logger.Warnf("Failed to export %s, error: %s", xcodebuildExportArchiveLogPathEnvKey, err)
} else {
s.logger.Donef("The xcodebuild -exportArchive log path is now available in the Environment Variable: %s (value: %s)", xcodebuildExportArchiveLogPathEnvKey, xcodebuildExportArchiveLogPath)
}
Expand Down Expand Up @@ -867,8 +869,8 @@ and use 'Export iOS and tvOS Xcode archive' step to export an App Clip.`, opts.S
}
s.logger.Printf(stringutil.LastNLines(xcodebuildLog, 20))

s.logger.Warnf(`You can find the last couple of lines of Xcode's build log above, but the full log will be also available in the raw-xcodebuild-output.log
The log file will be stored in $BITRISE_DEPLOY_DIR, and its full path will be available in the $BITRISE_XCODE_RAW_RESULT_TEXT_PATH environment variable.`)
s.logger.Warnf(fmt.Sprintf(`You can find the last couple of lines of Xcode's build log above, but the full log will be also available in the %s
The log file will be stored in $BITRISE_DEPLOY_DIR, and its full path will be available in the $%s environment variable.`, xcodebuildArchiveLogFilename, xcodebuildArchiveLogPathEnvKey))
}
if err != nil {
return out, fmt.Errorf("failed to archive the project: %w", err)
Expand Down Expand Up @@ -1019,9 +1021,9 @@ func (s XcodebuildArchiver) xcodeIPAExport(opts xcodeIPAExportOpts) (xcodeIPAExp
out.XcodebuildExportArchiveLog = xcodebuildLog
if exportErr != nil {
if useXCPretty {
s.logger.Warnf(`If you can't find the reason of the error in the log, please check the raw-xcodebuild-output.log
The log file is stored in $BITRISE_DEPLOY_DIR, and its full path
is available in the $BITRISE_XCODE_RAW_RESULT_TEXT_PATH environment variable`)
s.logger.Warnf(fmt.Sprintf(`If you can't find the reason of the error in the log, please check the %s
The log file will be stored in $BITRISE_DEPLOY_DIR, and its full path
will be available in the $%s environment variable`, xcodebuildExportArchiveLogFilename, xcodebuildExportArchiveLogPathEnvKey))
}

// xcdistributionlogs
Expand Down

0 comments on commit 2b0843e

Please sign in to comment.