Beispiel #1
0
        protected override void Execute(CodeActivityContext context)
        {
            #region Workflow Arguments

            // This will be the api key or a path to the file with the key in it (or blank)
            var versionPatternOrSeedFilePath = VersionPatternOrSeedFilePath.Get(context);

            // The local build directory
            var packageId = PackageId.Get(context);

            var sourcesDirectory = SourcesDirectory.Get(context);

            #endregion

            string versionPattern;

            try
            {
                versionPattern = ExtractVersion(versionPatternOrSeedFilePath, packageId, QueryPackageId, sourcesDirectory);
            }
            catch (ArgumentException)
            {
                versionPattern = ExtractVersion(versionPatternOrSeedFilePath, packageId, QuerySolutionName, sourcesDirectory);
            }

            // Write to the log
            context.WriteBuildMessage(string.Format("Version Pattern: {0}", versionPattern), BuildMessageImportance.Normal);

            // Return the value back to the workflow
            context.SetValue(VersionPattern, versionPattern);
        }
Beispiel #2
0
        protected override void Execute(CodeActivityContext context)
        {
            #region Workflow Arguments

            // This will be the api key or a path to the file with the key in it (or blank)
            var apiKeyOrFile = ApiKeyOrFile.Get(context);

            // The local build directory
            var sourcesDirectory = SourcesDirectory.Get(context);

            #endregion

            string resultMessage;
            var    apiKey = ExtractApiKey(apiKeyOrFile, sourcesDirectory, out resultMessage);

            // Write to the log
            context.WriteBuildMessage(resultMessage, BuildMessageImportance.High);

            // Return the value back to the workflow
            context.SetValue(ApiKeyValue, apiKey);
        }