Package org.apache.tools.ant.types

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


     * nested classpath element.
     *
     * @since Ant 1.6
     */
    private void createClassLoader() {
        Path userClasspath = getCommandline().getClasspath();
        if (userClasspath != null) {
            if (reloading || classLoader == null) {
                deleteClassLoader();
                Path classpath = (Path) userClasspath.clone();
                if (includeAntRuntime) {
                    log("Implicitly adding " + antRuntimeClasses
                        + " to CLASSPATH", Project.MSG_VERBOSE);
                    classpath.append(antRuntimeClasses);
                }
                classLoader = getProject().createClassLoader(classpath);
                if (getClass().getClassLoader() != null
                    && getClass().getClassLoader() != Project.class.getClassLoader()) {
                    classLoader.setParent(getClass().getClassLoader());
View Full Code Here


        // Initializing javac task
        getProject();
        Javac javac = (Javac) project.createTask("javac");
       
        // Initializing classpath
        Path path = new Path(project);
        path.setPath(System.getProperty("java.class.path"));
        info.append("    cp=" + System.getProperty("java.class.path") + "\n");
        StringTokenizer tokenizer = new StringTokenizer(classpath, sep);
        while (tokenizer.hasMoreElements()) {
            String pathElement = tokenizer.nextToken();
            File repository = new File(pathElement);
            path.setLocation(repository);
            info.append("    cp=" + repository + "\n");
        }
       
        if( log.isDebugEnabled() )
            log.debug( "Using classpath: " + System.getProperty("java.class.path") + sep
                    + classpath);
       
        // Initializing sourcepath
        Path srcPath = new Path(project);
        srcPath.setLocation(options.getScratchDir());
       
        info.append("    work dir=" + options.getScratchDir() + "\n");
       
        // Initialize and set java extensions
        String exts = System.getProperty("java.ext.dirs");
        if (exts != null) {
            Path extdirs = new Path(project);
            extdirs.setPath(exts);
            javac.setExtdirs(extdirs);
            info.append("    extension dir=" + exts + "\n");
        }
       
        // Configure the compiler object
View Full Code Here

          File path = list.getDir(this.getProject());
          File file = new File(path, fileName);
          lastModified = Math.max(getLastModifiedTime(file), lastModified);
        }
      } else if (entry instanceof Path) {
        Path path = (Path) entry;
        for (String src : path.list()) {
          File file = new File(src);
          lastModified = Math.max(getLastModifiedTime(file), lastModified);
        }
      }
    }
View Full Code Here

        scrLog.debug( "  generateAccessors: " + generateAccessors );
        scrLog.debug( "  strictMode: " + strictMode );
        scrLog.debug( "  specVersion: " + specVersion );

        try {
            final Path classPath = createClasspath();
            final org.apache.felix.scrplugin.Project project = new org.apache.felix.scrplugin.Project();
            project.setClassLoader(getClassLoader( this.getClass().getClassLoader() ));

            project.setDependencies(getDependencies(classPath));
            project.setSources(getSourceFiles(getImplicitFileSet()));
View Full Code Here

        }
        return files;
    }

    private ClassLoader getClassLoader( final ClassLoader parent ) throws BuildException {
        Path classPath = createClasspath();
        log( "Using classes from: " + classPath, Project.MSG_DEBUG );
        return getProject().createClassLoader( parent, classpath );
    }
View Full Code Here

    // ---------- setters for configuration fields

    public Path createClasspath() {
        if ( this.classpath == null ) {
            this.classpath = new Path( getProject() );
        }
        return this.classpath;
    }
View Full Code Here

    }

    public void setDestdir( File outputDirectory ) {
        this.destdir = outputDirectory;
        if ( destdir != null ) {
            Path dst = new Path( getProject() );
            dst.setLocation( destdir );
            createClasspath().add( dst );
        }
    }
View Full Code Here

        this.revision = revision;
    }

    public void setClasspathref(String value)
    {
        Path p = (Path) getProject().getReference(value);
        if (p == null)
        {
            throw new BuildException(value + "is not a path reference.");
        }

        String[] paths = p.list();
        classpath = new File[paths.length];
        for (int i = 0; i < paths.length; ++i)
        {
            classpath[i] = new File(paths[i]);
        }
View Full Code Here

          }

              FileUtils fu = FileUtils.newFileUtils();
              for(Iterator iterator = paths.iterator(); iterator.hasNext();)
              {
                  Path path = (Path)iterator.next();
                  String pathElements[] = path.list();
                  int i = 0;
                  while(i < pathElements.length)
                  {
                      String pathElement = pathElements[i];
                      URL url;
View Full Code Here

          paths.add(path);
      }

      public void setPath(String path)
      {
          paths.add(new Path(getProject(), path));
      }
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.