private static List <Property> GetProperties(Action <IBuildParameterValueBuilder> parameters)
        {
            if (parameters == null)
            {
                return(new List <Property>());
            }

            var buildParameterValueBuilder = new BuildParameterValueBuilder();

            parameters(buildParameterValueBuilder);
            return(buildParameterValueBuilder.GetParameters());
        }
Esempio n. 2
0
        public void SetProjectParameters(Action <IBuildProjectHavingBuilder> having, Action <IBuildParameterValueBuilder> parameters)
        {
            var buildConfigurationHavingBuilder = m_BuildProjectHavingBuilderFactory.CreateBuildProjectHavingBuilder();

            having(buildConfigurationHavingBuilder);
            var projectLocator = buildConfigurationHavingBuilder.GetLocator();

            var writer = new JsonWriter(new DataWriterSettings(new ConventionResolverStrategy(ConventionResolverStrategy.WordCasing.CamelCase)));

            BuildParameterValueBuilder buildParameterValueBuilder = new BuildParameterValueBuilder();

            parameters(buildParameterValueBuilder);

            buildParameterValueBuilder.GetParameters()
            .ForEach(p => m_TeamCityCaller.PutFormat(writer.Write(p), HttpContentTypes.ApplicationJson,
                                                     "/app/rest/projects/{0}/parameters/{1}", projectLocator, p.Name));
        }