Adding environment and system variables to build info.

@param builder
355019
@Override
    protected void addBuildInfoProperties(BuildInfoBuilder builder) {
        if (envVars != null) {
            for (Map.Entry<String, String> entry : envVars.entrySet()) {
                builder.addProperty(BuildInfoProperties.BUILD_INFO_ENVIRONMENT_PREFIX + entry.getKey(), entry.getValue());
            }
        }

        if (sysVars != null) {
            for (Map.Entry<String, String> entry : sysVars.entrySet()) {
                builder.addProperty(entry.getKey(), entry.getValue());
            }
        }
    }
897642
static void addTagToBuilder(Tag tag, TagMapBuilderImpl builder) {
    builder.put(tag.getKey(), tag.getValue(), tag.getTagMetadata());
  }
1129109
@Override public void makeSensitiveBuildVariables(AbstractBuild build, Set<String> sensitiveVariables) {
        super.makeSensitiveBuildVariables(build, sensitiveVariables);
        // TODO determine if there is a meaningful way to generalize this; perhaps as a new [Run]Action recording sensitiveVariables?
        // Complicated by the fact that in principle someone could call getSensitiveBuildVariables *before* the wrapper starts and actually sets those variables,
        // though in practice the likely use cases would come later, and perhaps it is acceptable to omit the names of variables which are yet to be set.
        // Also unclear if there is any use case for calling this method after the build is done (or Jenkins is restarted);
        // most likely it is only used during the build itself.
        // Would be much cleaner if EnvVars itself recorded which keys had sensitive values.
    }
415125
public static Description buildDescriptionWith(Consumer<DescriptionBuilder> builder) {
        DescriptionBuilder builder1 = builder();
        builder.accept(builder1);
        return builder1.build();
    }
533170
def build(self, builder):
        
        builder.start("SourceID", {})
        builder.data(self.source_id)
        builder.end("SourceID")
951920
public RuntimeEnvironmentBuilder addConfiguration(String name, String value) {
        if (name == null || value == null) {
            return this;
        }
        _runtimeEnvironment.addToConfiguration(name, value);

        return this;
    }
667489
protected void addProperties(Element element, BeanDefinitionBuilder builder) {
        NamedNodeMap attributes = element.getAttributes();
        
        for (int i = 0; i < attributes.getLength(); i++) {
            Node node = attributes.item(i);
            String attrName = getNodeName(node);
            attrName = "class".equals(attrName) ? "clazz" : attrName;
            builder.addPropertyValue(attrName, node.getNodeValue());
        }
    }
682347
public static void logShellEnvironmentVariables() {
		Map<String, String> env = System.getenv();
		Iterator<String> keys = env.keySet().iterator();
		while (keys.hasNext() ) {
			String key = keys.next();
			String value = env.get(key);
			logMessage("Env, "+key+"="+value.trim());
		}
	}
1039299
public void addEnv(final Environment.Variable env){
        if(null==envVars) {
            envVars = new ArrayList<Environment.Variable>();
        }
        envVars.add(env);
    }
616890
@TaskAction
	public void generateBuildProperties() {
		try {
			new BuildPropertiesWriter(new File(getDestinationDir(),
					"build-info.properties")).writeBuildProperties(new ProjectDetails(
							this.properties.getGroup(),
							(this.properties.getArtifact() != null)
									? this.properties.getArtifact() : "unspecified",
							this.properties.getVersion(), this.properties.getName(),
							this.properties.getTime(),
							coerceToStringValues(this.properties.getAdditional())));
		}
		catch (IOException ex) {
			throw new TaskExecutionException(this, ex);
		}
	}
817373
private Map<String, String> returnEnvironmentVars(AbstractBuild<?, ?> build, TaskListener listener) {
        Map<String, String> envVars = Ghprb.getEnvVars(build, listener);

        if (!envVars.containsKey("ghprbUpstreamStatus")) {
            return null;
        }

        GhprbGitHubAuth auth = GhprbTrigger.getDscp()
                .getGitHubAuth(envVars.get("ghprbCredentialsId"));

        try {
            GitHub gh = auth.getConnection(build.getProject());
            repo = gh.getRepository(envVars.get("ghprbGhRepository"));
            return envVars;
        } catch (Exception e) {
            LOGGER.log(Level.SEVERE, "Unable to connect to GitHub repo", e);
            return null;
        }

    }
947717
def build(self, builder):
        
        builder.start("Annotations")

        # populate the flags
        for annotation in self.annotations:
            annotation.build(builder)

        builder.end("Annotations")
529358
public UpdateBranchRequest withEnvironmentVariables(java.util.Map<String, String> environmentVariables) {
        setEnvironmentVariables(environmentVariables);
        return this;
    }
1285695
public static void initEnvironment() {
		// init logging system if not specified
		if (System.getProperty("org.apache.commons.logging.Log") == null)
			System.setProperty("org.apache.commons.logging.Log", "net.lecousin.framework.log.bridges.ApacheCommonsLogging");
		
		// register protocols
		String protocols = System.getProperty("java.protocol.handler.pkgs");
		if (protocols == null) protocols = "";
		if (!protocols.contains("net.lecousin.framework.protocols")) {
			if (protocols.length() > 0) protocols += "|";
			protocols += "net.lecousin.framework.protocols";
			System.setProperty("java.protocol.handler.pkgs", protocols);
		}
	}
67439
public void setBuilder(Release languageVersion) throws CoreException
	{
		addBuilder(getProject(), ICoreConstants.BUILDER_ID, LANGUAGE_VERSION_ARGUMENT_KEY, languageVersion.toString());
	}
272492
def build(self, builder):
        
        builder.start("LocationRef", dict(LocationOID=str(self.oid)))
        builder.end("LocationRef")
379425
public void setEnvironmentVariables(Map<String, String> environment) {
    for (Map.Entry<String, String> entry : environment.entrySet()) {
      setEnvironmentVariable(entry.getKey(), entry.getValue());
    }
  }