@@ -144,6 +144,25 @@ export class ArtifactManager {
144
144
}
145
145
this . logging . log ( 'Total project references: ' + projects . length )
146
146
147
+ let packages : string [ ] = [ ]
148
+ if ( request . PackageReferences != null ) {
149
+ for ( const pkg of request . PackageReferences ) {
150
+ if ( ! pkg . NetCompatiblePackageFilePath ) {
151
+ continue
152
+ }
153
+ try {
154
+ const packageRelativePath = this . normalizePackageFileRelativePath ( pkg . NetCompatiblePackageFilePath )
155
+ packages . push ( packageRelativePath )
156
+ await this . copyFile (
157
+ pkg . NetCompatiblePackageFilePath ,
158
+ this . getWorkspaceReferencePathFromRelativePath ( packageRelativePath )
159
+ )
160
+ } catch ( error ) {
161
+ this . logging . log ( 'Failed to process package file: ' + error + pkg . NetCompatiblePackageFilePath )
162
+ }
163
+ }
164
+ }
165
+
147
166
return {
148
167
EntryPath : this . normalizeSourceFileRelativePath ( request . SolutionRootPath , request . SelectedProjectPath ) ,
149
168
SolutionPath : this . normalizeSourceFileRelativePath ( request . SolutionRootPath , request . SolutionFilePath ) ,
@@ -152,6 +171,7 @@ export class ArtifactManager {
152
171
...( request . EnableRazorViewTransform !== undefined && {
153
172
EnableRazorViewTransform : request . EnableRazorViewTransform ,
154
173
} ) ,
174
+ Packages : packages ,
155
175
} as RequirementJson
156
176
}
157
177
@@ -240,6 +260,10 @@ export class ArtifactManager {
240
260
: relativePath . toLowerCase ( )
241
261
}
242
262
263
+ normalizePackageFileRelativePath ( packageFilePath : string ) : string {
264
+ return path . join ( packagesFolderName , path . basename ( packageFilePath ) ) . toLowerCase ( )
265
+ }
266
+
243
267
zipDirectory ( sourceDir : string , outPath : string ) {
244
268
const archive = archiver ( 'zip' , { zlib : { level : 9 } } )
245
269
const stream = fs . createWriteStream ( outPath )
0 commit comments