/** * bnd maintains a class path that is set by the environment, i.e. bnd is * not in charge of it. */ public void addClasspath(File f) { if (!f.isFile() && !f.isDirectory()) { msgs.AddingNonExistentFileToClassPath_(f); } Container container = new Container(f, null); classpath.add(container); }
/** * @param bsn * @param range * @param attrs * @param result * @return */ protected Container toContainer(String bsn, String range, Map<String,String> attrs, File result, DownloadBlocker db) { File f = result; if (f == null) { msgs.ConfusedNoContainerFile(); f = new File("was null"); } Container container; if (f.getName().endsWith("lib")) container = new Container(this, bsn, range, Container.TYPE.LIBRARY, f, null, attrs, db); else container = new Container(this, bsn, range, Container.TYPE.REPO, f, null, attrs, db); return container; }
if (clz != null) { if (!target.isAssignableFrom(clz)) { msgs.IncompatibleHandler_For_(launcher, defaultHandler); } else { logger.debug("found handler {} from {}", defaultHandler, c);
public String _repo(String args[]) throws Exception { if (args.length < 2) { msgs.RepoTooFewArguments(_repoHelp, args); return null; } String bsns = args[1]; String version = null; Strategy strategy = Strategy.HIGHEST; if (args.length > 2) { version = args[2]; if (args.length == 4) { if (args[3].equalsIgnoreCase("HIGHEST")) strategy = Strategy.HIGHEST; else if (args[3].equalsIgnoreCase("LOWEST")) strategy = Strategy.LOWEST; else if (args[3].equalsIgnoreCase("EXACT")) strategy = Strategy.EXACT; else msgs.InvalidStrategy(_repoHelp, args); } } Collection<String> parts = split(bsns); List<String> paths = new ArrayList<String>(); for (String bsn : parts) { Container container = getBundle(bsn, version, strategy, null); add(paths, container); } return join(paths); }
found = new Container(project, bsn, versionRange, Container.TYPE.PROJECT, f, null, attrs, null); } else { msgs.NoSuchProject(bsn, spec); continue; if (source != null) message = String.format("%s (from property: %s)", message, source); msgs.CircularDependencyContext_Message_(getName(), message); msgs.Unexpected_Error_(spec, e);
msgs.NoOutputDirectory_(output); else { Container c = new Container(this, output); Project required = getWorkspace().getProject(p); if (required == null) msgs.MissingDependson_(p); else { dependencies.add(required);
null); } else { msgs.NoSuchProject(bsn, spec) .context(bsn) .header(source); if (source != null) message = String.format("%s (from property: %s)", message, source); msgs.CircularDependencyContext_Message_(getName(), message); } catch (IOException e) { exception(e, "Unexpected exception in get bundles", spec);
/** * Deploy the current project to a repository * * @throws Exception */ public void deploy() throws Exception { Parameters deploy = new Parameters(getProperty(DEPLOY), this); if (deploy.isEmpty()) { warning("Deploying but %s is not set to any repo", DEPLOY); return; } File[] outputs = getBuildFiles(); for (File output : outputs) { for (Deploy d : getPlugins(Deploy.class)) { logger.debug("Deploying {} to: {}", output.getName(), d); try { if (d.deploy(this, output.getName(), new BufferedInputStream(IO.stream(output)))) logger.debug("deployed {} successfully to {}", output, d); } catch (Exception e) { msgs.Deploying(e); } } } }
/** * The user selected pom in a path. This will place the pom as well as its * dependencies on the list * * @param strategyx the strategy to use. * @param result The list of result containers * @throws Exception anything goes wrong */ public void doMavenPom(Strategy strategyx, List<Container> result, String action) throws Exception { File pomFile = getFile("pom.xml"); if (!pomFile.isFile()) msgs.MissingPom(); else { ProjectPom pom = getWorkspace().getMaven() .createProjectModel(pomFile); if (action == null) action = "compile"; Pom.Scope act = Pom.Scope.valueOf(action); Set<Pom> dependencies = pom.getDependencies(act); for (Pom sub : dependencies) { File artifact = sub.getArtifact(); Container container = new Container(artifact, null); result.add(container); } } }
return; } catch (Exception e) { msgs.DeployingFile_On_Exception_(file, rp.getName(), e);
return toContainer(bsn, version, attrs, result, blocker); } else msgs.FoundVersions_ForStrategy_ButNoProvider(versions, useStrategy);
msgs.CircularDependencyContext_Message_(this.getName(), visited.toString()); return false;
null); } else { msgs.NoSuchProject(bsn, spec); continue; if (source != null) message = String.format("%s (from property: %s)", message, source); msgs.CircularDependencyContext_Message_(getName(), message); msgs.Unexpected_Error_(spec, e);
public String _repo(String args[]) throws Exception { if (args.length < 2) { msgs.RepoTooFewArguments(_repoHelp, args); return null; strategy = Strategy.EXACT; else msgs.InvalidStrategy(_repoHelp, args);
msgs.NoOutputDirectory_(output); else { Container c = new Container(this, output); msgs.MissingDependson_(u.getInput());
null); } else { msgs.NoSuchProject(bsn, spec) .context(bsn) .header(source); if (source != null) message = String.format("%s (from property: %s)", message, source); msgs.CircularDependencyContext_Message_(getName(), message); } catch (IOException e) { exception(e, "Unexpected exception in get bundles", spec);
/** * Deploy the current project to a repository * * @throws Exception */ public void deploy() throws Exception { Parameters deploy = new Parameters(getProperty(DEPLOY), this); if (deploy.isEmpty()) { warning("Deploying but %s is not set to any repo", DEPLOY); return; } File[] outputs = getBuildFiles(); for (File output : outputs) { for (Deploy d : getPlugins(Deploy.class)) { logger.debug("Deploying {} to: {}", output.getName(), d); try { if (d.deploy(this, output.getName(), new BufferedInputStream(IO.stream(output)))) logger.debug("deployed {} successfully to {}", output, d); } catch (Exception e) { msgs.Deploying(e); } } } }
/** * The user selected pom in a path. This will place the pom as well as its * dependencies on the list * * @param strategyx * the strategy to use. * @param result * The list of result containers * @param attrs * The attributes * @throws Exception * anything goes wrong */ public void doMavenPom(Strategy strategyx, List<Container> result, String action) throws Exception { File pomFile = getFile("pom.xml"); if (!pomFile.isFile()) msgs.MissingPom(); else { ProjectPom pom = getWorkspace().getMaven().createProjectModel(pomFile); if (action == null) action = "compile"; Pom.Scope act = Pom.Scope.valueOf(action); Set<Pom> dependencies = pom.getDependencies(act); for (Pom sub : dependencies) { File artifact = sub.getArtifact(); Container container = new Container(artifact, null); result.add(container); } } }
msgs.DeployingFile_On_Exception_(file, rp.getName(), e);
return toContainer(bsn, version, attrs, result, blocker); } else { msgs.FoundVersions_ForStrategy_ButNoProvider(versions, useStrategy);