コード例 #1
0
        protected override void Execute(CodeActivityContext context)
        {
            #region Workflow Arguments

            var switchInvokePowerShell = SwitchInvokePowerShell.Get(context);
            var powerShellScriptPath   = PowerShellScriptPath.Get(context);
            var nuGetExeFilePath       = NuGetExeFilePath.Get(context);
            var nuSpecFilePath         = NuSpecFilePath.Get(context);
            var basePath          = BasePath.Get(context);
            var outputDirectory   = OutputDirectory.Get(context);
            var version           = Version.Get(context);
            var switchInvokePush  = SwitchInvokePush.Get(context);
            var apiKey            = ApiKey.Get(context);
            var pushDestination   = PushDestination.Get(context);
            var additionalOptions = AdditionalOptions.Get(context);

            #endregion

            var resultMessages = SummarizePropertyValues(switchInvokePowerShell, powerShellScriptPath, nuGetExeFilePath,
                                                         nuSpecFilePath, basePath, outputDirectory, version, switchInvokePush, apiKey,
                                                         pushDestination, additionalOptions);

            for (var i = 0; i < resultMessages.Length - 1; i++)
            {
                // Write to the log
                context.WriteBuildMessage(resultMessages[i], BuildMessageImportance.High);
            }
        }
コード例 #2
0
        /// <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);
        }