Create the classpath to be used when searching for component being defined
975109
public function createClasspath()
    {
        if ($this->isReference()) {
            throw $this->tooManyAttributes();
        }
        if ($this->classpath === null) {
            $this->classpath = new Path($this->project);
        }

        return $this->classpath->createPath();
    }
328445
function(node) {
      var i;
      var j;
      var k;
      var l;
      var componentName;
      var componentNode;
      // Get the component path
      var componentPath = [];
      while (node) {
        if (node.property && node.property.type === 'Identifier') {
          componentPath.push(node.property.name);
        }
        if (node.object && node.object.type === 'Identifier') {
          componentPath.push(node.object.name);
        }
        node = node.object;
      }
      componentPath.reverse();
      componentName = componentPath.slice(0, componentPath.length - 1).join('.');

      // Find the variable in the current scope
      var variableName = componentPath.shift();
      if (!variableName) {
        return null;
      }
      var variableInScope;
      var variables = variableUtil.variablesInScope(context);
      for (i = 0, j = variables.length; i < j; i++) {
        if (variables[i].name === variableName) {
          variableInScope = variables[i];
          break;
        }
      }
      if (!variableInScope) {
        return null;
      }

      // Try to find the component using variable references
      var refs = variableInScope.references;
      var refId;
      for (i = 0, j = refs.length; i < j; i++) {
        refId = refs[i].identifier;
        if (refId.parent && refId.parent.type === 'MemberExpression') {
          refId = refId.parent;
        }
        if (sourceCode.getText(refId) !== componentName) {
          continue;
        }
        if (refId.type === 'MemberExpression') {
          componentNode = refId.parent.right;
        } else if (refId.parent && refId.parent.type === 'VariableDeclarator') {
          componentNode = refId.parent.init;
        }
        break;
      }

      if (componentNode) {
        // Return the component
        return components.add(componentNode, 1);
      }

      // Try to find the component using variable declarations
      var defInScope;
      var defs = variableInScope.defs;
      for (i = 0, j = defs.length; i < j; i++) {
        if (defs[i].type === 'ClassName' || defs[i].type === 'FunctionName' || defs[i].type === 'Variable') {
          defInScope = defs[i];
          break;
        }
      }
      if (!defInScope || !defInScope.node) {
        return null;
      }
      componentNode = defInScope.node.init || defInScope.node;

      // Traverse the node properties to the component declaration
      for (i = 0, j = componentPath.length; i < j; i++) {
        if (!componentNode.properties) {
          continue;
        }
        for (k = 0, l = componentNode.properties.length; k < l; k++) {
          if (componentNode.properties[k].key.name === componentPath[i]) {
            componentNode = componentNode.properties[k];
            break;
          }
        }
        if (!componentNode || !componentNode.value) {
          return null;
        }
        componentNode = componentNode.value;
      }

      // Return the component
      return components.add(componentNode, 1);
    }
26938
function (path, context) {
        if (!path || typeof(path) != 'string') {
            Aria.$logError(Aria.NULL_CLASSPATH);
            return false;
        }
        var classpathParts = path.split('.'), nbParts = classpathParts.length;
        for (var index = 0; index < nbParts - 1; index++) {
            if (!__checkPackageName(classpathParts[index], context)) {
                return false;
            }
        }
        if (!__checkClassName(classpathParts[nbParts - 1], context)) {
            return false;
        }
        return true;
    }
1237992
function (className,config,path,npmPath)
		{
			var source = this.c || process.wns;
			var instance;
			var builder = this.getComponent&&this.getComponent('classBuilder');

			if (!source || !source[className])
			 { return false; }

			if (config.id)
				source[className].build.id = config.id;

			if (source[className].build.extend.indexOf('wnModule')!==-1)
			{
				instance = new source[className](self,config,path,npmPath,builder.classesPath);
			}
			else
				instance = new source[className](config,source);

			if (WNS_TEST && builder)
			{
				console.log('- Testing '+className)
				var tests = builder.classes[className].test;
				for (t in tests)
				{
					//console.log('Testing: '+t);
					tests[t](instance);
				}
			}
			return instance;
		}
250022
def _create_jspath(self) -> Path:
        """"""
        src = self._build_dir / 'bowtiejs'
        os.makedirs(src, exist_ok=True)
        return src
1171854
@Override
  protected void buildClassPath(ArrayList<String> pathList)
  {
    String path = null;
    
    if (_path instanceof JarPath)
      path = ((JarPath) _path).getContainer().getNativePath();
    else if (_path.isDirectory())
      path = _path.getNativePath();

    if (path != null && ! pathList.contains(path))
      pathList.add(path);
  }
579574
def compile_classpath(self, classpath_product_key, target, extra_cp_entries=None):
    """"""

    classpath_entries = list(
      entry.path
        for entry in self.compile_classpath_entries(classpath_product_key, target, extra_cp_entries)
    )

    # Verify that all classpath entries are under the build root.
    for entry in classpath_entries:
      assert entry.startswith(get_buildroot()), \
             "Classpath entry does not start with buildroot: {}".format(entry)

    return classpath_entries
147136
function (className,config,modulePath,npmPath)
		{
			var module = this.createClass(className,config,modulePath,npmPath);
			return module;
		}
912828
private static void getPath(BaseComponent comp, StringBuilder sb) {
        while (comp instanceof BaseMenuComponent) {
            sb.insert(0, "\\" + ((BaseMenuComponent) comp).getLabel());
            comp = comp.getParent();
        }
    }
729645
@Override
    public Resource createRelative(String relativePath) {
        String pathToUse = StringUtils.applyRelativePath(this.path, relativePath);
        return new ClassPathResource(pathToUse, this.classLoader, this.clazz);
    }
1013744
private void configureAdditionalClasspath(final ClassRealm realm) {
    log.debug("Configuring additional classpath with scope: {}", classpathScope);

    List<File> classpath = Lists.newArrayList();

    // add build output directory if scope includes 'compile'
    if (classpathScope.matches(compile)) {
      classpath.add(new File(project.getBuild().getOutputDirectory()));
    }

    // add build test output directory if scope includes 'test'
    if (classpathScope.matches(test)) {
      classpath.add(new File(project.getBuild().getTestOutputDirectory()));
    }

    // add matching project dependency artifacts
    if (!project.getArtifacts().isEmpty()) {
      for (Artifact artifact : project.getArtifacts()) {
        if (classpathScope.matches(artifact.getScope())) {
          File file = artifact.getFile();
          if (!file.exists()) {
            // for sanity, this should not really ever happen
            log.warn("Artifact not resolved; ignoring: {}", artifact);
            continue;
          }
          classpath.add(file);
        }
      }
    }

    if (!classpath.isEmpty()) {
      log.debug("Additional classpath:");
      for (File file : classpath) {
        log.debug("  {}", file);
        try {
          realm.addURL(file.toURI().toURL());
        }
        catch (MalformedURLException e) {
          throw Throwables.propagate(e);
        }
      }
    }
  }
1150663
function configureComponent(configPath, component, componentPath) {
    let config;
    try {
        config = require(configPath);

        // If this is the default variant
        if (!component.variant) {
            config.title = component.name;
            config.status = component.status;
            config.context = config.context || {};
            config.context.type = component.type;
        }

        config.variants = config.variants || [];
    } catch (e) {
        config = {
            title: component.name,
            status: component.status,
            context: {
                type: component.type,
            },
            variants: [],
        };
    }

    // Register the preview component
    if (component.preview) {
        config.preview = `@${[...componentPath, dashify(component.name), 'preview'].join('-')}`;
    }

    // Remove the variant if already present
    const variant = component.variant || 'default';
    config.variants = config.variants.filter(vt => vt.name !== variant);

    // Register the variant
    config.variants.push({
        name: variant,
        label: component.label || ((variant === 'default') ? component.name : variant),
        context: {
            config: component.config,
            parameters: component.parameters || {},
            request: component.request,
            component: component.class,
        },
    });

    config.variants = config.variants.sort((a, b) => {
        const aName = a.label.toLowerCase();
        const bName = b.label.toLowerCase();
        if (aName > bName) {
            return 1;
        }
        return (aName < bName) ? -1 : 0;
    });
    config.variants.forEach((v, i) => {
        config.variants[i].order = i;
    });

    // Write the configuration file
    writeFile(configPath, JSON.stringify(config, null, 4));

    // If there's a component note
    if ((variant === 'default') && component.notice) {
        const readme = path.join(path.dirname(configPath), 'README.md');
        writeFile(readme, component.notice);
    }
}
301350
def _jython_set_classpath(jars):
    '''
    
    '''
    from java.net import URL, URLClassLoader
    from java.lang import ClassLoader
    from java.io import File
    m = URLClassLoader.getDeclaredMethod("addURL", [URL])
    m.accessible = 1
    urls = [File(i).toURL() for i in jars]
    m.invoke(ClassLoader.getSystemClassLoader(), urls)
311699
function getComponentsWithExamples(root) {
    const componentsPath = `${__dirname}/../${root}/components`;
    return fs.readdirSync(componentsPath).map(component => ({
        name: component,
        sources: [`${componentsPath}/${component}`, `${componentsPath}/${component}/examples`]
    })).filter(isDirectory).map(obj => obj.name);
}
1371259
public ClassFinder addClasspath() {
    try {
      String path = System.getProperty("java.class.path");
      StringTokenizer tok = new StringTokenizer(path, File.pathSeparator);
      while (tok.hasMoreTokens())
        add(new File(tok.nextToken()));
    } catch (Exception ex) {
      log.error("Unable to get class path", ex);
    }
    return this;
  }
1286090
public void setClassPath(Path classpath) {
        pathComponents.removeAllElements();
        if (classpath != null) {
            Path actualClasspath = classpath.concatSystemClasspath("ignore");
            String[] pathElements = actualClasspath.list();
            for (int i = 0; i < pathElements.length; ++i) {
                try {
                    addPathElement(pathElements[i]);
                } catch (BuildException e) {
                    // ignore path elements which are invalid
                    // relative to the project
                }
            }
        }
    }
825389
function (classpath) {
            var basePath = Aria.getLogicalPath(classpath);
            for (var i = 0, l = atExtensions.length; i < l; i++) {
                try {
                    var logicalPath = basePath + atExtensions[i];
                    var cacheItem = require.cache[require.resolve(logicalPath)];
                    if (cacheItem) {
                        return logicalPath;
                    }
                } catch (e) {
                    // require.resolve can throw an exception in node.js if the file does not exist
                    // simply try other extensions in that case
                }
            }
            // it may be the classpath of a resource (which would not appear in the require cache):
            var resMgr = aria.core.ResMgr;
            if (resMgr) {
                return resMgr.getResourceLogicalPath(basePath);
            }
        }