Package aQute.bnd.build

Examples of aQute.bnd.build.Project


        throw new BuildException("The given base dir does not exist " + basedir);

      Workspace workspace = Workspace.getWorkspace(basedir.getParentFile());
      workspace.addBasicPlugin(new ConsoleProgress());

      Project project = workspace.getProject(basedir.getName());
      if (project == null)
        throw new BuildException("Unable to find bnd project in directory: " + basedir);

      project.setProperty("in.ant", "true");
      project.setProperty("environment", "ant");

      // Check if we are in a sub build, in that case
      // top will be set to the target directory at the
      // top project.
      if (top != null && top.length() > 0 && !top.startsWith("$"))
        project.setProperty("top", top);

      project.setExceptions(true);

      Properties properties = project.getFlattenedProperties();

      checkForTesting(project, properties);

      if (report() || report(workspace) || report(project))
        throw new BuildException("Errors during preparing bnd");
View Full Code Here


        context.registerService(Workspace.class.getName(), ws, null);
    }

    public Project getModel(IJavaProject project) {
        try {
            Project model = javaProjectToModel.get(project);
            if (model == null) {
                File projectDir = project.getProject().getLocation()
                        .makeAbsolute().toFile();
                model = Workspace.getProject(projectDir);
                if (workspace == null) {
                    model.getWorkspace();
                }
                if (model != null) {
                    javaProjectToModel.put(project, model);
                }
            }
View Full Code Here

                                                .getCurrentProjects());
                                    }
                                    return false;
                                }
                                if (workspace.isPresent(file.getName())) {
                                    Project project = workspace.getProject(file
                                            .getName());
                                    changed.add(project);
                                } else {
                                    ; // Project not created yet, so we
                                    // have
View Full Code Here

        if (jp != null) {
          if (!jp.getProject().isAccessible()) {
            continue;
          }

          Project project = Activator.getDefault().getCentral().getModel(jp);
          if (project != null) {
            File bndFile = project.getFile("bnd.bnd");
            if (!bndFile.exists()) {
              continue;
            }
            projects.add(project);
          }
View Full Code Here

        try {
            if (basedir == null || !basedir.isDirectory())
                throw new BuildException("The given base dir does not exist "
                        + basedir);

            Project project = Workspace.getProject(basedir);
            project.setProperty("in.ant", "true");
            project.setProperty("environment", "ant");
           
            // Check if we are in a sub build, in that case
            // top will be set to the target directory at the
            // top project.
            if ( top!=null && top.length()>0 && !top.startsWith("$"))
                project.setProperty("top", top);
           
            project.setExceptions(true);
            Properties properties = project.getFlattenedProperties();
            if (report() || report(project))
                throw new BuildException(
                        "Errors during Eclipse Path inspection");

            copyProperties(properties);
View Full Code Here

            if (locations != null) {
                for (int i = 0; i < locations.length; i++) {
                    try {
                        File mf = locations[i].getLocation().toFile();
                        if (mf.getName().equals(Project.BNDFILE)) {
                            Project project = Workspace.getProject(mf
                                    .getParentFile());
                            File[] files = project.build();
                            String target = "";
                            if ( files != null ) {
                                for ( File f : files ) {
                                    target += f + " ";
                                   
View Full Code Here

    if (basedir == null)
      throw new BuildException("No basedir set");

    try {
      Project project = Workspace.getProject(basedir);
      project.setProperty("in.ant", "true");
      project.setProperty("environment", "ant");
      project.setExceptions(true);
      project.setTrace(trace);
      project.setPedantic(pedantic);

      project.action(command);

      if (report(project))
        throw new BuildException("Command " + command + " failed");
    } catch (Throwable e) {
      if (exceptions)
View Full Code Here

public class DeployTask extends BaseTask {
    List<FileSet> filesets = new ArrayList<FileSet>();

    public void execute() throws BuildException {
        try {
            Project project = Workspace.getProject(getProject().getBaseDir());

            // Deploy the files that need to be released
            for (FileSet fileset : filesets) {
                DirectoryScanner ds = fileset.getDirectoryScanner(getProject());
                String[] files = ds.getIncludedFiles();
                if (files.length == 0)
                    trace("No files included");

                for (int i = 0; i < files.length; i++) {
                    File file = new File(ds.getBasedir(), files[i]);
                    try {
                        if (file.isFile() && file.getName().endsWith(".jar")) {
                            project.deploy(file);
                        } else
                            error("Not a jar file: " + file);
                    } catch (Exception e) {
                        error("Failed to deploy " + file + " : " + e);
                    }
                }
            }
            report(project);
            if (project.getErrors().size() > 0)
                throw new BuildException("Deploy failed");
        } catch (Throwable t) {
            t.printStackTrace();
            throw new BuildException(t);
        }
View Full Code Here

  public void execute() throws BuildException {
    try {
      if (basedir == null || !basedir.isDirectory())
        throw new BuildException("The given base dir does not exist " + basedir);

      Project project = Workspace.getProject(basedir);
      if (project == null)
        throw new BuildException("Unable to find bnd project in directory: " + basedir);

      project.setProperty("in.ant", "true");
      project.setProperty("environment", "ant");

      // Check if we are in a sub build, in that case
      // top will be set to the target directory at the
      // top project.
      if (top != null && top.length() > 0 && !top.startsWith("$"))
        project.setProperty("top", top);

      project.setExceptions(true);
      Properties properties = project.getFlattenedProperties();
      if (report() || report(project))
        throw new BuildException("Errors during Eclipse Path inspection");

      copyProperties(properties);
    }
View Full Code Here

    OutputStream outStream = null;
    try {
      // Prepare the project to be packaged
      List<Project> projects;
      File baseDir = getProject().getBaseDir();
      Project baseProject = Workspace.getProject(baseDir);

      Project packageProject;
      if (runFilePath == null || runFilePath.length() == 0 || ".".equals(runFilePath)) {
        packageProject = baseProject;
      } else {
        File runFile = new File(baseDir, runFilePath);
        if (!runFile.isFile())
          throw new BuildException(String.format("Run file %s does not exist (or is not a file).", runFile.getAbsolutePath()));
        packageProject = new Project(baseProject.getWorkspace(), baseDir, runFile);
        packageProject.setParent(baseProject);
      }

      // Package it
      packageProject.clear();
      ProjectLauncher launcher = packageProject.getProjectLauncher();
      Jar jar = launcher.executable();

      outStream = new FileOutputStream(output);
      jar.write(outStream);
    }
View Full Code Here

TOP

Related Classes of aQute.bnd.build.Project

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.