Search in sources :

Example 1 with DescriptorImpl

use of jenkins.plugins.nodejs.tools.NodeJSInstallation.DescriptorImpl in project nodejs-plugin by jenkinsci.

the class NodeJSPlugin method setInstallations.

/**
 * Set the NodeJS installation.
 *
 * @param installations an array of {@link NodeJSInstallation}
 * @deprecated You should not set manually system NodeJS installation, in
 *             case use the standard
 *             {@link Jenkins#getDescriptorByType(Class)
 *             #setInstallations(NodeJSInstallation[])}
 */
@Deprecated
public void setInstallations(@NonNull NodeJSInstallation[] installations) {
    DescriptorImpl descriptor = Jenkins.getActiveInstance().getDescriptorByType(NodeJSInstallation.DescriptorImpl.class);
    if (descriptor != null) {
        descriptor.setInstallations(installations != null ? installations : new NodeJSInstallation[0]);
        descriptor.save();
    }
}
Also used : NodeJSInstallation(jenkins.plugins.nodejs.tools.NodeJSInstallation) DescriptorImpl(jenkins.plugins.nodejs.tools.NodeJSInstallation.DescriptorImpl)

Aggregations

NodeJSInstallation (jenkins.plugins.nodejs.tools.NodeJSInstallation)1 DescriptorImpl (jenkins.plugins.nodejs.tools.NodeJSInstallation.DescriptorImpl)1