public void setExtdirs(String exts) { Path extdirs = new Path(project); extdirs.setPath(exts); javac.setExtdirs(extdirs); info.append(" extdirs=" + exts+ "\n"); }
public void setExtdirs(String exts) { Path extdirs = new Path(project); extdirs.setPath(exts); javac.setExtdirs(extdirs); info.append(" extdirs=" + exts + "\n"); }
public Path getPathFromArtifacts( Collection artifacts, Project antProject ) throws DependencyResolutionRequiredException { List list = new ArrayList( artifacts.size() ); for ( Iterator i = artifacts.iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); File file = a.getFile(); if ( file == null ) { throw new DependencyResolutionRequiredException( a ); } list.add( file.getPath() ); } Path p = new Path( antProject ); p.setPath( StringUtils.join( list.iterator(), File.pathSeparator ) ); return p; }
public Path getPathFromArtifacts( Collection<Artifact> artifacts, Project antProject ) throws DependencyResolutionRequiredException { List<String> list = new ArrayList<>( artifacts.size() ); for ( Artifact a : artifacts ) { File file = a.getFile(); if ( file == null ) { throw new DependencyResolutionRequiredException( a ); } list.add( file.getPath() ); } Path p = new Path( antProject ); p.setPath( StringUtils.join( list.iterator(), File.pathSeparator ) ); return p; }
private static Path getPathFromArtifacts(Collection<Artifact> artifacts, Project antProject) throws DependencyResolutionRequiredException { if (artifacts == null) { return new Path(antProject); } List<String> list = new ArrayList<String>(artifacts.size()); for (Artifact a : artifacts) { File file = a.getFile(); if (file == null) { throw new DependencyResolutionRequiredException(a); } list.add(file.getPath()); } Path p = new Path(antProject); p.setPath(StringUtils.join(list.iterator(), File.pathSeparator)); return p; }
/** * @param artifacts * @param antProject * @return a path * @throws DependencyResolutionRequiredException */ public Path getPathFromArtifacts(Collection<Artifact> artifacts, Project antProject) throws DependencyResolutionRequiredException { if (artifacts == null) { return new Path(antProject); } List<String> list = new ArrayList<String>(artifacts.size()); for (Iterator<?> i = artifacts.iterator(); i.hasNext();) { Artifact a = (Artifact) i.next(); File file = a.getFile(); if (file == null) { throw new DependencyResolutionRequiredException(a); } list.add(file.getPath()); } Path p = new Path(antProject); p.setPath(StringUtils.join(list.iterator(), File.pathSeparator)); return p; }
/** * @param artifacts {@link Artifact} collection. * @param antProject {@link Project} * @return {@link Path} * @throws DependencyResolutionRequiredException In case of a failure. * */ public Path getPathFromArtifacts( Collection<Artifact> artifacts, Project antProject ) throws DependencyResolutionRequiredException { if ( artifacts == null ) { return new Path( antProject ); } List<String> list = new ArrayList<String>( artifacts.size() ); for ( Artifact a : artifacts ) { File file = a.getFile(); if ( file == null ) { throw new DependencyResolutionRequiredException( a ); } list.add( file.getPath() ); } Path p = new Path( antProject ); p.setPath( StringUtils.join( list.iterator(), File.pathSeparator ) ); return p; }
/** * Create the Ant equivalent of the Maven classpath's for compile, runtime, test, and for the plugin */ public Map<String, Path> getPathRefs(Project ant, MavenProject mvn, List<Artifact> pluginArtifacts) throws DependencyResolutionRequiredException { Map<String, Path> pathRefs = new HashMap<String, Path>(); // compile Path mcp = new Path(ant); mcp.setPath(StringUtils.join(mvn.getCompileClasspathElements().iterator(), File.pathSeparator)); pathRefs.put(MVN_COMPILE_CLASSPATH_KEY, mcp); // runtime Path mrp = new Path(ant); mrp.setPath(StringUtils.join(mvn.getRuntimeClasspathElements().iterator(), File.pathSeparator)); pathRefs.put(MVN_RUNTIME_CLASSPATH_KEY, mrp); // test Path mtp = new Path(ant); mtp.setPath(StringUtils.join(mvn.getTestClasspathElements().iterator(), File.pathSeparator)); pathRefs.put(MVN_TEST_CLASSPATH_KEY, mtp); // plugin Path mpp = getPathFromArtifacts(pluginArtifacts, ant); pathRefs.put(MVN_PLUGIN_CLASSPATH_KEY, mpp); return pathRefs; }
String classpath = ((AntClassLoader) getClass() .getClassLoader()).getClasspath(); createClasspath().setPath( StringUtil.replaceAll(classpath, "%20", " ")); } else if (getClass().getClassLoader() instanceof URLClassLoader) { String classpath = (new File(earls[i].getFile())) .getAbsolutePath(); createClasspath().setPath( StringUtil.replaceAll(classpath, "%20", " "));
fbtask.setAuxClasspath(task.getClasspath()); Path destPath = new Path( task.getProject() ); destPath.setPath(task.getDestdir().getAbsolutePath()); fbtask.setAuxAnalyzepath(destPath); fbtask.setOutputFile(getFileName(task.getProject()));
p.setPath(StringUtils.join(project.getCompileClasspathElements().iterator(), File.pathSeparator)); p.setPath(StringUtils.join(project.getRuntimeClasspathElements().iterator(), File.pathSeparator)); antProject.addReference("maven.runtime.classpath", p); p.setPath(StringUtils.join(project.getTestClasspathElements().iterator(), File.pathSeparator)); antProject.addReference("maven.test.classpath", p);
/** * Initialize Ant. * @param project a Maven project * @param context the maven context whose properties will be available to the Ant Project * @return an Ant project */ public static GrantProject build( final Project project, final MavenJellyContext context ) { // Create the build listener. JellyBuildListener buildListener = new JellyBuildListener( context.getXMLOutput() ); buildListener.setDebug( context.getDebugOn().booleanValue() ); buildListener.setEmacsMode( context.getEmacsModeOn().booleanValue() ); // Create our ant project. GrantProject antProject = new GrantProject(); antProject.setPropsHandler( new JellyPropsHandler( context ) ); antProject.init(); antProject.setBaseDir( project.getFile().getParentFile().getAbsoluteFile() ); antProject.addBuildListener( buildListener ); context.setAntProject( antProject ); AntTagLibrary.setProject( context, antProject ); Path p = new Path( antProject ); p.setPath( project.getDependencyClasspath() ); antProject.addReference( MavenConstants.DEPENDENCY_CLASSPATH, p ); return antProject; } }
classpath.setPath(System.getProperty("java.class.path")); classpath.add(new Path(project, destDir.getAbsolutePath())); compiler.setClasspath(classpath);