Adds `pluginName` property to non JS bundles
170006
function addPluginName(data) {
	var loader = data.loader;
	var bundles = data.bundles;

	var promises = bundles.map(function(bundle) {
		if (!isJavaScriptBundle(bundle)) {
			return loader.normalize(bundle.name).then(function(name) {
				bundle.pluginName = name.substring(name.indexOf("!") + 1);
			});
		}
	});

	return Promise.all(promises).then(function() {
		return data;
	});
}
504013
function addDeployPlugin(webpackConfig, wpkConfig, env) {
    env = proccessFtpPath(env);

    webpackConfig.plugins.push(new DeployPlugin({
        server: `${env.__ftp_user__}:${env.__ftp_password__}@${env.__ftp_host__}:${env.__ftp_port__}`,
        workspace: wpkConfig.output.path,
        deployTo: env.__ftp_path__
    }));
}
266924
function addNotPackPluginRes(target, resFiles) {
    resFiles.forEach(function (item) {
        if (target.indexOf(item) === -1) {
            target.push(item);
        }
    });
}
840424
function generateBundleName(name, modules, conditionValueOrVariationObject) {
    // first check if the given modules already matches an existing bundle
    let existingBundleName;
    for (const bundleName of Object.keys(bundles)) {
      const bundleModules = bundles[bundleName].modules;

      if (
        containsModules(modules, bundleModules) &&
        containsModules(bundleModules, modules)
      ) {
        existingBundleName = bundleName;
      }
    }
    if (existingBundleName) {
      return existingBundleName;
    }

    let shortName = name.split('/').pop();
    const dotIndex = shortName.lastIndexOf('.');
    if (dotIndex > 0) {
      shortName = shortName.substr(0, dotIndex);
    }

    let bundleName = shortName.replace(/[ .]/g, '').toLowerCase();
    if (conditionValueOrVariationObject) {
      if (typeof conditionValueOrVariationObject === 'string') {
        bundleName += `-${conditionValueOrVariationObject}`;
      } else {
        for (const condition of Object.keys(conditionValueOrVariationObject)) {
          bundleName += `-${conditionValueOrVariationObject[condition]}`;
        }
      }
    }

    let i;
    if (bundles[bundleName]) {
      i = 1;
      while (bundles[`${bundleName}-${i}`]) {
        i += 1;
      }
    }
    return bundleName + (i ? `-${i}` : '');
  }
23751
def add_plugin(self, plugin):
        
        self.plugin_by_name[plugin.get_plugin_name()] = plugin
        self.plugins.append(plugin)
675202
function (pluginName, moduleName, write) {

			var module,
				content,
				cutPos,
				modPath,
				relCssPath;
			if (_genericCssToRootPath && _buildMap.hasOwnProperty(moduleName)) {

				module = _buildMap[moduleName];
				if (module.write) {

					// #1: fix urls in css
					// get folder path to the current module
					cutPos = moduleName.lastIndexOf("/");
					modPath = cutPos >= 0 ? moduleName.slice(0, cutPos + 1) : "";
					// form a new base path for substituting in css
					relCssPath = _genericCssToRootPath + modPath;

					// replace all links like 'url(folder/file.png)' in the module's content (css)
					// to make them relative to the generic.css location
					content = _replaceCssRelativeUrls(module.data, relCssPath);

					// #2: add module's css into common generic.css
					module.write(moduleName, module.path, content);
				}
			}
		}
940609
function getPackageName(content, pluginLookup, identifierPath) {
  let memberPath = identifierPath.parentPath;
  while (memberPath.isMemberExpression()) {
    const code = content.slice(identifierPath.node.end, memberPath.node.end);
    const pluginName = pluginLookup[code];
    if (pluginName) {
      return pluginName;
    }

    memberPath = memberPath.parentPath;
  }

  return '';
}
26665
public void addPlugins(String pluginTypeNames) {
		String[] pluginTypeNameList = pluginTypeNames.split(",");
		for (String pluginTypeName : pluginTypeNameList) {
			pluginTypeName = pluginTypeName.trim();
			if (!pluginTypeName.equals("")) {
				addPlugin(pluginTypeName);
			}
		}
	}
956064
function validatePluginName(plugin, pluginList) {
    if (!plugin.name)
        throw new Error(ApiHost.ERR_PLUGIN_MISSING_NAME_PROPERTY);

    pluginList.forEach(function (collectorPlugin) {
        if (plugin.name === collectorPlugin.name) {
            var msg = util.format(ApiHost.ERR_DUPLICATE_PLUGIN_NAME, plugin.name, plugin.extends);
            throw new Error(msg);
        }
    });
}
777411
function getPluginConfig(config, pluginName) {
    var pluginsConfig = config.getValues().get('pluginsConfig');
    if (pluginsConfig === undefined) {
        return {};
    }
    var pluginConf = pluginsConfig.get(pluginName);
    if (pluginConf === undefined) {
        return {};
    } else {
        return pluginConf.toJS();
    }
}
630030
function pluginType(plugin) {
    var name = plugin.getName();
    return (name && name.indexOf(THEME_PREFIX) === 0) ? TYPE_THEME : TYPE_PLUGIN;
}
326785
function isLodashPluginWithSemanticUiReact(plugin) {
    if (Array.isArray(plugin)) {
        // Babel 6 plugin is a tuple as an array [id, options]
        return (
            ["lodash", "babel-plugin-lodash"].includes(plugin[0].key) &&
            [].concat(plugin[1].id).includes("semantic-ui-react")
        );
    } else if (plugin != null && typeof plugin === "object") {
      // Babel 7 plugin is an object { key, options, ... }
        return (
            /[/\\]node_modules([/\\].*)?[/\\]babel-plugin-lodash([/\\].*)?$/.test(plugin.key) &&
            plugin.options &&
            plugin.options.id &&
            [].concat(plugin.options.id).includes("semantic-ui-react")
        );
    } else {
        return false;
    }
}
604861
function importPlugin(pluginRules, pluginName) {
		Object.keys(pluginRules).forEach(function(ruleId) {
			var qualifiedRuleId = pluginName + "/" + ruleId,
				rule = pluginRules[ruleId];

			define(qualifiedRuleId, rule);
		});
	}
1093051
def add_plugin(self, plugin):
        

        item = {}
        item.update(defaults["common"])
        item.update(defaults["plugin"])

        for member in ["pre11",
                       "name",
                       "label",
                       "optional",
                       "category",
                       "actions",
                       "id",
                       "order",
                       "doc",
                       "type",
                       "module",
                       "match",
                       "hasRepair",
                       "families",
                       "contextEnabled",
                       "instanceEnabled",
                       "__instanceEnabled__",
                       "path"]:
            item[member] = plugin[member]

        # Visualised in Perspective
        item["familiesConcatenated"] = ", ".join(plugin["families"])

        # converting links to HTML
        pattern = r"(https?:\/\/(?:w{1,3}.)?[^\s]*?(?:\.[a-z]+)+)"
        pattern += r"(?![^<]*?(?:<\/\w+>|\/?>))"
        if item["doc"] and re.search(pattern, item["doc"]):
            html = r"<a href='\1'><font color='FF00CC'>\1</font></a>"
            item["doc"] = re.sub(pattern, html, item["doc"])

        # Append GUI-only data
        item["itemType"] = "plugin"
        item["hasCompatible"] = True
        item["isToggled"] = plugin.get("active", True)
        item["verb"] = {
            "Selector": "Collect",
            "Collector": "Collect",
            "Validator": "Validate",
            "Extractor": "Extract",
            "Integrator": "Integrate",
            "Conformer": "Integrate",
        }.get(item["type"], "Other")

        for action in item["actions"]:
            if action["on"] == "all":
                item["actionsIconVisible"] = True

        self.add_section(item["verb"])

        item = self.add_item(item)
        self.plugins.append(item)
49810
function (data, pluginNames) {
    logger('runPlugins input', data);
    var plugins = pluginNames.map(function (pn) { return pluginRegistry[pn]; }),
      applyPlugin = function (oldData, plugin) { return plugin(oldData); };
    // Use reduce to apply all the plugins to the data
    var output = plugins.reduce(applyPlugin, data);
    logger('runPlugins output', output);
    return output;
  }
345420
function hasPlugin(deps, pluginName, version) {
    return !!deps.find(function(dep) {
        return dep.getName() === pluginName && (!version || dep.getVersion() === version);
    });
}
1271538
function bundleJavascript() {
  const bundleEntryPath = path.resolve(__dirname, '..', 'dist', 'static', 'hierplane.js');
  const bundlePath = path.resolve(__dirname, '..', 'dist', 'static', 'hierplane.bundle.js');

  // Put together our "bundler", which uses browserify
  const browserifyOpts = {
    entries: [ bundleEntryPath ],
    standalone: 'hierplane'
  };

  // If we're watching or changes, enable watchify
  if (isWatchTarget) {
    // These are required for watchify
    browserifyOpts.packageCache = {};
    browserifyOpts.cache = {};

    // Enable the plugin
    browserifyOpts.plugin = [ watchify ];
  };

  // Construct the bundler
  const bundler = browserify(browserifyOpts);

  // Make an inline function which writes out the bundle, so that we can invoke it whenever
  // an update is detected if the watch target is being executed.
  const writeBundle = () => {
    console.log(chalk.cyan(`bundling ${chalk.magenta(path.relative(execArgs.cwd, bundleEntryPath))}`));
    bundler.bundle().pipe(fs.createWriteStream(bundlePath))
    console.log(chalk.green(`wrote ${chalk.magenta(path.relative(execArgs.cwd, bundlePath))}`));
  };

  // Write out the bundle once
  writeBundle();

  // If we're supposed to watch for changes, write out the bundle whenever they occur
  if (isWatchTarget) {
    bundler.on('update', writeBundle);
  }
}