Package org.apache.tools.ant.types.Path

Examples of org.apache.tools.ant.types.Path.PathElement


    private Path makePath(String pathId, List<ArtifactDownloadReport> artifacts) {
        log("Path '" + pathId + "' computed with " + artifacts.size() + " files", Project.MSG_VERBOSE);
        Path path = new Path(getProject());
        for (ArtifactDownloadReport artifact : artifacts) {
            if (artifact.getLocalFile() != null) {
                PathElement pe = path.createPathElement();
                pe.setLocation(artifact.getLocalFile());
                log("Adding to path '" + pathId + "': " + artifact.getLocalFile(), Project.MSG_DEBUG);
            }
        }

        getProject().addReference(pathId, path);
View Full Code Here


          if (inclResult != null && exclResult == null)
          {
            //THIS is the only specific code
            if (verbose)
              System.out.println("Adding  " + path + " to classpath " + idContainer);
            PathElement element = this.path.createPathElement();
            element.setLocation(new File(path));
          }
        }
      }
    }
View Full Code Here

    folders.addAll(buildConfig.getSourceDirectories(scope));
    folders.addAll(buildConfig.getSourceDirectories(Scope.defaultScope));
   
    Path sources = new Path(getProject());
    for (File file : folders) {
      PathElement element = sources.createPathElement();
      element.setLocation(file);
    }
    setPathReference(key, sources, true);
  }
View Full Code Here

    folders.addAll(buildConfig.getResourceDirectories(scope));
    folders.addAll(buildConfig.getResourceDirectories(Scope.defaultScope));
   
    Path sources = new Path(getProject());
    for (File file : folders) {
      PathElement element = sources.createPathElement();
      element.setLocation(file);
    }
    setPathReference(key, sources, true);
  }
View Full Code Here

  }
 
  private void setClasspath(Key key, Build build, Scope scope, boolean includeResources, boolean includeJars) {
    Path cp = new Path(getProject());
    // output folder
    PathElement of = cp.createPathElement();
    of.setLocation(build.getConfig().getOutputDirectory(scope));
    if (!scope.isDefault()) {
      of.setLocation(build.getConfig().getOutputDirectory(Scope.compile));
    }
   
    // add resource directories to the runtime/test classpath
    if (includeResources) {
      for (File dir : build.getConfig().getResourceDirectories(scope)) {
        PathElement pe = cp.createPathElement();
        pe.setLocation(dir);
      }

      // add resource directories to the runtime/test classpath
      if (!scope.isDefault()) {
        for (File dir : build.getConfig().getResourceDirectories(Scope.compile)) {
          PathElement pe = cp.createPathElement();
          pe.setLocation(dir);
        }
      }
    }

    // add project dependencies
    for (File folder : buildDependentProjectsClasspath(build)) {
      PathElement element = cp.createPathElement();
      element.setLocation(folder);
    }
   
    // jars
    if (includeJars) {
      for (File jar : build.getSolver().getClasspath(scope)) {
        PathElement element = cp.createPathElement();
        element.setLocation(jar);
      }
    }
   
    setPathReference(key, cp, true);
  }
View Full Code Here

 
  private void setDependencypath(Key key, Build build, Scope scope) {
    List<File> jars = build.getSolver().getClasspath(scope);
    Path cp = new Path(getProject());
    for (File jar : jars) {
      PathElement element = cp.createPathElement();
      element.setLocation(jar);
    }
    setPathReference(key, cp, true);
  }
View Full Code Here

    console.debug(1, "projectdir = {0}", build.getConfig().getProjectDirectory());

    // create sourcepath
    Path sources = createSrc();
    for (File file : build.getConfig().getSourceDirectories(scope, tag)) {
      PathElement element = sources.createPathElement();
      element.setLocation(file);
    }
    console.debug(1, "sources = {0}", sources);

    // set output folder
    setDestdir(build.getConfig().getOutputDirectory(scope));
    console.debug(1, "destdir = {0}", getDestdir());

    // create classpath
    Path classpath = createClasspath();
    if (Scope.test.equals(scope)) {
      // add the compile output folder
      PathElement element = classpath.createPathElement();
      element.setLocation(build.getConfig().getOutputDirectory(Scope.compile));
    }
    for (File file : build.getSolver().getClasspath(scope)) {
      PathElement element = classpath.createPathElement();
      element.setLocation(file);
    }
    for (Build subbuild : build.getSolver().getLinkedModules()) {
      PathElement element = classpath.createPathElement();
      element.setLocation(subbuild.getConfig().getOutputDirectory(Scope.compile));
    }
    console.debug(1, "classpath = {0}", classpath);

    for (SourceDirectory sd : build.getConfig().getSourceDirectories()) {
      // clean apt source directories before compiling
View Full Code Here

        for (String path : cp.list()) {
          if (path.toLowerCase().endsWith(".jar")) {
            LibrarySpec lib = createLibrary();
            lib.setJar(path);
          } else {
            PathElement element = classpath.createPathElement();
            element.setPath(path);
          }
        }
      } else {
        // standard GenJar class dependency resolution
        classpath = cp;
View Full Code Here

  private Path buildClasspath(Build build, Scope scope, String tag) {
    List<File> jars = build.getSolver().getClasspath(scope, tag);
    Path cp = new Path(getProject());
    // output folder
    PathElement of = cp.createPathElement();
    of.setLocation(build.getConfig().getOutputDirectory(scope));
    if (!scope.isDefault()) {
      of.setLocation(build.getConfig().getOutputDirectory(Scope.compile));
    }
   
    // add project dependencies
    for (File folder : buildDependentProjectsClasspath(build)) {
      PathElement element = cp.createPathElement();
      element.setLocation(folder);
    }
   
    // jars
    for (File jar : jars) {
      PathElement element = cp.createPathElement();
      element.setLocation(jar);
    }

    return cp;
  }
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.types.Path.PathElement

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.