-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #317 from mathworks/2.13.1-patch-fix
Patch fix for file error issue
- Loading branch information
Showing
2 changed files
with
18 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,20 +6,24 @@ | |
|
||
function runTaskGraph(plugin, pluginData) | ||
[email protected](plugin, pluginData); | ||
fID = fopen(fullfile(getenv("WORKSPACE"),'.matlab/buildArtifact.json'), 'w'); | ||
taskDetails = struct(); | ||
for idx = 1:numel(pluginData.TaskResults) | ||
taskDetails(idx).name = pluginData.TaskResults(idx).Name; | ||
taskDetails(idx).description = pluginData.TaskGraph.Tasks(idx).Description; | ||
taskDetails(idx).failed = pluginData.TaskResults(idx).Failed; | ||
taskDetails(idx).skipped = pluginData.TaskResults(idx).Skipped; | ||
taskDetails(idx).duration = string(pluginData.TaskResults(idx).Duration); | ||
[fID, msg] = fopen(fullfile(getenv("WORKSPACE"),".matlab/buildArtifact.json"), "w"); | ||
|
||
if fID == -1 | ||
warning("ciplugins:jenkins:BuildReportPlugin:UnableToOpenFile","Could not open a file for Jenkins build result table due to: %s", msg); | ||
else | ||
closeFile = onCleanup(@()fclose(fID)); | ||
taskDetails = struct(); | ||
for idx = 1:numel(pluginData.TaskResults) | ||
taskDetails(idx).name = pluginData.TaskResults(idx).Name; | ||
taskDetails(idx).description = pluginData.TaskGraph.Tasks(idx).Description; | ||
taskDetails(idx).failed = pluginData.TaskResults(idx).Failed; | ||
taskDetails(idx).skipped = pluginData.TaskResults(idx).Skipped; | ||
taskDetails(idx).duration = string(pluginData.TaskResults(idx).Duration); | ||
end | ||
a = struct("taskDetails",taskDetails); | ||
s = jsonencode(a,PrettyPrint=true); | ||
fprintf(fID, "%s",s); | ||
end | ||
a = struct("taskDetails",taskDetails); | ||
s = jsonencode(a,"PrettyPrint",true); | ||
fprintf(fID, '%s',s); | ||
fclose(fID); | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters