@@ -67,6 +67,7 @@ public override bool Execute()
67
67
68
68
if ( PublishFlatContainer )
69
69
{
70
+ // Act as if %(PublishFlatContainer) were true for all items.
70
71
blobArtifacts = itemsToPushNoExcludes
71
72
. Select ( BuildManifestUtil . CreateBlobArtifactModel ) ;
72
73
foreach ( var blobItem in itemsToPushNoExcludes )
@@ -89,8 +90,23 @@ public override bool Execute()
89
90
} )
90
91
. ToArray ( ) ;
91
92
93
+ var blobItems = itemsToPushNoExcludes
94
+ . Where ( i =>
95
+ {
96
+ var isFlatString = i . GetMetadata ( "PublishFlatContainer" ) ;
97
+ if ( ! string . IsNullOrEmpty ( isFlatString ) &&
98
+ bool . TryParse ( isFlatString , out var isFlat ) )
99
+ {
100
+ return isFlat ;
101
+ }
102
+
103
+ return false ;
104
+ } )
105
+ . Union ( symbolItems )
106
+ . ToArray ( ) ;
107
+
92
108
ITaskItem [ ] packageItems = itemsToPushNoExcludes
93
- . Where ( i => ! symbolItems . Contains ( i ) )
109
+ . Except ( blobItems )
94
110
. ToArray ( ) ;
95
111
96
112
foreach ( var packagePath in packageItems )
@@ -102,26 +118,26 @@ public override bool Execute()
102
118
$ "##vso[artifact.upload containerfolder=PackageArtifacts;artifactname=PackageArtifacts]{ destFile } ") ;
103
119
}
104
120
105
- foreach ( var symbolPath in symbolItems )
121
+ foreach ( var blobItem in blobItems )
106
122
{
107
- var destFile = $ "{ AssetsTemporaryDirectory } /{ Path . GetFileName ( symbolPath . ItemSpec ) } ";
108
- File . Copy ( symbolPath . ItemSpec , destFile ) ;
123
+ var destFile = $ "{ AssetsTemporaryDirectory } /{ Path . GetFileName ( blobItem . ItemSpec ) } ";
124
+ File . Copy ( blobItem . ItemSpec , destFile ) ;
109
125
110
126
Log . LogMessage ( MessageImportance . High ,
111
127
$ "##vso[artifact.upload containerfolder=BlobArtifacts;artifactname=BlobArtifacts]{ destFile } ") ;
112
128
}
113
129
114
130
packageArtifacts = packageItems . Select ( BuildManifestUtil . CreatePackageArtifactModel ) ;
115
- blobArtifacts = symbolItems . Select ( BuildManifestUtil . CreateBlobArtifactModel ) . Where ( blob => blob != null ) ;
131
+ blobArtifacts = blobItems . Select ( BuildManifestUtil . CreateBlobArtifactModel ) . Where ( blob => blob != null ) ;
116
132
}
117
133
118
- BuildManifestUtil . CreateBuildManifest ( Log ,
119
- blobArtifacts ,
134
+ BuildManifestUtil . CreateBuildManifest ( Log ,
135
+ blobArtifacts ,
120
136
packageArtifacts ,
121
- AssetManifestPath ,
122
- ManifestRepoUri ,
137
+ AssetManifestPath ,
138
+ ManifestRepoUri ,
123
139
ManifestBuildId ,
124
- ManifestBranch ,
140
+ ManifestBranch ,
125
141
ManifestCommit ,
126
142
ManifestBuildData ,
127
143
IsStableBuild ) ;
0 commit comments