@@ -10,6 +10,7 @@ import * as packCommand from './packcommand';
1010import * as pushCommand from './pushcommand' ;
1111import * as restoreCommand from './restorecommand' ;
1212import * as utility from './Common/utility' ;
13+ import * as telemetry from "azure-pipelines-tasks-utility-common/telemetry" ;
1314
1415export class dotNetExe {
1516 private command : string ;
@@ -52,6 +53,7 @@ export class dotNetExe {
5253 await this . executeTestCommand ( ) ;
5354 break ;
5455 case "restore" :
56+ this . logRestoreStartUpVariables ( ) ;
5557 await restoreCommand . run ( ) ;
5658 break ;
5759 case "pack" :
@@ -411,6 +413,48 @@ export class dotNetExe {
411413 private static getModifiedOutputForProjectFile ( outputBase : string , projectFile : string ) : string {
412414 return path . join ( outputBase , path . basename ( path . dirname ( projectFile ) ) ) ;
413415 }
416+
417+ private logRestoreStartUpVariables ( ) {
418+ try {
419+ const nugetfeedtype = tl . getInput ( "nugetfeedtype" ) ;
420+ let externalendpoint = null ;
421+ if ( nugetfeedtype != null && nugetfeedtype === "external" ) {
422+ const epId = tl . getInput ( "externalendpoint" ) ;
423+ if ( epId ) {
424+ externalendpoint = {
425+ feedName : tl . getEndpointUrl ( epId , false ) . replace ( / \W / g, "" ) ,
426+ feedUri : tl . getEndpointUrl ( epId , false ) ,
427+ } ;
428+ }
429+ }
430+
431+ let externalendpoints = tl . getDelimitedInput ( "externalendpoints" , "," ) ;
432+ if ( externalendpoints ) {
433+ externalendpoints = externalendpoints . reduce ( ( ary , id ) => {
434+ const te = {
435+ feedName : tl . getEndpointUrl ( id , false ) . replace ( / \W / g, "" ) ,
436+ feedUri : tl . getEndpointUrl ( id , false ) ,
437+ } ;
438+ ary . push ( te ) ;
439+ return ary ;
440+ } , [ ] ) ;
441+ }
442+ const nugetTelem = {
443+ "command" : tl . getInput ( "command" ) ,
444+ "System.TeamFoundationCollectionUri" : tl . getVariable ( "System.TeamFoundationCollectionUri" ) ,
445+ "includenugetorg" : tl . getInput ( "includenugetorg" ) ,
446+ "nocache" : tl . getInput ( "nocache" ) ,
447+ "nugetconfigpath" : tl . getInput ( "nugetconfigpath" ) ,
448+ "nugetfeedtype" : nugetfeedtype ,
449+ "selectorconfig" : tl . getInput ( "selectorconfig" ) ,
450+ "projects" : tl . getInput ( "projects" ) ,
451+ "verbosityrestore" : tl . getInput ( "verbosityrestore" )
452+ } ;
453+ telemetry . emitTelemetry ( "Packaging" , "DotNetCoreCLIRestore" , nugetTelem ) ;
454+ } catch ( err ) {
455+ tl . debug ( `Unable to log NuGet task init telemetry. Err:( ${ err } )` ) ;
456+ }
457+ }
414458}
415459
416460var exe = new dotNetExe ( ) ;
0 commit comments