protected override void Execute(CodeActivityContext context) { #region Extract Workflow Argument Values // The file path of the nuget.exe - if null or empty then // assume nuget is "installed" on the build server and in the path var nuGetExeFilePath = NuGetExeFilePath.Get(context); // The path of the nuspec file var packageLocation = PackageLocation.Get(context); // The API Key for pushing var apiKey = ApiKey.Get(context); // The destination location if deployment is to be done var pushDestination = PushDestination.Get(context); #endregion // Don't assume that DI will have happened. If the value is null then create the default object.) if (NuGetProcess == null) { NuGetProcess = new NuGetProcess(); } // Call the method that will do the work var results = NuGetPublishing(nuGetExeFilePath, packageLocation, pushDestination, apiKey, context); // Send the result back to the workflow NuGetPushResult.Set(context, results); }
/// <summary> /// Searches an XML file with an XPath expression /// </summary> /// <param name="context"></param> protected override void Execute(CodeActivityContext context) { // get the value of the FilePath var packageInfoFilePath = context.GetValue(PackageInfoFilePath); var packageIndex = context.GetValue(PackageIndex); var outputDirectoryFromBldDef = context.GetValue(OutputDirectoryFromBldDef); var switchInvokePushFromBldDef = context.GetValue(SwitchInvokePushFromBldDef); var pushDestinationFromBldDef = context.GetValue(PushDestinationFromBldDef); var switchInvokePowerShellFromBldDef = context.GetValue(SwitchInvokePowerShellFromBldDef); var versionFromBldDef = context.GetValue(VersionFromBldDef); var basePathFromBldDef = context.GetValue(BasePathFromBldDef); var additionalOptionsFromBldDef = context.GetValue(AdditionalOptionsFromBldDef); var powerShellScriptPathFromBldDef = context.GetValue(PowerShellScriptPathFromBldDef); var packageData = Execute(packageInfoFilePath, packageIndex, basePathFromBldDef, additionalOptionsFromBldDef, outputDirectoryFromBldDef, switchInvokePushFromBldDef, pushDestinationFromBldDef, switchInvokePowerShellFromBldDef, powerShellScriptPathFromBldDef, versionFromBldDef); Name.Set(context, packageData.Name); AdditionalOptions.Set(context, packageData.AdditionalOptions); BasePath.Set(context, packageData.BasePath); NuSpecFilePath.Set(context, packageData.NuSpecFilePath); PowerShellScriptPath.Set(context, packageData.PowerShellScriptPath); Version.Set(context, packageData.Version); OutputDirectory.Set(context, packageData.OutputDirectory); SwitchInvokePush.Set(context, packageData.SwitchInvokePush); PushDestination.Set(context, packageData.PushDestination); SwitchInvokePowerShell.Set(context, packageData.SwitchInvokePowerShell); }