/** * Creates or returns the already created <CODE>CommandlineJava</CODE>. */ protected CommandlineJava getJavaCommand() { if(null == m_javaCommand) { m_javaCommand = new CommandlineJava(); } return m_javaCommand; }
/** * Adds an environment variable; used when forking. */ public void addEnv(Environment.Variable var) { m_environment.addVariable(var); }
public void setClasspath(Path classpath) { if (this.classpath == null) { this.classpath = classpath; } else { this.classpath.append(classpath); } }
private void doSourcePath(final Commandline toExecute, final Path sourceDirs) { if (!sourceDirs.isEmpty()) { toExecute.createArgument().setValue("-sourcepath"); toExecute.createArgument().setPath(sourceDirs); } }
/** * Adds path to classpath used for tests. * * @return reference to the classpath in the embedded java command line */ public Path createClasspath() { return getJavaCommand().createClasspath(getProject()).createPath(); }
/** * Adds a path to the bootclasspath. * @return reference to the bootclasspath in the embedded java command line */ public Path createBootclasspath() { return getJavaCommand().createBootclasspath(getProject()).createPath(); }
private void processError(Exception e) { Writer writer = new StringBuilderWriter(); new ErrorReporter(e, false).write(new PrintWriter(writer)); String message = writer.toString(); throw new BuildException("Script Failed: " + message, e, getLocation()); }
private ResourceCollection createResourceCollection(Reference ref) { Object o = ref.getReferencedObject(); if (!(o instanceof ResourceCollection)) { throw new BuildException("Only File based ResourceCollections are supported."); } ResourceCollection rc = (ResourceCollection) o; if (!rc.isFilesystemOnly()) { throw new BuildException("Only ResourceCollections from local file system are supported."); } return rc; }
private static void unzipExceptClasses(File archive, File destDir, Project prj) { Expand e = new Expand(); e.setProject(prj); e.setTaskType("unzip"); e.setSrc(archive); e.setDest(destDir); PatternSet p = new PatternSet(); p.setExcludes("WEB-INF/classes/"); e.addPatternset(p); e.execute(); }
/** * Return a TarFileSet that has the same properties * as this one. * @return the cloned tarFileSet */ @Override public Object clone() { if (isReference()) { return getRef(getProject()).clone(); } return super.clone(); }
/** * Return a ZipFileSet that has the same properties * as this one. * @return the cloned zipFileSet */ @Override public Object clone() { if (isReference()) { return getRef(getProject()).clone(); } return super.clone(); }
/** * Set the class path. * @param classpath the path to locate classes */ public void setClasspath(Path classpath) { if (this.classpath == null) { this.classpath = classpath; } else { this.classpath.append(classpath); } }
public void setModulepath(Path modulepath) { if (this.modulepath == null) { this.modulepath = modulepath; } else { this.modulepath.append(modulepath); } }
public void setClasspath(Path classpath) { if (this.classpath == null) { this.classpath = classpath; } else { this.classpath.append(classpath); } }
public void setSourcepath(Path sourcepath) { if (this.sourcepath == null) { this.sourcepath = sourcepath; } else { this.sourcepath.append(sourcepath); } }
public void setSrcdir(final Path dir) { assert dir != null; if (src == null) { src = dir; } else { src.append(dir); } }
/** * Set the sourcepath to be used for this compilation. * * @param sourcepath the source path */ public void setSourcepath(Path sourcepath) { if (compileSourcepath == null) { compileSourcepath = sourcepath; } else { compileSourcepath.append(sourcepath); } }
/** * Set the source directories to find the source Java files. * * @param srcDir the source directories as a path */ public void setSrcdir(Path srcDir) { if (src == null) { src = srcDir; } else { src.append(srcDir); } }
public void setSrcdir(final Path dir) { assert dir != null; if (src == null) { src = dir; } else { src.append(dir); } }
/** * Set the classpath to be used for this compilation. * * @param classpath an Ant Path object containing the compilation classpath. */ public void setClasspath(Path classpath) { if (compileClasspath == null) { compileClasspath = classpath; } else { compileClasspath.append(classpath); } }